default-value
: Returns either the value that's passed in, or a 'default value' if there isn't one. Useful for dealing with options.
is-array
: Checks whether a value is an array.is-stream
: Checks whether a value is a stream of some sort.type-of-is
: Various utilities for checking and determining types.
in-array
: Checks whether an array contains a particular value.arr-flatten
: Turns nested arrays into a single 'flat' array.arr-union
: Combines a list of arrays, ensuring only unique valuesassure-array
: Wraps a value in an array if it isn't already one.array-unique
: Removes duplicate values from an array.
xtend
: Combines multiple objects into one, without modifying any of the originals.object.pick
: Returns a copy of an object, containing only the specified properties.object.omit
: Returns a copy of an object, containing everything except for the specified properties.
repeat-string
: Returns a given string, but repeated N times.
(Seriously though, you should probably be using Bluebird instead. It's more robust and has these things built in.)
es6-promise-try
: An implementation of Promise.try for ES6 Promises.es6-promisify
: Converts a Node.js-callback-style function into one that returns an ES6 Promise. Equivalent to Promise.promisify.es6-promisify-all
: Likees6-promisify
, but converts an entire module or prototype. Equivalent to Promise.promisifyAll.
promise-task-queue
: A configurable task queue that supports Promises, with support for rate limiting and concurrency control.promise-while-loop
: An asynchronous while-loop implementation with full support for Promises.
promise-simple-callback
: Promisifies a function that expects a callback with a single (result) argument, rather than the usual(err, result)
style callbacks.
You should use either of the following two. Note that while scrypt
is newer and thus less tested, bcrypt
has a limit of around 72 characters for the password. Do not use pure-JavaScript implementations! If you are having trouble installing these, refer to this page.
scrypt-for-humans
: Human-friendly API for usingscrypt
.bcrypt
: Bindings forbcrypt
.
Don't use Math.random
, or anything based on it! In most cases (API keys, reset tokens, lottery numbers, ...) you actually need cryptographically secure random values, and Math.random
can't provide these.
The only case in which you want to use Math.random
, is when you need a lot of random numbers very quickly and it doesn't matter whether they are predictable - for example, when spawning monsters in a game at random locations.
random-number-csprng
: A cryptographically secure generator for random numbers in a range.
jsonwebtoken-promisified
: Library for working with JSON Web Tokens (JWT), supporting Promises out of the box.
through2
: Easily create custom streams, including object streams.
dev-null
: Writable stream that throws away whatever you put into it, without looking at it. Useful for 'draining' a stream.through2-sink
: Stream that calls a callback for every write, and then throws away the data.through2-spy
: Stream that calls a callback for every write, and then passes through the original data.
stream-combiner2
: Represents a series of streams that pipe into each other, as a single stream. Useful for abstracting out pipelines.combined-stream2
: Provides a single Readable stream that automatically concatenates the contents of multiple other streams or Buffers, in order.concat-stream
: Buffers up a stream, and calls a callback with the concatenated result when the stream has finished.
stream-length
: Attempts to obtain the total length of a stream, without reading out its contents.
- aac: Pure-JS AAC decoder for browsers.
- alac: Pure-JS ALAC decoder for browsers.
- broadway-player: Pure-JS H.264 decoder for browsers. This is an unofficial build of Broadway.js, and may be moved in the future.
- flac.js: Pure-JS FLAC decoder for browsers.
- hls.js: HLS polyfill for browsers that do not natively support it.
- mp3: Pure-JS MP3 decoder for browsers.
- opus.js: An Emscripten-compiled Opus decoder that works in the browser.