• Stars
    star
    1,559
  • Rank 29,886 (Top 0.6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A modern JS utility library

101

NPM

Build Status Coverage Status Dependency Status devDependency Status

Why another JS util library?

1) 101 will be maintained to minimize overlap with vanilla JS.

  • 101 utils are made to work well with vanilla JS methods.
  • 101 will only duplicate vanilla JS to provide Functional Programming paradigms, or if the method is not available in a widely supported JS version (currently ES5).
  • Other libraries often duplicate a lot of ES5: forEach, map, reduce, filter, sort, and more.

2) No need for custom builds.

  • With 101, import naturally, and what you use will be bundled.
  • Each util method is a module that can be required require('101/<util>').
  • Currently CommonJS (node, browserify, webpack, etc) is supported, I will add other module system support on request.
  • Other libraries can be large, and require manually creating custom builds when optimizing for size.

Why not release each as individual modules?

I usually agree with this philosophy; however, while in practice, adherence to the module-pattern can become quite annoying for micro-modules (like those in 101):

  • Micro-modules existance throughout a project can change very frequently, because of this one may find themselves constantly updating their package.json (repeatedly adding and removing the same micro-modules).
  • Unbundling micro-modules can lead to projects with hundreds of dependencies which can be tedious to maintain.

Installation

npm install 101

Usage

assign (aka extend)

Just like ES6's Object.assign. Extend an object with any number of objects (returns original).

var assign = require('101/assign');

var target = { foo: 1 };
var source1 = { bar: 1 };
var source2 = { baz: 1 };
assign(target, source1) // { foo: 1, bar: 1, baz: 1 } target extended with source objects
assign(target, source1, source2) // { foo: 1, bar: 1, baz: 1 } target extended with source objects

and

Functional version of &&. Works great with array.reduce.

var and = require('101/and');

and(true, false); // false
and(true, true);  // true
and(true, "foo");  // "foo"

apply

Functional version of function.apply. Supports partial functionality (great with array functions).

var apply = require('101/apply');
[sum].map(apply(null, [1, 2, 3])); // [6] = [sum(1,2,3)] = [1+2+3]
function sum () {  /* sums all arguments */ }
apply({ prop: 'val' })(function () { return this.prop; });  // 'val'

bindAll

Bind methods in an object. You can pass an array containing the name of the methods to bind as second argument or leave it empty to bind all the available methods.

var bindAll = require('101/bind-all');
var obj = {
  init: function() {
    this.on(this.handler);
  },
  on: function(handler) {
    return handler();
  },
  handler: function() {
    console.log(this.msg);
  },
  msg: 'Hello World'
}

obj.init(); // undefined

bindAll(obj);
obj.init(); // "Hello World"

bindAll(obj, ['handler']);
obj.init(); // "Hello World"

clone

It's clone (Only exporting this bc it is used internal to 101)

var clone = require('101/clone');
var obj = {
  foo: 1,
  bar: 2
};

clone(obj); // { foo: 1, bar: 2 }

compose

Functional composition method. Works great with array.reduce.

var compose = require('101/compose');

compose(isNaN, parseInt)('nope'); // isNaN(parseInt('nope')) // true

converge

Converges an array of functions into one. Works great with compose.

var converge = require('101/converge');

converge(mul, [add, sub])(6, 2); // mul(add(6, 2), sub(6, 2)) // (6+2) * (6-2) = 36

[ {a: true, b: false}
, {a: false, b: false}
, {a: true, b: true}
].filter(converge(and , [pluck("a") , pluck("b")])); // [{a: true, b: true}]

[f, converge(g, [h, i]), j].reduce(compose); // f(g(h(j), i(j)))

curry

Returns a curried function.

var curry = require('101/curry');

function add(a, b) { return a + b; }

var curriedAdd = curry(add);
var add2 = curriedAdd(2);

add2(6); // 8
add2(8); // 10

function join() { return Array.prototype.slice.call(arguments).join(''); }

curry(join, 3)(1)(0)(1); // "101"

defaults

Fill non-existing object values with defaults. Use it to set defaults on options. Works with supplying default values in sub-objects as well. Supports partial functionality (great with array functions). Mutates first argument and returns mutated argument.

var defaults = require('101/defaults');
var opts = { foo: 0, bar: 1 };
var defs = { foo: 1, bar: 2, qux: 2 };

defaults(opts, defs); // returns mutated `opts` { foo: 0, bar: 1, qux: 2 }
[opts].map(defaults(defs)); // [ { foo: 0, bar: 1, qux: 2 } ]

var opts = {
  foo: {
    one: 1,
    two: 2
  }
};
var defs = {
  foo: {
    two: 20,
    three: 30
  }
};
defaults(opts, defs); // { foo: { one: 1, two: 2, three: 30 } }

del

Functional version of delete obj[key] which returns the same obj without the deleted key. Supports partial functionality (great with array functions, like map).

var del = require('101/del');
var obj = {
  foo: 1,
  bar: 2
};

del(obj, 'foo'); // { bar: 2 }

// use it with array.map
[obj, obj, obj].map(del('foo')); // [{ bar: 2 }, {same}, {same}]

// supports keypaths by default
var obj = {
  foo: {
    moo: 1,
    boo: 2
  },
  bar: 3
};

del(obj, 'foo.moo'); // { foo: { boo: 2 }, bar:3 }

// pass an array of keys to be deleted 
del(obj, ['foo.moo', 'bar']) // { foo: { boo: 2 } }

envIs

Functional version of str === process.env.NODE_ENV. Or's multiple environments.

var envIs = require('101/env-is');
// process.env.NODE_ENV = development
envIs('development');     // true
envIs('production');      // false
envIs('staging', 'production');     // false
envIs('development', 'production'); // true

equals

Functional implementation of Object.is with polyfill for browsers without implementations of Object.is Supports partial functionality (great with array functions).

var equals = require('101/equals');

equals(1, 1);            // true
[1,2,3].some(equals(1)); // true
equals(1, '1');          // false

exists

Simple exists function.

var exists = require('101/exists');

exists('foo');     // true
exists(null);      // false
exists(undefined); // false

find

Just like ES6's array.find.

Finds the first value in the list that passes the given function (predicate) and returns it. If list is not provided find will return a partial-function which accepts a list as the first argument.

var find = require('101/find');
var hasProps = require('101/has-properties');
var arr = [{ a: 1, b: 1 }, { b: 1 }, { c: 1 }];

var item = find(arr, hasProps({ a:1 }));
// returns { a: 1, b: 1 }
// returns null if not found

// partial-function
var partial = find(hasProps({ a: 1 }));
var item = partial(arr);
// returns { a: 1, b: 1 }
// returns null if not found

findIndex

Just like ES6's array.findIndex.

Finds the first value in the list that passes the given function (predicate) and returns it's index. If list is not provided findIndex will return a partial-function which accepts a list as the first argument.

var findIndex = require('101/find-index');
var arr = [1, 2, 3];

var index = findIndex(arr, function (val, i, arr) {
  return val === 2;
});
// returns 1
// returns -1 if not found

flip

Returns a function with flipped arguments

var flip = require('101/flip');
var curry = require('101/curry');
var hasKeypaths = require('101/has-keypaths');

var hasFooBar = curry(flip(hasKeypaths))(['foo.bar']);

hasFooBar({ foo: { bar : true } }); // true


function prefix(pre, str) {
  return pre + str;
}

flip(prefix)('hello', '_'); // "_hello"

groupBy

Hashes an array into groups based on the value of a provided common key. Works nicely with pluck and reduce.

var groupBy = require('101/group-by');
var arr = [
    {id: 1, foo: 'bar'},
    {id: 2, foo: 'qux'},
    {id: 3, foo: 'qux'}
];

groupBy(arr, 'foo')
/*
{
  bar: [
    {id: 1, foo: 'bar'}
  ],
  qux: [
    {id: 2, foo: 'qux'},
    {id: 3, foo: 'qux'}
  ]
}
*/
// always provide initial value when using with reduce!
arr.reduce(groupBy('foo'), {}) // assumes pluck if passed string
arr.reduce(groupBy(pluck('foo')), {}) // also accepts function
/*
{
  bar: [
    {id: 1, foo: 'bar'}
  ],
  qux: [
    {id: 2, foo: 'qux'},
    {id: 3, foo: 'qux'}
  ]
}
*/

hasKeypaths

Determines whether the keypaths exist and have the specified values. Supports partial functionality (great with array functions, and 101/find).

var hasKeypaths = require('101/has-keypaths');
var obj = {
  foo: {
    bar: {
      qux: 1
    }
  }
};

hasKeypaths(obj, ['foo.bar.qux']);      // true
hasKeypaths(obj, { 'foo.bar.qux': 1 }); // true
hasKeypaths(obj, ['foo.qux']);          // false
hasKeypaths(obj, { 'foo.bar': 2 });     // false
hasKeypaths(obj, { 'foo.bar': 1, 'nope': 1 }); // false

// optional 'deep' arg, defaults to true
var barObj = { bar: 1 };
hasKeypaths(obj, { 'foo.bar': barObj });         // true
hasKeypaths(obj, { 'foo.bar': barObj }, true);   // true
hasKeypaths(obj, { 'foo.bar': barObj }, false);  // false
hasKeypaths(obj, { 'foo.bar': obj.foo }, false); // true
hasKeypaths(obj, ['foo.bar'], false);            // true, uses [hasOwnProperty vs in](http://stackoverflow.com/questions/13632999/if-key-in-object-or-ifobject-hasownpropertykey)

// use it with find, findIndex, or filter!
var arr = [obj, { b: 1 }, { c: 1 }];
find(arr, hasKeypaths({ 'foo.bar.qux':1 })); // { foo: { bar: { qux: 1 } } }
find(arr, hasKeypaths(['foo.bar.qux']));     // { foo: { bar: { qux: 1 } } }

// use it to verify options object has required properties
var opts = {
  host: 'localhost',
  port: '3333',
  user: {
    id: 5
  }
};
hasKeypaths(opts, ['host', 'port', 'user.id']); // true

hasProperties

Determines whether the keys exist and, if specified, has the values. Supports partial functionality (great with array functions, and 101/find). NOTE: I am considering deprecating this method, bc it is so similar to has-keypaths.

var hasProps = require('101/has-properties');
var obj = {
  qux: 1
};
obj['foo.bar'] = 1

hasProps(obj, ['foo', 'qux']); // true
hasProps(obj, { qux: 1 }) // true

// optional 'deep' arg, defaults to true
var barObj = { bar: 1 };
hasProps(obj, { 'foo.bar': barObj });         // true
hasProps(obj, { 'foo.bar': barObj }, true);   // true
hasProps(obj, { 'foo.bar': barObj }, false);  // false
hasProps(obj, ['foo.bar'], false);            // true, uses [hasOwnProperty vs in](http://stackoverflow.com/questions/13632999/if-key-in-object-or-ifobject-hasownpropertykey)
// use it with find, findIndex, or filter!
var arr = [{ a: 1, b: 1 }, { b: 1 }, { c: 1 }];
find(arr, hasProps({ a:1 })); // { a: 1, b: 1 }
find(arr, hasProps(['a']));   // { a: 1, b: 1 }

includes

Polyfill of ES7 proposed Array.prototype.includes. Will default to Array.prototype.includes if present.

var includes = require('101/includes');
var haystack = ['a', 'b', 'c', 'd', 'e'];
includes(haystack, 'c'); // true

// optional 3rd argument, searchFrom. Begin searching the target array from a specified index.
includes(haystack, 'c', 3); // false
includes(haystack, 'c', 0); // true

// partial argument functionality
var i = includes(haystack);
i('c') // true
i('g') // false

// example composition usage:
var not = require('101/not');
var notIn = not(includes);
[1, 2, 3, 4, 5].filter(notIn([1, 2, 3])); // [4, 5]

indexBy

Hashes an array of objects based on the value of a provided common key. Works nicely with pluck and reduce.

var arr = [
  {foo: 'bar'},
  {foo: 'qux'}
];

arr.reduce(indexBy('foo'), {}) // assumes pluck if passed string
arr.reduce(indexBy(pluck('foo')), {}) // also accepts function
// {bar: {foo: 'bar'}, qux: {foo: 'qux'}}
// always provide initial value when using with reduce!
arr.reduce(indexBy(pluck('foo')), {}) // {bar: {foo: 'bar'}, qux: {foo: 'qux'}}

instanceOf

Functional version of JavaScript's instanceof. Supports partial functionality (great with array functions).

var instanceOf = require('101/instance-of');

['foo', 'bar', 1].map(instanceOf('string')); // [true, true, false]

isBoolean

Functional version of typeof val === 'boolean'. Supports partial functionality (great with array functions).

var isBoolean = require('101/is-boolean');

[true, false, 1].map(isBoolean); // [true, true, false]

isEmpty

Functional version of val empty object, array or object

var isEmpty = require('101/is-empty');

isEmpty([]); // true
isEmpty({}); // true
isEmpty(""); // true
isEmpty(" "); // false

isFunction

Functional version of typeof val === 'function'

var isFunction = require('101/is-function');

[parseInt, function () {}, 'foo'].map(isFunction); // [true, true, false]

isInteger

Check if a value is an instance of an integer.

var isInteger = require('101/is-Integer');

isInteger(101); // true
isInteger(101.01); // false

isNumber

Functional version of val typeof 'number'.

var isNumber = require('101/is-number');

['foo', NaN, 1].map(isNumber); // [false, false, true]

isObject

Functional strict version of val typeof 'object' (and not array or regexp)

var isObject = require('101/is-object');

[{}, { foo: 1 }, 100].map(isObject); // [true, true, false]

isRegExp

Check if a value is an instance of RegExp

var isRegExp = require('101/is-regexp');

[new RegExp('.*'), /.*/, {}, 1].map(isRegExp); // [true, true, false, false]

isString

Functional version of val typeof 'string'

var isString = require('101/is-string');

['foo', 'bar', 1].map(isString); // [true, true, false]

keysIn

Return an array containing all the keys of an object. It differs from the native Object.keys by including also the prototype keys.

var keysIn = require('101/keys-in');
var User = function() {
  this.msg = 'Hello World';
}
User.prototype.isLoggedIn = function() { /* example function */ }

var user = new User();
keysIn(user); // ['msg', 'isLoggedIn']

last

Returns the last value of a list

var last = require('101/last');

last([1, 2, 3]); // 3
last('hello');   // 'o'

lens

Create a lens to access a data structure. When passed a property key as a string, it returns a function fn(obj) that acts as a getter for that. It also exposes .set(value, obj) and .mod(fn, obj).

var fooLens = lens('foo');
var toUpper = function(str) { return str.toUpperCase(); };
var obj = {
  foo: 'foo',
  bar: 'bar'
};

fooLens(obj); // => 'foo'
fooLens.set('moo', obj); // => { foo: 'moo', bar: 'bar' }
fooLens.mod(toUpper, obj); // => { foo: 'MOO', bar: 'bar' }

You may also provide getter and setter functions.

var arr = ['foo', 'bar'];
var first = lens(
    function(arr) { return arr[0]; },
    function(val, arr) { var clone = arr.slice(); clone[0] = val; return clone; }
);

first(arr); // => 'foo'
first.set('moo')(arr); // => ['moo', 'bar']
first.mod(toUpper)(arr); // => ['FOO', 'bar']

noop

No-op function

require('101/noop'); // function () {}

not

Functional version of !.

var not = require('101/not');

not(isString)('hey'); // false
not(isString)(100);   // true

omit

Immutable version of delete obj.key. Returns a new object without the specified keys. Supports partial functionality (great with array functions, like map).

var omit = require('101/omit');
var obj = {
  foo: 1,
  bar: 2
};

omit(obj, 'foo');          // { bar: 1 }
omit(obj, ['foo']);        // { bar: 1 }
omit(obj, ['foo', 'bar']); // { }

// use it with array.map
[obj, obj, obj].map(omit('foo')); // [{ bar: 1 }, { bar: 1 }, { bar: 1 }];

or

Functional version of ||. Works great with array.reduce.

var or = require('101/or');

or(true, true);   // true
or(true, false);  // true
or(false, false); // false
or("foo", false); // "foo"

passAll

Muxes arguments across many functions and &&'s the results. Supports partial functionality (great with array functions, like map).

var passAll = require('101/pass-all');

['', 'foo', 'bar', 100].map(passAll(isString, isTruthy)); // [false, true, true, false]

passAny

Muxes arguments across many functions and ||'s the results. Supports partial functionality (great with array functions, like map).

var passAny = require('101/pass-any');

['', 'foo', 'bar', 100].map(passAny(isString, isNumber)); // [true, true, true, true]

pick

Returns a new object with the specified keys (with key values from obj). Supports regular expressions and partial functionality (great with array functions, like map).

var pick = require('101/pick');
var obj = {
  foo: 1,
  bar: 2,
  qwk: {
    wrk: 1
  },
  'qwk.wrk': 2
};

pick(obj, 'foo');          // { foo: 1 }
pick(obj, RegExp('oo$'));  // { foo: 1 }
pick(obj, ['foo']);        // { foo: 1 }
pick(obj, ['foo', 'bar']); // { foo: 1, bar: 2 }

// use it with array.map
[obj, obj, obj].map(pick('foo')); // [{ foo: 1 }, { foo: 1 }, { foo: 1 }];

// supports keypaths
pick(obj, 'qwk.wrk');      // { qwk: { wrk: 1 } }
pick(obj, '["qwk.wrk"]');  // { 'qwk.wrk': 2 } }

pluck

Functional version of obj[key], returns the value of the key from obj. Supports partial functionality (great with array functions, like map).

var pluck = require('101/pluck');
var obj = {
  foo: 1,
  bar: 2
};

pluck(obj, 'foo'); // 1

// use it with array.map
[obj, obj, obj].map(pluck('foo')); // [1, 1, 1]

// supports keypaths by default
var obj = {
  foo: {
    bar: 1
  },
  'foo.bar': 2
};

pluck(obj, 'foo.bar'); // 1, supports keypaths by default
pluck(obj, 'foo.bar', false); // 2, pass false to not use keypaths

put

Immutable version of obj[key] = val. Returns a clone of the obj with the value put at the key. Supports partial functionality (great with array functions, like map).

var put = require('101/put');
var obj = {
  foo: 1,
  bar: 2
};

put(obj, 'baz', 3); // { foo: 1, bar:2, baz: 3 }
obj; // { foo: 1, bar: 2 } (not modified)

// use it with array.map
[obj, obj, obj].map(put('foo', 100)); // [{ foo: 100, bar: 2 }, {copy}, {copy}]
obj; // { foo: 1, bar: 2 } (not modified)

// supports keypaths by default
var obj = {
  bar: 2
};

put(obj, 'foo.qux', 100); // { foo: { qux: 100 }, bar: 2 }
put(obj, {
  'foo.qux': 100
  'yolo': 1
}); // { foo: { qux: 100 }, bar: 2, yolo: 1 }
obj; // { foo: 1, bar: 2 } (not modified)

set

Functional version of obj[key] = val, returns the same obj with the key and value set. Supports partial functionality (great with array functions, like map).

var set = require('101/set');
var obj = {
  foo: 1,
  bar: 2
};

set(obj, 'foo'); // 1

// use it with array.map
[obj, obj, obj].map(set('foo', 100)); // [{ foo: 100, bar: 2 }, {same}, {same}]

// supports keypaths by default
var obj = {
  bar: 2
};

set(obj, 'foo.qux', 100); // { foo: { qux: 100 }, bar: 2 }
set(obj, {
  'foo.qux': 100
  'yolo': 1
}); // { foo: { qux: 100 }, bar: 2, yolo: 1 }

values

Returns Array containing the values of the properties of an object

var values = require('101/values');
var obj {
  foo: 'apple',
  bar: 'orange'
};

var objValues = values(obj);
objValues // ['apple', 'orange']

xor

Exclusive or Works great with array.reduce.

var xor = require('101/xor');

xor(true, true);   // false
xor(true, false);  // true
xor(false, true);  // true
xor(false, false); // false

License

MIT

More Repositories

1

coworkers

A RabbitMQ Microservice Framework in Node.js
JavaScript
611
star
2

primus-graphql

A flexible GraphQL client and server library that can be used to power realtime applications.
JavaScript
165
star
3

graphql-date

GraphQL Date Type
JavaScript
67
star
4

keypather

Get, set, or delete deep object values using keypath strings (supports immutable operations) and more.
JavaScript
60
star
5

atom-term

shell tab for atom
JavaScript
58
star
6

is-positive-integer

check if a number is a positive integer
JavaScript
53
star
7

rabbitmq-schema

A schema definition module for RabbitMQ graph and messages
JavaScript
37
star
8

object-loops

Functional methods like forEach, map, filter, and other Array methods for Objects in javascript
JavaScript
33
star
9

amqplib-rpc

Thin Amplib utils for RabbitMQ RPC in Node.js
JavaScript
31
star
10

middleware-flow

middleware flow control
JavaScript
30
star
11

graphql-parse-fields

Parse fields from GraphQLResolveInfo into a JSON tree
JavaScript
27
star
12

graphql-fetch

Thin GraphQL client powered by fetch.
JavaScript
25
star
13

fbExec.js

Facebook JavaScript SDK Helper - makes it easier to make FB JS API calls without having to worry about the state (init or loginStatus), and allows you the freedom to place FB dependent code wherever you'd like (vs being restricted to fbAsyncInit); especially useful with client-side routing systems such as backbone.js, ember.js, and sammy.js. Check out the examples below.
JavaScript
21
star
14

is-circular

determines if an object (or array) is circular
JavaScript
14
star
15

error-to-json

Returns a JSON representation of an error (handles nested errors and nested toJSONs)
TypeScript
13
star
16

homebridge-eightsleep-platform

Homebridge Plugin for supporting the Eightsleep Pod
TypeScript
13
star
17

rethinkdb-observable

Convert a rethinkdb cursor into an observable
JavaScript
11
star
18

git-fb

Git feature-branch workflow helper commands
JavaScript
11
star
19

street-types

US street types/suffixes and abbreviations
JavaScript
7
star
20

assert-args

Validate and format function arguments ( handles types and optionals)
JavaScript
7
star
21

observable-backoff

RxJS observable exponential back-off operator
JavaScript
7
star
22

dat-middleware

dat middleware tho - common request, response, body, query, and param middleware
JavaScript
7
star
23

hex64

Base64 encode and decode UTF-8 strings for URLs (module and binary tool)
JavaScript
6
star
24

git-wip

A quick way to save progress (stash) and resume work (pop) for git feature branches.
JavaScript
6
star
25

gcloud-monitor

A node.js module for custom monitoring using Google Cloud Monitoring v3 API
JavaScript
6
star
26

fall-browser-extension

Close tabs automatically overtime. Closed tabs may be recovered from a searchable dropdown list.
JavaScript
6
star
27

node-eightsleep

Eightsleep API Client for Node.js
TypeScript
6
star
28

generator-rendr

Yo (Yeoman) generator for render views, models, collections, and controllers
JavaScript
5
star
29

redis-types

redis type objects - hashes, lists, sets, etc
JavaScript
5
star
30

callback-count

Count callbacks before continuing, tiny control flow helper, allows dynamic counting. Works great with promises.
JavaScript
5
star
31

gcloud-tracer

Custom Google Cloud StackDriver tracing client
JavaScript
5
star
32

function-proxy

Proxy functions with functions to modify arguments or spy
JavaScript
5
star
33

graphql-function

GraphQL Function Type
JavaScript
4
star
34

lex62

Fast, lexicographic base62 encode and decode
JavaScript
4
star
35

rethinkdb-stream

Turn a RethinkDB cursor into a readable stream
JavaScript
4
star
36

topcryptos

visualize crypto rankings and market caps over time
TypeScript
4
star
37

exists

node exists function. plain and simple.
JavaScript
4
star
38

rethinkdb-primus

Use rethinkdb over a primus connection
JavaScript
4
star
39

ignore-errors

Easily ignore specific promise errors
TypeScript
4
star
40

substream-pump

because primus substreams don't have pipes :(
JavaScript
4
star
41

express-request

Make a request to express from express without http
JavaScript
3
star
42

rx-to-iterall

Convert rxjs observables into iterall async iterators
JavaScript
3
star
43

apple-tv-now-playing-server

Python
3
star
44

map-utils

Functional methods the work well with Array.map
JavaScript
3
star
45

simple-api-client

create a quick simple extendable api client
TypeScript
3
star
46

node-alchemy-rest-client

Alchemy API (alchemyapi.com) for Node.js
JavaScript
3
star
47

native-types

list of all javascript native types and some utils
JavaScript
3
star
48

times-loop

run a function n times, both sync and async functions are supported
TypeScript
3
star
49

validate-reql

allows validation of rethinkdb reql queries using a whitelist of reql validators. this was specifically designed to work w/ rethinkdb-primus.
JavaScript
3
star
50

coworkers-test

Helper to easily test coworkers message handling middlewares
JavaScript
3
star
51

fn-object

functional programming helpers to be used with object's keys and values
JavaScript
3
star
52

normalize-slashes

Remove or add beginning and/or end slashes
JavaScript
3
star
53

node-module-template

typescript node module template
JavaScript
3
star
54

static-observable

Static observable methods `next`, `error`, and `complete`. Equivalent to `Promise.resolve()`/`Promise.reject()` for promises.
JavaScript
2
star
55

composite-abort-controller

an extended abort-controller class that simplifies listening to with multiple abort-signals
TypeScript
2
star
56

rethinkdb-generator

Convert a rethinkdb cursor into an async iterator
TypeScript
2
star
57

baseerr

TypeScript
2
star
58

fast-abort-controller

fast abort controller implementation not perfect to spec but performant
TypeScript
2
star
59

public-promise

Promise that exposes resolve and reject publicly
JavaScript
2
star
60

spark-to-json

Returns a JSON representation of a Primus spark
TypeScript
2
star
61

mw-cls

Advanced CLS (continuation local storage) middleware (for express, restify, ...)
JavaScript
2
star
62

level-rpc-stream

Control a level db over a duplex stream
TypeScript
2
star
63

multifilter

Split an array (or object) into multiple using filters
JavaScript
2
star
64

megadownload

helper to download all files on your mega account
JavaScript
2
star
65

middlewarize

Make modules/classes work like middleware (for express and restify)
JavaScript
2
star
66

direct-instance-of

verify an instance is a direct instance of a class ( not inherited from)
JavaScript
2
star
67

copy-function

copy a function by wrapping it w/ a closure
JavaScript
2
star
68

mongooseware

Magic mongoose middleware for express
JavaScript
2
star
69

ast-to-reql

Create ReQL from RethinkDB AST
JavaScript
2
star
70

request-to-json

Returns a JSON representation of request
TypeScript
2
star
71

response-to-json

Returns a JSON representation of response
JavaScript
2
star
72

bind-right

JavaScript bind arguments from the right.
JavaScript
2
star
73

muxdemux

multiplex and demultiplex (mux / demux) streams into an single stream (object mode or not)
JavaScript
2
star
74

parse-date

Basic date parse util, throws error or returns null if date is invalid
JavaScript
2
star
75

rethinkdb-validator-stream

Validate rethinkdb queries streaming to the socket
JavaScript
2
star
76

listen-all

Listen to all of an EventEmitter's events
JavaScript
2
star
77

auto-debug

Uses debug but automatically assumes file as log namespace. Optionally logs line numbers, function arguments, and even traces.
JavaScript
2
star
78

abortable-generator

abortable generator function typescript definitions and utils
TypeScript
2
star
79

promise-pull-queue

A promise queue class for handling push and pull based async tasks
TypeScript
2
star
80

generate-graphql

Generate JSON and GraphQL files from a JavaScript GraphQLSchema
JavaScript
2
star
81

proxy-pumpify

pipeline streams (combine) and also proxy non-stream methods. useful for advanced stream transforms like req and res.
JavaScript
2
star
82

google-places-search-example

google places search example in javascript
JavaScript
1
star
83

graphql-ioredis-subscriptions

A graphql subscriptions PubSubEngine using IORedis that works with Apollo Server in TypeScript
TypeScript
1
star
84

HelloWorld

hi
JavaScript
1
star
85

race-abort

utility to race a promise with an abort signal
TypeScript
1
star
86

cast-buffer

cast types to buffer
JavaScript
1
star
87

docker-frame

create a docker stream frame (header and payload)
JavaScript
1
star
88

abstract-http-server

An Abstract Http Server Class
TypeScript
1
star
89

clone-class

clone a class by cloning entire prototype chain (except native types like Object)
1
star
90

dockerfile-node-compass

Dockerfile for Node.js and Compass (and Ruby)
Shell
1
star
91

time-oset

Time Ordered Set in TypeScript (implements Set methods)
TypeScript
1
star
92

lametric-rain-alert

lametric-rain-alert app
JavaScript
1
star
93

buffer-splice

Splice a buffer.. like array and string splice
JavaScript
1
star
94

is-capitalized

Checks if an input string is a capitalized or not.
JavaScript
1
star
95

CrockettBot

CrockettDoodles bot that sends a text message when new puppies are available
JavaScript
1
star
96

coworkers-errors

Errors useful for "coworkers" applications
JavaScript
1
star
97

assert-err

assertion library that throws user-specified error types (accepts error class and message)
JavaScript
1
star
98

abortable-interval

abortable interval via abort signals
TypeScript
1
star
99

emitter-domain

Better event emitter domain error handling
JavaScript
1
star
100

homebridge-vector

Homebridge Anki Vector Plugin
TypeScript
1
star