Giter Site home page Giter Site logo

tars-utils's Introduction

简介

TARS: 取自电影《星际穿越》中智能机器人的角色名。

tars-utils 是一个前端常用工具方法库,整理了在前端项目里高频使用的 utils 方法,所有方法均以简洁易读的 es2015+ 语法实现。

欢迎直接引用本库,也欢迎查看并选用本项目里个别方法的实现。

https://github.com/Jamie-Yang/tars-utils

文档

TODO

示例

const chunk = tars.chunk([1, 2, 3, 4], 2); // => [[1, 2], [3, 4]]

const hashParams = tars.getHashParams('https://g.com#a=1&b=2'); // => { a:1, b:2 }

安装

tars-utils

使用 npm 安装

npm install tars-utils --save
import tars from 'tars-utils';

单个功能导入,有利于打包工具进行 TreeShaking:

import { randomColor } from 'tars';

HTML 引入

<script type="text/javascript" src="tars-utils.min.js"></script>

使用 tars 为全局变量

<script type="text/javascript">
  tars.isIOS(); // => true or false
</script>

下载

开源协议

MIT License

tars-utils's People

Contributors

jamie-yang avatar cdqrain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.