npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more »

min-util

3.6.1 • Public • Published

min-util

Build status NPM version Downloads Dependency Status

A minimalist JavaScript Util library with a largely Lodash-compatible API.

Installation

npm i min-util

Usage

var _ = require('min-util')

Inspired by lodash and underscore

Very Small Size

min-util (~4kb gzipped)

Lodash is ~24kb gzipped

Try in Browser

Try in console, exports as _

Check Unit Tests

Api

Array like

  • _.each -> forEach
  • _.map
  • _.filter
  • _.some
  • _.every
  • _.reduce
  • _.reject
  • _.invoke
  • _.findIndex
  • _.find
  • _.slice
  • _.indexOf
  • _.includes
  • _.uniq
  • _.uniqBy
  • _.flatten
  • _.union
  • _.sample
  • _.sampleSize
  • _.shuffle
  • _.difference
  • _.without
  • _.rest
  • _.compact
  • _.size
  • _.first
  • _.last
  • _.groupBy
  • _.partition
  • _.range
  • _.pullAt
  • _.remove
  • _.fill
  • _.nth

Object

  • _.keys
  • _.forIn
  • _.extend
  • _.defaults
  • _.values
  • _.pick
  • _.functions
  • _.only
  • _.mapKeys
  • _.mapObject
  • _.create
  • _.has
  • _.get
  • _.set
  • _.isMatch
  • _.toPlainObject
  • _.size
  • _.invert

Function

  • _.bind
  • _.once
  • _.memoize
  • _.throttle
  • _.debounce
  • _.delay
  • _.after
  • _.before
  • _.curry
  • _.wrap
  • _.negate

String

  • _.trim
  • _.split
  • _.indexOf
  • _.slice
  • _.toLower
  • _.toUpper
  • _.toString
  • _.camelCase
  • _.capitalize
  • _.upperFirst
  • _.lowerFirst
  • _.includes
  • _.size
  • _.startsWith
  • _.endsWith
  • _.repeat
  • _.padLeft
  • _.padRight
  • _.template not support templateSettings

Utility

  • _.noop
  • _.now
  • _.chain
  • _.value
  • _.constant
  • _.identity
  • _.mixin
  • _.inherits
  • _.random
  • _.uniqueId

Lang

  • _.isString
  • _.isArray
  • _.isArrayLike
  • _.isBoolean
  • _.isElement
  • _.isEmpty
  • _.isFunction
  • _.isInteger
  • _.isNaN
  • _.isNumber
  • _.isObject
  • _.isPlainObject
  • _.isRegExp
  • _.isUndefined

More Check

_.is equals min-is

assert(_.is.arraylike({0: 'foo', length: 1}))

Platform Support

  • all browsers even IE6+
  • node.js

License

License

Keywords

install

npm i min-util

Downloadsweekly downloads

1,353

version

3.6.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability