open-index/open-npm huggingface dataset:
npm package: @nathanfaucett/end_of_stream
Description: call function on end of stream for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.1

end_of_stream [![Build Status](https://travis-ci.org/nathanfaucett/end_of_stream.svg?branch=master)](https://travis-ci.org/nathanfaucett/end_of_stream)
=======

call function on end of stream for the browser and node.js
npm package: @nathanfaucett/event_emitter
Description: EventEmitter for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.5

# EventEmitter

EventEmitter for the browser and node.js

```javascript
var EventEmitter = require("@nathanfaucett/event_emitter");

var emitter = new EventEmitter();

emitter.on("test", function handler(a, b, c) {
	console.log(a, b, c);
	emitter.off("test", handler);
});

emitter.emit(1, 2, 3);
emitter.emitArgs([1, 2, 3]);
emitter.emitArg(1);
```
npm package: @nathanfaucett/event_listener
Description: event listener for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

event listener
=======

event listener for the browser and node.js

```javascript
var eventListener = require("@nathanfaucett/event_listener");


eventListener.on(window, "mousemove", function handler(e) {
    console.log(e);
    eventListener.off(window, "mousemove", handler);
});
```
npm package: @nathanfaucett/fast_hash
Description: FastHash for indexing values by one of their keys
Author: Nathan Faucett
Latest version: 0.0.3

FastHash
=======

FastHash for indexing values by one of their keys

```javascript
var FastHash = require("@nathanfaucett/fast_hash");

function Value(id) {
    this.id = id;
}

var hash = new FastHash("id");

hash.add(new Value("1"));
hash.add(new Value("2"));

hash.get("2") // Value {id: "2"}
```
npm package: @nathanfaucett/file_path
Description: file path utils for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.4

filePath
=======

file path utils for the browser and node.js

```javascript
var filePath = require("@nathanfaucett/file_path");


filePath.isAbsolute("../path") === false;
filePath.isAbsolute("path") === false;
filePath.isAbsolute("/path") === true;

filePath.normalize("//base//path///to") === "/base/path/to";

filePath.resolve("/base/path/to", "../", "./") === "/base/path";

filePath.relative("/base/path", "/base/path/home") === "home";

filePath.join("/base/path", "./home") === "/base/path/home";

filePath.dirname("/base/path/file") === "/base/path";

filePath.basename("/base/path/file") === "file";
filePath.basename("/base/path/file.js") === "file.js";

filePath.extname("/base/path/file.js") === ".js";
```
npm package: @nathanfaucett/file_type
Description: file type for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

fileType
=======

file type checks for the browser and node.js

```javascript
var fileType = require("@nathanfaucett/file_type");


fileType(someFileBuffer); // returns type, ie "json" "html" etc...
```
npm package: @nathanfaucett/file_utils
Description: file utils for node.js
Author: Nathan Faucett
Latest version: 0.0.7

fileUtils
=======

file utils for node.js

```javascript
var fileUtils = require("@nathanfaucett/file_utils");


fileUtils.readDir(__dirname + "/folder", function(error, stats) {
    var value = stats.map(function(stat) {
        return filePath.base(stat.path);
    });

    // value === ['a.js', 'b.js', 'c.js', 'd.js'];
});

var values = fileUtils.readDirSync(__dirname + "/folder").map(function(stat) {
    return filePath.base(stat.path);
});
//values = ['a.js', 'b.js', 'c.js', 'd.js'];

var count = 0;

function action(stat, next) {
    count += 1;
    next();
}
fileUtils.dive(__dirname + "/folder", action, function() {
    console.log(count); // 4
});


var count = 0;

function action(stat) {
    count += 1;
}

fileUtils.diveSync(__dirname + "/folder", action);
console.log(count); // 4
```
npm package: @nathanfaucett/foreign_key
Description: attaches foreign key to string
Author: Nathan Faucett
Latest version: 0.0.1

foreignKey
=======

attaches foreign key to string

```javascript
var foreignKey = require("@nathanfaucett/foreign_key");

                        // string, key, camelized, lowFirstLetter
var string = foreignKey("string", "id", false,      true);
// string === "string_id"

var string = foreignKey("string", "id", true,      true);
// string === "stringId"
```
npm package: @nathanfaucett/get_random_bytes
Description: getRandomBytes for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.3

getRandomBytes
=======

getRandomBytes for the browser and node.js

```javascript
var getRandomBytes = require("@nathanfaucett/get_random_bytes");


// returns Uint8Array with size 32 full of random bytes
var bytes = getRandomBytes(32);
```
npm package: @nathanfaucett/hex_encoding
Description: hex encoding/decoding for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.1

hex encoding
=======

hex encoding/decoding for the browser and node.js

```javascript
var hex = require("hex_encoding");


hexEncoding.stringToBytes(
    "7468697320697320612074657374"
) === [116, 104, 105, 115, 32, 105, 115, 32, 97, 32, 116, 101, 115, 116];

hexEncoding.bytesToString(
    [116, 104, 105, 115, 32, 105, 115, 32, 97, 32, 116, 101, 115, 116]
) === "7468697320697320612074657374";
```
npm package: @nathanfaucett/http_error
Description: HttpError for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

HttpError
=======

HttpError for the browser and node.js

```javascript
var HttpError = require("@nathanfaucett/http_error");


var error = new HttpError(404);

error instanceof Error === true;
error.name === "NotFoundError";
error.statusCode === 404;
error.message === "NotFoundError: 404 Not Found";
```
npm package: @nathanfaucett/i18n
Description: i18n for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.3

i18n
=======

i18n for the browser and node.js

```javascript
var i18n = require("@nathanfaucett/i18n");


i18n.add("en", {
    home: {
        header: {
            value: "Header",
            date: "Hello, it is %s"
        }
    }
});

i18n.add("en", {
    content: {
        btn_name: "BUTTON"
    }
})

console.log(i18n("en", "home.header.date", new Date()));
console.log(i18n("en", "home.header.date.missing")); // will throw an error
console.log(i18n("en", "home.missing")); // will throw an error
```
npm package: @nathanfaucett/immutable-hash_map
Description: immutable persistent hash_map for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.6

Immutable HashMap
=======

Immutable persistent hash map for the browser and node.js

# Install using npm
```bash
$ npm install @nathanfaucett/immutable-hash_map --save
```
# Install using yarn
```bash
$ yarn add @nathanfaucett/immutable-hash_map --save
```

# Example Usage
```javascript
var ImmutableHashMap = require("@nathanfaucett/immutable-hash_map");


var a = new ImmutableHashMap({0: 0, 1: 1}),
    b = new ImmutableHashMap(0, 0, 1, 1),
    c = ImmutableHashMap.of({0: 0, 1: 1}),
    d = ImmutableHashMap.of(0, 0, 1, 1);

var a0 = a.set(2, 2),
    a1 = a.remove(1);
```

# Docs

## Members

#### length -> Number
    returns size of HashMap, only available if Object.defineProperty is supported


## Static Functions

#### HashMap.isHashMap(value: Any) -> Boolean
    returns true if value is a hash map else false

#### HashMap.of(...values: Array<Any>) -> HashMap
    creates HashMap from passed values same as new HashMap(...values: Array<Any>)

#### HashMap.equal(a: HashMap, b: HashMap) -> Boolean
    compares hash maps by values


## Functions

#### size() -> Number
    returns size of HashMap

#### get(key: Any) -> Any
    returns value at key

#### has(key: Any) -> Boolean
    returns true if hash map contains key

#### set(key: Any, value: Any) -> HashMap
    returns new HashMap if value at key is not set or different

#### remove(key: Any) -> HashMap
    returns new HashMap without the value at key

#### iterator([reverse = false: Boolean]) -> Iterator
    returns Iterator

#### toArray() -> Array<[Any, Any]>
    returns HashMap elements in an Array

#### toObject() -> Object<String, Any>
    returns HashMap elements in an Object, keys should be primitives or some key value pairs will be lost

#### join([separator = " "]) -> String
    join all elements of an HashMap into a String

#### toString() -> String
    String representation of HashMap

#### equals(other: HashMap) -> Boolean
    compares this hash map to other hash map by values

#### every, filter, forEach, forEachRight, map, reduce, reduceRight, some
    some common methods
npm package: @nathanfaucett/immutable-list
Description: immutable persistent linked list for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.5

Immutable List
=======

Immutable persistent linked list for the browser and node.js, ImmutableList can not be changed once created. Persistent data presents a mutative API which does not update the data in-place, but instead always yields new updated data.

This implementation is based on clojure's List.


# Install using npm
```bash
$ npm install @nathanfaucett/immutable-list --save
```
# Install using yarn
```bash
$ yarn add @nathanfaucett/immutable-list --save
```

# Example Usage
```javascript
var ImmutableList = require("@nathanfaucett/immutable-list");


var a = new ImmutableList([0, 1, 2]),
    b = new ImmutableList(0, 1, 2),
    c = ImmutableList.of([0, 1, 2]),
    d = ImmutableList.of(0, 1, 2);

var a0 = a.push(3), // returns a new list with 3 at the end of the list
    a1 = a.unshift(-1); // returns a new list with -1 at the start of the list
```

# Docs

## Members

#### length -> Number
    returns size of List, only available if Object.defineProperty is supported


## Static Functions

#### List.isList(value: Any) -> Boolean
    returns true if value is a list else false

#### List.of(...values: Array<Any>) -> List
    creates List from passed values same as new List(...values: Array<Any>)

#### List.equal(a: List, b: List) -> Boolean
    compares lists by values


## Functions

#### size() -> Number
    returns size of List

#### get(index: UnsignedNumber) -> Any
    returns value at index

#### nth(index: UnsignedNumber) -> Any
    alias to get

#### first() -> Any
    returns first element

#### last() -> Any
    returns last element

#### indexOf(value: Any) -> Number
    returns index of value, -1 if not found

#### set(index: UnsignedNumber, value: Any) -> List
    returns new List if value at index is different

#### insert(index: UnsignedNumber, ...values: Array<Any>) -> List
    returns new List with inserted values at index

#### remove(index: UnsignedNumber[, count = 1: UnsignedNumber]) -> List
    returns new List without the values from index to index + count

#### conj(...values: Array<Any>) -> List
    returns new List with values pushed to front of the List

#### unshift(...values: Array<Any>) -> List
    alias to conj

#### pop() -> List
    returns new List without last element

#### shift() -> List
    returns new List without first element

#### push(...values: Array<Any>) -> List
    returns new List with values pushed to end of the List

#### concat(...lists: Array<List>) -> List
    returns new List with values from lists pushed to end of the List

#### iterator([reverse = false: Boolean]) -> Iterator
    returns Iterator

#### toArray() -> Array<Any>
    returns List elements in an Array

#### join([separator = " "]) -> String
    join all elements of an List into a String

#### toString() -> String
    String representation of List

#### equals(other: List) -> Boolean
    compares this list to other list by values

#### every, filter, forEach, forEachRight, map, reduce, reduceRight, some
    common Array methods
npm package: @nathanfaucett/immutable-record
Description: immutable persistent record for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.5

Immutable Record
=======

Immutable persistent record for the browser and node.js

# Install using npm
```bash
$ npm install @nathanfaucett/immutable-record --save
```
# Install using yarn
```bash
$ yarn add @nathanfaucett/immutable-record --save
```

# Example Usage
```javascript
var ImmutableRecord = require("@nathanfaucett/immutable-record");


var User = ImmutableRecord({
    id: 0,
    name: null
}, "User");

var user = new User({
    id: 1,
    name: "username"
});
```

# Docs

## Members

#### length -> Number
    returns size of Record, only available if Object.defineProperty is supported


## Static Functions

#### Record.isRecord(value: Any) -> Boolean
    returns true if value is a hash map else false

#### Record.of(...values: Array<Any>) -> Record
    creates Record from passed values same as new Record(...values: Array<Any>)

#### Record.equal(a: Record, b: Record) -> Boolean
    compares hash maps by values


## Functions

#### size() -> Number
    returns size of Record

#### get(key: Any) -> Any
    returns value at key

#### has(key: Any) -> Boolean
    returns true if hash map contains key

#### set(key: Any, value: Any) -> Record
    returns new Record if value at key is not set or different

#### remove(key: Any) -> Record
    returns new Record without the value at key

#### iterator([reverse = false: Boolean]) -> Iterator
    returns Iterator

#### toArray() -> Array<[Any, Any]>
    returns Record elements in an Array

#### toObject() -> Object<String, Any>
    returns Record elements in an Object, keys should be primitives or some key value pairs will be lost

#### join([separator = " "]) -> String
    join all elements of an Record into a String

#### toString() -> String
    String representation of Record

#### equals(other: Record) -> Boolean
    compares this hash map to other hash map by values

#### every, filter, forEach, forEachRight, map, reduce, reduceRight, some
    some common methods
npm package: @nathanfaucett/immutable-set
Description: immutable persistent set for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.5

Immutable Set
=======

Immutable persistent set for the browser and node.js

# Install using npm
```bash
$ npm install @nathanfaucett/immutable-set --save
```
# Install using yarn
```bash
$ yarn add @nathanfaucett/immutable-set --save
```

# Example Usage
```javascript
var ImmutableSet = require("@nathanfaucett/immutable-set");;


var a = new ImmutableSet([0, 1]),
    b = new ImmutableSet(0, 1),
    c = ImmutableSet.of([0, 1]),
    d = ImmutableSet.of(0, 1);

var a0 = a.set(2),
    a1 = a.remove(1);
```

# Docs

## Members

#### length -> Number
    returns size of Set, only available if Object.defineProperty is supported


## Static Functions

#### Set.isSet(value: Any) -> Boolean
    returns true if value is a set else false

#### Set.of(...values: Array<Any>) -> Set
    creates Set from passed values same as new Set(...values: Array<Any>)

#### Set.equal(a: Set, b: Set) -> Boolean
    compares sets by values


## Functions

#### size() -> Number
    returns size of Set

#### get(value: Any) -> Any
    returns value

#### has(value: Any) -> Boolean
    returns true if set contains value

#### set(...values: Array<Any>) -> Set
    returns new Set if value is not in Set

#### remove(...values: Array<Any>) -> Set
    returns new Set without the value

#### iterator([reverse = false: Boolean]) -> Iterator
    returns Iterator

#### toArray() -> Array<Any>
    returns Set elements in an Array

#### join([separator = " "]) -> String
    join all elements of an Set into a String

#### toString() -> String
    String representation of Set

#### equals(other: Set) -> Boolean
    compares this set to other set by values

#### every, filter, forEach, forEachRight, set, reduce, reduceRight, some
    common Array methods
npm package: @nathanfaucett/immutable-vector
Description: immutable persistent vector for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.5

Immutable Vector
=======

Immutable persistent vector for the browser and node.js

# Install using npm
```bash
$ npm install @nathanfaucett/immutable-vector --save
```
# Install using yarn
```bash
$ yarn add @nathanfaucett/immutable-vector --save
```

# Example Usage
```javascript
var ImmutableVector = require("@nathanfaucett/immutable-vector");


var a = new ImmutableVector([0, 1, 2]),
    b = new ImmutableVector(0, 1, 2),
    c = ImmutableVector.of([0, 1, 2]),
    d = ImmutableVector.of(0, 1, 2);

var a0 = a.push(3),
    a1 = a.unshift(-1);
```

# Docs

## Members

#### length -> Number
    returns size of Vector, only available if Object.defineProperty is supported


## Static Functions

#### Vector.isVector(value: Any) -> Boolean
    returns true if value is a vector else false

#### Vector.of(...values: Array<Any>) -> Vector
    creates Vector from passed values same as new Vector(...values: Array<Any>)

#### Vector.equal(a: Vector, b: Vector) -> Boolean
    compares vectors by values


## Functions

#### size() -> Number
    returns size of Vector

#### get(index: UnsignedNumber) -> Any
    returns value at index

#### nth(index: UnsignedNumber) -> Any
    alias to get

#### first() -> Any
    returns first element

#### last() -> Any
    returns last element

#### indexOf(value: Any) -> Number
    returns index of value, -1 if not found

#### set(index: UnsignedNumber, value: Any) -> Vector
    returns new Vector if value at index is different

#### insert(index: UnsignedNumber, ...values: Array<Any>) -> Vector
    returns new Vector with inserted values at index

#### remove(index: UnsignedNumber[, count = 1: UnsignedNumber]) -> Vector
    returns new Vector without the values from index to index + count

#### conj(...values: Array<Any>) -> Vector
    returns new Vector with values pushed to end of the Vector

#### unshift(...values: Array<Any>) -> Vector
    returns new Vector with values pushed to front of the Vector

#### pop() -> Vector
    returns new Vector without last element

#### shift() -> Vector
    returns new Vector without first element

#### push(...values: Array<Any>) -> Vector
    returns new Vector with values pushed to end of the Vector

#### concat(...vectors: Array<Vector>) -> Vector
    returns new Vector with values from vectors pushed to end of the Vector

#### iterator([reverse = false: Boolean]) -> Iterator
    returns Iterator

#### every, filter, forEach, forEachRight, map, reduce, reduceRight, some
    common Array methods

#### toArray() -> Array<Any>
    returns Vector elements in an Array

#### join([separator = " "]) -> String
    join all elements of an Vector into a String

#### toString() -> String
    String representation of Vector

#### equals(other: Vector) -> Boolean
    compares this vector to other vector by values
npm package: @nathanfaucett/inflector
Description: inflector for pluralizing and singularizing words
Author: Nathan Faucett
Latest version: 0.0.1

Inflector
=======

inflector for pluralizing and singularizing words


```javascript
var Inflector = require("@nathanfaucett/inflector");


var inflector = new Inflector();

inflector.plural(/$/, "s");
inflector.plural(/(ch|sh|ss|[sxz])$/i, "$1es");
inflector.plural(/([^aeiouy])y$/i, "$1ies");

inflector.singular(/s$/i, "");
inflector.singular(/(ch|sh|ss|[sxz])es$/i, "$1");
inflector.singular(/([^aeiouy])ies$/i, "$1y");

inflector.irregular("child", "children");
inflector.irregular("person", "people");
inflector.irregular("self", "selves");
inflector.irregular("man", "men");
inflector.irregular("woman", "women");

inflector.uncountable("equipment", "information", "rice", "money", "species", "series", "fish", "sheep", "jeans", "police");

inflector.pluralize("box") === "boxes";
inflector.singularize("boxes") === "box";
```
npm package: @nathanfaucett/is_arguments
Description: checks if value is an arguments object
Author: Nathan Faucett
Latest version: 0.0.1

isArguments [![Build Status](https://travis-ci.org/nathanfaucett/is_arguments.svg?branch=master)](https://travis-ci.org/nathanfaucett/is_arguments)
=======

checks if value is an arguments object

```javascript
var isArguments = require("@nathanfaucett/is_arguments");


isArguments([]); // false
(function() {
    isArguments(arguments); // true
}());
```
npm package: @nathanfaucett/is_array
Description: checks if value is an Array
Author: Nathan Faucett
Latest version: 0.0.1

isArray [![Build Status](https://travis-ci.org/nathanfaucett/is_array.svg?branch=master)](https://travis-ci.org/nathanfaucett/is_array)
=======

checks if value is an Array

```javascript
var isArray = require("@nathanfaucett/is_array");


isArray([]); // true
isArray({}); // false
```
npm package: @nathanfaucett/is_array_like
Description: checks if value is array like
Author: Nathan Faucett
Latest version: 0.0.2

isArrayLike
=======

checks if value is array like

```javascript
var isArrayLike = require("@nathanfaucett/is_array_like");


isArrayLike([]); // true
isArrayLike({}); // false
```
npm package: @nathanfaucett/is_equal
Description: checks if values are equal
Author: Nathan Faucett
Latest version: 0.0.1

isEqual
=======

checks if values are equal

```javascript
var isEqual = require("@nathanfaucett/is_equal");


isEqual(0, 0); // true
isEqual({}, {}); // false
var a = {};
isEqual(a, a); // true
```
npm package: @nathanfaucett/is_length
Description: checks if value is an array length
Author: Nathan Faucett
Latest version: 0.0.1

isLength
=======

checks if value is an array length

```javascript
var isLength = require("@nathanfaucett/is_length");


isLength(10); // true
isLength(-10); // false
isLength(-254.2345); // false
```
npm package: @nathanfaucett/is_null_or_undefined
Description: checks if value is a null or undefined
Author: Nathan Faucett
Latest version: 0.0.1

[![Build Status](https://travis-ci.org/nathanfaucett/is_null_or_undefined.svg?branch=master)](https://travis-ci.org/nathanfaucett/is_null_or_undefined)

# isNullOrUndefined

isNullOrUndefined accepts any value and returns true
if the value is null or undefined.

For all other values false is returned.

**param** {Any}        any value to test

**returns** {Boolean}  the boolean result of testing value

```javascript

  isNullOrUndefined(null);   // returns true

  isNullOrUndefined(undefined);   // returns true

  isNullOrUndefined("string");    // returns false

``
npm package: @nathanfaucett/is_regexp
Description: checks if value is a regexp
Author: Nathan Faucett
Latest version: 0.0.1

# isRegExp

isRegExp takes a value and returns true if the value is a RegExp.
All other values return false

**param** {Any} any primitive or object
**returns** {Boolean}

```javascript

  isRegExp(/regex/); // returns true
  isRegExp(null);    // returns false
  isRegExp({});      // returns false

```
npm package: @nathanfaucett/is_text_input_element
Description: checks if value is a text input element
Author: Nathan Faucett
Latest version: 0.0.1

isTextInputElement
=======

checks if value is a text input element

```javascript
var isTextInputElement = require("@nathanfaucett/is_text_input_element");


isTextInputElement(document.getElementById("input")); // true
```
npm package: @nathanfaucett/is_text_node
Description: checks if value is a text node
Author: Nathan Faucett
Latest version: 0.0.1

isTextNode
=======

checks if value is a text node

```javascript
var isTextNode = require("@nathanfaucett/is_text_node");


isTextNode(document.getElementById("p").childNodes[0]); // true
```
npm package: @nathanfaucett/iterator
Description: iterator for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

Iterator [![Build Status](https://travis-ci.org/nathanfaucett/iterator.svg?branch=master)](https://travis-ci.org/nathanfaucett/iterator)
=======

Iterator for the browser and node.js

```javascript
var Iterator = require("@nathanfaucett/iterator");


var array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],

    index = 0,
    length = array.length,

    iterator = new Iterator(function next() {
        if (index === length) {
            return Iterator.createDone();
        } else {
            return Iterator.createValue(Iterator.VALUES, index, array[index++]);
        }
    }),

    it = iterator.next();

while (!it.done) {
    console.log(it.value);
    it = iterator.next();
}
```
npm package: @nathanfaucett/layer
Description: A router layer for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.4

layer
=======

A router layer for the browser and node.js

```javascript
var Layer = require("@nathanfaucett/layer");


var parent = new Layer("/parent/:parent_id{[0-9]+}", null, true),
    child = new Layer("/child/:id{[0-9]+}(.:format{\\w+})", parent, true);

parent.match("/parent/1") === {
    parent_id: "1"
};
child.match("/parent/1/child/1") === {
    parent_id: "1",
    id: "1"
};
```
npm package: @nathanfaucett/layers
Description: layers is a rack like Router
Author: Nathan Faucett
Latest version: 0.0.6

layers
=======

layers is a rack like Router

```javascript
var layers = require("@nathanfaucett/layers");


var router = new layers.Router(), // layers.Router.create()

    // create new router layer under the "/sessions" path
    sessions = router.scope("sessions");


router.use(
    function cors(req, res, next) {
        // cors middleware
    },
    // can be an object with a middleware function
    {
      middleware: function bodyParser(req, res, next) {
          // body parser middleware
      }
    }
);

router.route() // same as "/"
    .get(
        function getHome(req, res, next) {
            // send home info
            next();
        }
    );

sessions.use(
    function middleware(req, res, next) {
        // do some work on "/sessions/**"
    }
);

sessions.route("sign_in")
    .get(
        function signIn(req, res, next) {
            // return user if signed in
            next();
        }
    );

sessions.route("sign_up")
    .post(
        function signIn(req, res, next) {
            // sign user in
            next();
        }
    );


var server = new http.Server();

server.on("request", function onRequest(request, response) {
    router.handler(request, response, function onHandle(error) {
        // handle error if one passed all the way through the layers
    });
})
```
npm package: @nathanfaucett/layers_browser
Description: layers for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.7

layers_browser
=======

layers for the browser and node.js

```javascript
var layers = require("@nathanfaucett/layers_browser");


var router = new layers.Router(), // layers.Router.create()

    // create new router layer under the "/posts" path
    posts = router.scope("posts");


// can be a object with a middleware function
router.use(
    function middleware(req, res, next) {
        // cors middleware
    }
);

router.route( // same as "/"
    function home(req, res, next) {
        // render home stuff
        next();
    }
);

posts.use(
    function middleware(req, res, next) {
        // do some work on "/posts/**"
    }
);

posts.route( // "/posts"
    function signIn(req, res, next) {
        // return user if signed in
        next();
    }
);

posts.route("/:id{[0-9]+}", // "/posts/:id{[0-9]+}"
    function signIn(req, res, next) {
        // sign user in
        next();
    }
);


var ctx = {
    pathname: "/posts/1",
    url: "http://localhost:9999/posts/1"
};
// call when url changes, pathname or url most be in ctx
router.handler(ctx, function onHandle(error) {
    // handle error if one passed all the way through the layers
});
```
npm package: @nathanfaucett/lexer
Description: plugin based lexical reader
Author: Nathan Faucett
Latest version: 0.0.4

lexer [![Build Status](https://travis-ci.org/nathanfaucett/js-lexer.svg?branch=master)](https://travis-ci.org/nathanfaucett/js-lexer)
=======

plugin based lexical reader

```javascript
var isWhitespace = require("@nathanfaucett/is_whitespace"),
    Lexer = require("@nathanfaucett/lexer");


function whitespace(input, state) {
    var ch = input.read(state),
        string;

    if (isWhitespace(ch)) {
        string = ch;

        while (!input.done(state)) {
            ch = input.peek(state, 0);

            if (isWhitespace(ch)) {
                input.read(state);
                string += ch;
            } else {
                break;
            }
        }

        return new Lexer.Token("WHITESPACE", string);
    } else {
        return Lexer.NO_TOKEN;
    }
}
whitespace.priority = 1;

var lexer = new Lexer("    ")
    .add(whitespace)
    .sort(),
    tokens = lexer.collect();

console.log(tokens);
```
npm package: @nathanfaucett/locales-bundler
Description: locales bundler
Author: Nathan Faucett
Latest version: 0.1.1

js-locales-bundler
=======

locales layout
```
locales/
  en/
    app.json
    error.json
  de/
    app.json
    error.json
```

```javascript
const gulp = require("gulp"),
    localesBundler = require("@nathanfaucett/locales-bundler");

gulp.task("locales", () =>
    gulp.src("locales")
        .pipe(localesBundler({flatten: true, minify: false}))
        .pipe(gulp.dest("build/locales"))
);
```
npm package: @nathanfaucett/map_polyfill
Description: Map polyfill for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.4

Map
=======

Map for the browser and node.js


```javascript
var Map = require("@nathanfaucett/map_polyfill");


var a = new Map(),
    key = {};

a.set(key, "value");
a.get(key) === "value";
a.remove(key);
```
npm package: @nathanfaucett/mesh_component
Description: mesh component for scene_graph
Author: Nathan Faucett
Latest version: 0.0.2

mesh_component [![Build Status](https://travis-ci.org/nathanfaucett/js-mesh_component.svg?branch=master)](https://travis-ci.org/nathanfaucett/js-mesh_component)
======

mesh component for scene_graph
npm package: @nathanfaucett/messenger
Description: two way messenger, requires an adapter
Author: Nathan Faucett
Latest version: 0.0.3

Messenger
=======

two way messenger, requires an adapter


```javascript
var Messenger = require("@nathanfaucett/messenger"),
    SomeMessengerAdapter = require("some_messenger_adapter");


var messenger = new Messenger(new SomeMessengerAdapter());


messenger.on("message", function(data, callback) {
    callback(undefined, data);
});

messenger.emit("message", {
    "data": "Hello"
}, function(error, data) {
    if (error) {
        // handle error
    } else {
        // do something with data
    }
});

```
npm package: @nathanfaucett/messenger_adapter
Description: simple messenger adapter for @nathanfaucett/messenger
Author: Nathan Faucett
Latest version: 0.0.1

MessengerAdapter
=======

simple messenger adapter for @nathanfaucett/messenger

```javascript
var createMessengerAdapter = require("@nathanfaucett/messenger_adapter"),
    adapter = createMessengerAdapter(),
    client = adapter.client,
    server = adapter.server;


server.on("test", function() {
    console.log("test");
});

client.emit("test");
```
npm package: @nathanfaucett/messenger_websocket_adapter
Description: messenger WebSocket adapter
Author: Nathan Faucett
Latest version: 0.0.1

MessengerWebSocketAdapter
=======

messenger WebSocket adapter


```javascript
// Client
var WS = require("ws"),
    Messenger = require("@nathanfaucett/messenger"),
    MessengerWebSocketAdaptor = require("@nathanfaucett/messenger_websocket_adapter");


var socket = new WS("ws://127.0.0.1:9999"),
    messenger = new Messenger(new MessengerWebSocketAdaptor(socket));


socket.onopen = function() {
    ping();
};

function ping() {
    messenger.emit("message", {
        message: "ping"
    }, function pong(error, data) {
        ping();
    });
}

// Server
var ws = require("ws"),
    Messenger = require("@nathanfaucett/messenger"),
    MessengerWebSocketAdaptor = require("@nathanfaucett/messenger_websocket_adapter");


var wss = new ws.Server({
    port: 9999
});


wss.on("connection", function onConnection(socket) {
    var messenger = new Messenger(new MessengerWebSocketAdaptor(
        socket,
        function attachMessage(socket, callback) {
            socket.on("message", function onMessage(data) {
                callback(JSON.parse(data));
            });
        }
    ));

    messenger.on("message", function(data, done) {
        done(undefined, {
            message: "pong"
        });
    });
});
```
npm package: @nathanfaucett/messenger_worker_adapter
Description: messenger WebWorker adapter
Author: Nathan Faucett
Latest version: 0.0.1

MessengerWorkerAdapter
=======

messenger WebWorker adapter

```javascript
// Worker
var Messenger = require("@nathanfaucett/messenger"),
    MessengerWorkerAdaptor = require("@nathanfaucett/messenger_worker_adapter");


var adaptor = new MessengerWorkerAdaptor(),
    messenger = new Messenger(adaptor);


function onPing(data, next) {
    console.log(data.data);
    next(undefined, {
        "data": "pong"
    });
}

messenger.on("ping", onPing);

// Main Thread
var assert = require("@nathanfaucett/assert"),
    Messenger = require("@nathanfaucett/messenger"),
    MessengerWorkerAdaptor = require("@nathanfaucett/messenger_worker_adapter");


var adaptor = new MessengerWorkerAdaptor("worker.js"),
    messenger = new Messenger(adaptor);


function onPongCallback(error, data) {
    console.log(data.data);
    setTimeout(ping, 1000);
}

function ping() {
    messenger.emit("ping", {
        data: "ping"
    }, onPongCallback);
}

ping();
```
npm package: @nathanfaucett/mime
Description: mime for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

Mime
=======

mime for the browser and node.js

```javascript
var mime = require("@nathanfaucett/mime");


// use fallback argument
mime.lookUp("test", "application/json") === "application/json";
mime.lookUp("test.json") === "application/json";
mime.lookUpType("json") === "application/json";
mime.lookUpExt("application/json") === "json";
```
npm package: @nathanfaucett/now
Description: performance.now polyfill
Author: Nathan Faucett
Latest version: 0.0.3

now
=======

performance.now polyfill

```javascript
var now = require("@nathanfaucett/now");

now(); // returns time in milliseconds since loaded
now.getStartTime(); // returns time in milliseconds when loaded
now.stamp(); // returns time in milliseconds since Jan, 1, 1970
```
npm package: @nathanfaucett/object-every
Description: tests whether all elements in the object pass the test implemented by the provided function.
Author: Nathan Faucett
Latest version: 0.0.2

object-every
=======

tests whether all elements in the object pass the test implemented by the provided function.


```javascript
var objectEvery = require("@nathanfaucett/object-every");


objectEvery({
        a: "a",
        b: "b",
        c: "c"
    },
    function(value, key) {
        return value === key;
    }
) === true;
```
npm package: @nathanfaucett/object-filter
Description: creates a new object with all elements that pass the test implemented by the provided function.
Author: Nathan Faucett
Latest version: 0.0.2

object-filter
=======

creates a new object with all elements that pass the test implemented by the provided function.


```javascript
var objectFilter = require("@nathanfaucett/object-filter");


objectFilter({
        a: "a",
        b: "b",
        c: "c"
    },
    function(value, key) {
        return key === "b";
    }
) === {
    b: "b"
};
```
npm package: @nathanfaucett/object-filter_one
Description: returns first element that pass the test implemented by the provided function.
Author: Nathan Faucett
Latest version: 0.0.2

object-filter_one
=======

returns first element that pass the test implemented by the provided function.


```javascript
var objectFilterOne = require("@nathanfaucett/object-filter_one");


objectFilterOne({
        a: "a",
        b: "b",
        c: "c"
    },
    function(value, key) {
        return key === "b";
    }
) === "b";
```
npm package: @nathanfaucett/object-for_each
Description: executes a provided function once per object element.
Author: Nathan Faucett
Latest version: 0.0.2

object-for_each
=======

executes a provided function once per object element.


```javascript
var objectForEach = require("@nathanfaucett/object-for_each");


objectForEach({
        a: "a",
        b: "b",
        c: "c"
    },
    function(value, key, object) {
        console.log(value, key, object);
    }
);
```
npm package: @nathanfaucett/object-for_each_right
Description: executes a provided function once per object element.
Author: Nathan Faucett
Latest version: 0.0.2

object-for_each_right
=======

executes a provided function once per object element.


```javascript
var objectForEachRight = require("@nathanfaucett/object-for_each_right");


objectForEachRight({
        a: "a",
        b: "b",
        c: "c"
    },
    function(value, key, object) {
        console.log(value, key, object);
    }
);
```
npm package: @nathanfaucett/object-map
Description: object map for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

object-map
=======

object map for the browser and node.js


```javascript
var objectMap = require("@nathanfaucett/object-map");


objectMap({
        a: "a",
        b: "b",
        c: "c"
    },
    function(value, key, object) {
        return value + key;
    }
); === {
    a: "aa",
    b: "bb",
    c: "cc"
};
```
npm package: @nathanfaucett/object-reduce
Description: object reduce for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

object-reduce
=======

object reduce for the browser and node.js


```javascript
var objectReduce = require("@nathanfaucett/object-reduce");


objectReduce({
        a: 0,
        b: 1,
        c: 2
    },
    function(currentValue, value) {
        return currentValue + value;
    }
) === 3;
```
npm package: @nathanfaucett/object-reduce_right
Description: object reduce from the right for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

object-reduce_right
=======

object reduce from the right for the browser and node.js


```javascript
var objectReduceRight = require("@nathanfaucett/object-reduce_right");


objectReduceRight({
        a: 0,
        b: 1,
        c: 2
    },
    function(currentValue, value) {
        return currentValue + value;
    }
) === 3;
```
npm package: @nathanfaucett/object-some
Description: tests whether one element in the object pass the test implemented by the provided function.
Author: Nathan Faucett
Latest version: 0.0.2

object-some
=======

tests whether one element in the object pass the test implemented by the provided function.


```javascript
var objectSome = require("@nathanfaucett/object-some");


objectSome({
        a: "a",
        b: "b",
        c: "c"
    },
    function(value, key) {
        return value === "c";
    }
) === true;
```
npm package: @nathanfaucett/once
Description: create a function from a function so it is only called once
Author: Nathan Faucett
Latest version: 0.0.1

once [![Build Status](https://travis-ci.org/nathanfaucett/once.svg?branch=master)](https://travis-ci.org/nathanfaucett/once)
=======

create a function from a function so it is only called once
npm package: @nathanfaucett/orbit_control_component
Description: orbit_control component for scene_graph
Author: Nathan Faucett
Latest version: 0.0.2

orbit_control_component [![Build Status](https://travis-ci.org/nathanfaucett/js-orbit_control_component.svg?branch=master)](https://travis-ci.org/nathanfaucett/js-orbit_control_component)
======

orbit_control component for scene_graph
npm package: @nathanfaucett/ordinalize
Description: ordinalize numbers
Author: Nathan Faucett
Latest version: 0.0.1

ordinalize
=======

ordinalize numbers

```javascript
var ordinalize = require("@nathanfaucett/ordinalize");


ordinalize(0) === "0";
ordinalize(1) === "1st";
ordinalize(2) === "2nd";
ordinalize(3) === "3rd";
ordinalize(10) === "10th";
ordinalize(11) === "11th";
ordinalize(12) === "12th";
ordinalize(13) === "13th";
ordinalize(14) === "14th";
ordinalize(51) === "51st";
ordinalize(62) === "62nd";
ordinalize(73, false) === "73";
ordinalize(84, false) === "th";
ordinalize(100, false) === "th";
```
npm package: @nathanfaucett/page
Description: page for the browser
Author: Nathan Faucett
Latest version: 0.0.8

page
=======

single page routes for the browser


```javascript
var page = require("@nathanfaucett/page");


page.on("request", function(ctx) {
    // handle ctx object
});

page.setHtml5Mode(false, function onSetHtml5Mode() {
    page.listen();
});
```
npm package: @nathanfaucett/parallel
Description: parallel for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.3

parallel
=======

parallel for the browser and node.js

```javascript
var fs = require("fs"),
    parallel = require("@nathanfaucett/parallel");

parallel(
    ["file1", "file2", "file3"].map(function(path) {
        return function(done) {
            fs.stat(path, done);
        };
    }),
    function(err, results) {
        if (err) {
            console.log(err);
        } else {
            console.log(results); // array of file stat in same order as passed
        }
    }
);
```
npm package: @nathanfaucett/path_to_regexp
Description: path to regexp for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

pathToRegExp
=======

pathToRegExp for the browser and node.js


```javascript
var pathToRegExp = require("@nathanfaucett/path_to_regexp");


var params = [],
    regexp = pathToRegExp("/parent/:parentId{[0-9]+}", params, false),
    regexpEnd = pathToRegExp("/parent/:parentId{[0-9]+}/child/:id{[0-9]+}(.:format{\\w+})", true);


console.log(regexp.exec("/parent/1/child/1"));
console.log(regexpEnd.exec("/parent/1/child/1.json"));

```
npm package: @nathanfaucett/pluralize
Description: pluralize words, uses global inflector from inflections @nathanfaucett/inflections
Author: Nathan Faucett
Latest version: 0.0.1

pluralize
=======

pluralize words, uses global inflector from inflections @nathanfaucett/inflections

```javascript
var pluralize = require("@nathanfaucett/pluralize"),
    inflections = require("@nathanfaucett/inflections");


var en = inflections("en");

en.plural(/$/, "s");
en.plural(/(ch|sh|ss|[sxz])$/i, "$1es");
en.plural(/([^aeiouy])y$/i, "$1ies");

pluralize("word") === "words";
pluralize("sky") === "skies";
pluralize("box", "en") === "boxes";
```
npm package: @nathanfaucett/promise_polyfill
Description: Promise polyfill for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.4

Promise
=======

Promise polyfill for the browser and node.js


```javascript
var Promise = require("@nathanfaucett/promise_polyfill");


new Promise(function resolver(resolve, reject) {
    if (value) {
        resolve(true);
    } else {
        reject(false);
    }
}).then(
    function success(value) {
        return value;
    },
    function error(value) {
        return value;
    }
);
````
npm package: @nathanfaucett/prop_types
Description: propTypes for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

propTypes
=======

propTypes for the browser and node.js

```javascript
var propTypes = require("@nathanfaucett/prop_types");


var props = {
    key: "value"
};

// checks if the key is a string in the given props object
//                             display name     locale for i18n
propTypes.string(props, "key", "Prop",          "en"); // returns error or array of errors
```
npm package: @nathanfaucett/pseudo_random
Description: pseudo random number generator
Author: Nathan Faucett
Latest version: 0.0.2

pseudo_random [![Build Status](https://travis-ci.org/nathanfaucett/js-pseudo_random.svg?branch=master)](https://travis-ci.org/nathanfaucett/js-pseudo_random)
======
pseudo random number generator


```javascript
var random = new PseudoRandom(Date.now());


random.nextInt(); // 0 - Math.pow(2, 31) - 1 max integer value;
random.nextFloat(); // 0.0 - 1.0
```
npm package: @nathanfaucett/push_unique
Description: push only unique values into array
Author: Nathan Faucett
Latest version: 0.0.1

pushUnique
=======

push only unique values into array

```javascript
var pushUnique = require("@nathanfaucett/push_unique");


var array = [0, 2, 4];
pushUnique(array, 0, 1, 2, 3, 4, 5);
array === [0, 2, 4, 1, 3, 5];
```
npm package: @nathanfaucett/qs
Description: querystring parse/stringify for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

qs
=======

querystring parse/stringify for the browser and node.js

```javascript
var qs = require("@nathanfaucett/qs");


qs.parse("key=value&keys[0]=0&keys[1]=1&keys[2]=2") === {
    key: "value",
    keys: [0, 1, 2]
};
decodeURIComponent(qs.stringify({
    key: "value",
    keys: [0, 1, 2]
})), === "key=value&keys[0]=0&keys[1]=1&keys[2]=2";
```
npm package: @nathanfaucett/queue
Description: create a Queue for callbacks and call them all in order
Author: Nathan Faucett
Latest version: 0.0.2

Queue
=======

create a Queue for callbacks and call them all in order

```javascript
var Queue = require("@nathanfaucett/queue");


var queue = new Queue();


queue.enqueue(function() {
    console.log("called first");
});
queue.enqueue(function() {
    console.log("called second");
});

queue.notifyAll();
```
npm package: @nathanfaucett/re_inflect
Description: regex for spliting dasherize underscored and camelized words
Author: Nathan Faucett
Latest version: 0.0.1

reInflect
=======

regex for spliting dasherize underscored and camelized words

```javascript
var reInflect = require("@nathanfaucett/re_inflect");


var parts = "asdf_asdf-asdfAsdf asdf.asdf".match(reInflect);
parts === ["asdf", "asdf", "asdf", "Asdf", "asdf.asdf"];
```
npm package: @nathanfaucett/react-store
Description: store bindings for react
Author: Nathan Faucett
Latest version: 0.0.2

react-store [![Build Status](https://travis-ci.org/nathanfaucett/js-react-store.svg?branch=master)](https://travis-ci.org/nathanfaucett/js-react-store)
=======

store bindings for react

```javascript
var React = require("react"),
    ReactDOM = require("react-dom"),
    PropTypes = require("prop-types"),
    createStore = require("@nathanfaucett/store"),
    inherits = require("@nathanfaucett/inherits"),

    reduxDevtoolsExtension = require("redux-devtools-extension"),

    ReactStore = require("@nathanfaucett/react-store");


var store = createStore(),

    Component = React.Component,
    Provider = ReactStore.Provider,
    connect = ReactStore.connect;


store.setInitialState({
    counter: {
        count: 0
    }
});

if (window.__REDUX_DEVTOOLS_EXTENSION__) {
    store.addAndComposeReduxStore(window.__REDUX_DEVTOOLS_EXTENSION__);
}

store.addMiddleware(function counterMiddleware(store, action, next) {
    switch (action.type) {
        case "INC": {
            store.dispatch({
                type: "INC_DONE",
                count: store.getState().counter.count + 1
            });
            break;
        }
        case "DEC": {
            store.dispatch({
                type: "DEC_DONE",
                count: store.getState().counter.count - 1
            });
            break;
        }
    }

    next(action);
});

store.add(function counter(state, action) {
    switch (action.type) {
        case "INC_DONE":
            return {
                count: action.count
            };
        case "DEC_DONE":
            return {
                count: action.count
            };
        default: {
            return state
        }
    }
});


function Counter(props, children, context) {
    Component.call(this, props, children, context);
}
inherits(Counter, Component);

Counter.propTypes = {
    count: PropTypes.number.isRequired
};

Counter.prototype.render = function() {
    return (
        React.createElement("div", null,
            React.createElement("button", {
                onClick: this.props.incCount
            }, "+"),
            React.createElement("button", {
                onClick: this.props.decCount
            }, "-"),
            React.createElement("p", null, this.props.count)
        )
    );
};


function mapDispatchToProps(dispatch) {
    return {
        incCount: function() {
            dispatch({
                type: "INC"
            });
        },
        decCount: function() {
            dispatch({
                type: "DEC"
            });
        }
    };
}

function mapStateToProps(state /*, ownProps */) {
    return {
        count: state.counter.count
    };
}

var CounterContainer = connect(mapStateToProps, mapDispatchToProps, Counter);


ReactDOM.render(
    React.createElement(Provider, {
        store: store,
        render: function render() {
            return React.createElement(CounterContainer, null);
        }
    }),
    document.getElementById("app")
);

```