lei-utils
utils
Last updated 3 years ago by leizongmin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install lei-utils 
SYNC missed versions from official npm registry.

node-lei-utils

支持 TypeScript

安装

$ npm install lei-utils --save

一些常用的工具函数

  • bugfree (doNotOutput)
  • format (f)
  • sha1 (text)
  • md5 (text)
  • fileSha1 (filename, callback)
  • fileMd5 (filename, callback)
  • hash (method, text)
  • encryptPassword (password)
  • validatePassword (password, encrypted)
  • encryptData (data, secret)
  • decryptData (str, secret)
  • randomString (size, chars)
  • randomNumber (size)
  • randomLetter (size)
  • date (format, timestamp)
  • noop (err)
  • isString (str)
  • isInteger (str)
  • isNumber (str)
  • cloneObject (obj)
  • merge ()
  • jsonStringify (data, space)
  • argumentsToArray (args)
  • getArrayLastItem (arr)
  • throttleAsync (fn, maxCount)
  • inheritsEventEmitter (fn)
  • inherits (fn, superConstructor)
  • extend (obj)
  • extends (obj)
  • array
    • last (arr)
    • head (arr)
    • first (arr)
    • rest (arr)
    • copy (arr)
    • concat ()
  • customError (name, info)
  • isPromise (p)
  • promise
    • call (fn)
    • all (_args)
  • ipToInt (ip)
  • toBuffer (data)
  • encrypt (algorithm, key, data)
  • encryptStream (algorithm, key, inStream)
  • decrypt (algorithm, key, data)
  • decryptStream (algorithm, key, inStream)
  • hashTransform (method, callback)
  • createPromiseCallback ()

License

The MIT License (MIT)

Copyright (c) 2014-2015 老雷

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Current Tags

  • 3.1.1                                ...           latest (3 years ago)

22 Versions

  • 3.1.1                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.5                                ...           4 years ago
  • 2.0.4                                ...           4 years ago
  • 2.0.3                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           5 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago

Copyright 2014 - 2016 © taobao.org |