GithubHelp home page GithubHelp logo

charlesgc / utils-lite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiguaxigua/utils-lite

0.0 1.0 0.0 674 KB

utils for smaller and convenient

Home Page: http://daxigua.me/utils-lite

License: MIT License

JavaScript 94.06% CSS 5.94%

utils-lite's Introduction

download version npm bundle size (minified) language License

Install

npm i utils-lite -S

Start JS

use npm

import { debounce } from 'utils-lite'
// commonjs package is 'utils-lite/lib/index.cjs.js'
debounce(() => {
  // code...
}, 1000)

use cdn

<script src="https://unpkg.com/utils-lite/lib/index.umd.min.js"></script>
<script>
UtilsLite.debounce(function () {
  // code ...
}, 1000)
</script>

Start CSS

Now css utils package has three file type: less, sass, stylus as index.less/ index.sass/index.styl, you can choose one and import to you project, for example

@import 'project-path/node_modules/utils-lite/index.less';
.test {
  .text-ellipsis
}
@import 'project-path/node_modules/utils-lite/index.sass';
.test {
  @include text-ellipsis;
}
@import 'project-path/node_modules/utils-lite/index.styl';
.test
  text-ellipsis();

JS Utils List

debounce

debounce(<fn>, <delay>)

throttle

throttle(<fn>, <wait>, [delay])

get

get(<target>, <path>, [default])

path format: 'a.b.c'

set

set(<target>, <path>, <value>)

clone

clone(<target>)

cloneDeep

cloneDeep(<target>)

getType

getType(<target>)

getTypeof

getTypeof(<target>)

isObject

isObject(<target>)

isArray

isArray(<target>)

isFunction

isFunction(<target>)

isString

isString(<target>)

isBoolean

isBoolean(<target>)

isEmptyObj

isEmptyObj(<target>)

isNumber

isNumber(<target>)

getStore

getStore(<key>)

setStore

setStore(<key>, <value>)

kebabToCamel

kebabToCamel(<key>)

camelToKebab

camelToKebab(<key>)

unique

unique(<array>)

getLinearValue

getLinearValue(<x1>, <y1>, <x2>, <y2>, [x3])

getFnAndObjValue

getFnAndObjValue(<function|object>, <key>)

arrDelItem

arrDelItem(<array>, <diffItem>)

arrDelArrItem

arrDelArrItem(<array>, <diffArrayItem>)

toArray

toArray(<arrayLike>)

getArrayMin

getArrayMin(<array>)

extend

extend(<sourceObj>, [otherObj])

hasOwn

hasOwn(<target>)

isEqual

isEqual(<alice>, <bob>)

chunk

chunk(<array>, <number>)

CSS Utils List

text-ellipsis

.target {
  .text-ellipsis
}

text-loading

.target {
  .text-loading([time])
}

License

MIT

utils-lite's People

Contributors

xiguaxigua avatar

Watchers

James Cloos 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.