JavaScript > Micro npm Packages
Contents
Modules
Array
Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
Return true if any of passed values exists in array - faster than using indexOf.
String
Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow.
Javascript library to enhance String.substring / Array.slice with python slice style.
Date & Time
Convert milliseconds to a human readable string: 1337000000 → 15d 11h 23m 20s.
A wrapper around the built-in high resolution timer which simplifies the calculation of timestamps.
Object
Turn an object into list of [key, value] pairs for mapping, iterating or other purposes.
Returns a map with the keys mapped to the corresponding vals. zipmap also accepts a single value of objects or pairs.
Create nested values and any intermediaries dot notation ('a.b.c') paths.
Returns true if a value exists, false if empty. Works with deeply nested values using dot notation ('a.b.c') paths.
Deep-search objects for keys. Keys can be searched by providing an array of keys, or using a dot-notiation.
Flatten object key hierarchies into a list of strings using a custom separator.
Converts an object literal with deeply nested nodes to a simple key/value object.
Stringify an object/array like JSON.stringify just without all the double-quotes.
Returns an array of keys from first object that are missing in second.
Function
Math
A good way to tell if a number is even or not (avoids type issues). Uses is-odd and is-number under the hood.
A good way to tell if a number is odd or not (avoids type issues). Uses is-number under the hood.
Stream
Tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise.
A through2 to create an Array.prototype.filter analog for streams.
A readable stream generator, useful for testing or converting simple functions into Readable streams.