open-index/open-npm huggingface dataset:
npm package: @nathanfaucett/base64_encoding
Description: base64 encoding/decoding for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.1

base64 encoding
=======

base64 encoding/decoding for the browser and node.js

```javascript
var base64 = require("base64_encoding");


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

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

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

bcrypt for the browser and node.js

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


var salt = bcrypt.genSaltSync(4);

bcrypt.genSalt(4, function onGenSalt(error, salt) {
    if (error) {
        // handle error
    } else {
        // do something with salt
    }
});

var hash = bcrypt.hashSync("password", salt);

bcrypt.hash("password", salt, function onHash(error, hash) {
    if (error) {
        // handle error
    } else {
        // do something with hash
    }
});

bcrypt.compareSync("password", hash) === true;

bcrypt.compare("password", hash, function onCompare(error, compare) {
    if (error) {
        // handle error
    } else {
        // compare === true
    }
});

var rounds = bcrypt.getRounds(hash);
var salt = bcrypt.getSalt(hash);
```
npm package: @nathanfaucett/bezier
Description: bezier curves
Author: Nathan Faucett
Latest version: 0.0.4

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


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


var canvas = document.getElementById("canvas"),
    ctx = canvas.getContext("2d"),
    p0 = [0, 0],
    p1 = [0, 512],
    p2 = [512, 512],
    p3 = [512, 0],
    v0 = [0, 0],
    v1 = [0, 0],
    t = 0;

ctx.beginPath();

bezier.cubic(v1, t, p0, p1, p2, p3);

for (t = 0; t < 1.01; t += 0.05) {
    v0[0] = v1[0];
    v0[1] = v1[1];
    bezier.cubic(v1, t, p0, p1, p2, p3);
    ctx.moveTo(v0[0], v0[1]);
    ctx.lineTo(v1[0], v1[1]);
}

ctx.stroke();
```
npm package: @nathanfaucett/bin_encoding
Description: bin encoding/decoding for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.1

bin encoding
=======

bin encoding/decoding for the browser and node.js

```javascript
var bin = require("bin_encoding");


bin.stringToBytes("this is a test") === [116, 104, 105, 115, 32, 105, 115, 32, 97, 32, 116, 101, 115, 116];
bin.bytesToString([116, 104, 105, 115, 32, 105, 115, 32, 97, 32, 116, 101, 115, 116]) === "this is a test";
```
npm package: @nathanfaucett/bind
Description: binds object to functions this value
Author: Nathan Faucett
Latest version: 0.0.1

bind
=======

binds object to functions this value


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


var counter = {
    value: 0
};

var inc = bind(function inc() {
    this.value++;
}, counter);


inc();

// counter.value === 1
```
npm package: @nathanfaucett/camelize
Description: camelize string
Author: Nathan Faucett
Latest version: 0.0.1

camelize
=======

camelize string

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


camelize("String-string", false) === "StringString";
camelize("string-string", false) === "StringString";
camelize("string-string", true) === "stringString";
camelize("string-string") === "stringString";
camelize("string.string") === "string.string";
```
npm package: @nathanfaucett/camera_component
Description: camera component for scene_graph
Author: Nathan Faucett
Latest version: 0.0.2

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

camera component for scene_graph
npm package: @nathanfaucett/changeset
Description: ecto like changeset for javascript/node.js
Author: Nathan Faucett
Latest version: 0.1.0

# js-changeset

ecto like changesets for javascript/node.js

```javascript
const validate = (params = {}) =>
	new Changeset(params, ["name", "email", "password"])
		.validateRequired(["email", "password"])
		.validateFormat("email", /@/)
		.validateLength("password", { ">=": 6 });

var changeset = validate({ name: "Bob", email: "bob@mail.com" });
```
npm package: @nathanfaucett/class
Description: Class for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.1

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


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


function ChildClass() {

    Class.call(this);

    this.value = null;
}
Class.extend(ChildClass, "namespace.ChildClass");

ChildClass.prototype.getValue = function() {
    return this.value;
};
```
npm package: @nathanfaucett/classify
Description: classify string, changes "class" to "Class" and "some_class" to "SomeClass"
Author: Nathan Faucett
Latest version: 0.0.1

classify
=======

classify string, changes class to Class and some_class to SomeClass

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


classify("boxes") === "Box";
classify("skies") === "Sky";
classify("bike_riders") === "BikeRider";
classify("mega-big-sales") === "MegaBigSale";
```
npm package: @nathanfaucett/comn
Description: comn is a commonjs compiler
Author: Nathan Faucett
Latest version: 0.0.13

comn
=======

comn is a commonjs compiler

```bash
$ comn -f ./path/to/file -o ./path/to/out
```

```javascript
var comn = require("comn");


var out = comn("path/to/index.js", {
    parseAsync: false,
    builtin: {},
    mappings: {},
    packageType: "main"
});

// single file output
fs.writeFileSync("path/to/out/file.js", out.entry().source);

// if parsed async deps
out.each(function(chunk) {
    fs.writeFileSync("path/to/out/file.js", "//# sourceMappingURL=./path/to/sourceMap\n" + chunk.source);
});

// will generate source maps for each entry
out.generateSourceMaps();

out.each(function(chunk) {
    fs.writeFileSync("path/to/out/file.js.map", chunk.sourceMap.toJSON());
});

```

## Async Parsing
```javascript
// can load node modules or files parses path/to/file into separate file unless
// the parseAsync option is false
require.async("path/to/file", function(file) {
    console.log(file);
});
```
npm package: @nathanfaucett/config-bundler
Description: config bundler
Author: Nathan Faucett
Latest version: 0.1.6

# js-config-bundler

config layout

```
config/
  config.production.js
  config.test.js
  config.js
```

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

gulp.task("config", () =>
    gulp.src([
            path.join("config/config.*.js")),
            path.join("config/config.js"))
        ])
        .pipe(configBundler({
            options: {
                port: 8080
            }
        }))
        .pipe(gulp.dest("app/js"))
);
```
npm package: @nathanfaucett/constantize
Description: constantize string, changes "const" to "CONST"
Author: Nathan Faucett
Latest version: 0.0.1

constantize
=======

constantize string, changes "const" to "CONST"

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


constantize("string-string") === "STRING_STRING";
constantize("stringString") === "STRING_STRING";
```
npm package: @nathanfaucett/cookies
Description: get/set/remove cookies for the browser
Author: Nathan Faucett
Latest version: 0.0.2

cookies
=======

get/set/remove cookies for the browser

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


cookies.set("key", "value");
cookies.get("key") === "value";

cookies.has("key") === true;
cookies.has("value") === false;

cookies.keys() === ["key"];
cookies.remove("key");
```
npm package: @nathanfaucett/create-grid.less
Description: create grid helper functions for less
Author: Nathan Faucett
Latest version: 0.0.3

create-grid.less
=======

create grid helper functions for less


create-grid(@name, @grid-columns, @min-width[, @max-width])


```less
@import "create-grid.less";


// columns only used when size of screen fits min max width
.create-grid(xs, 12, 0, 480);
.create-grid(sm, 12, 480, 640);
.create-grid(md, 12, 640, 800);
.create-grid(lg, 12, 800);

// columns only used if size of screen fits and not overridden by larger query, like bootstrap
.create-grid(xs, 12, 0px);
.create-grid(sm, 12, 480px);
.create-grid(md, 12, 640px);
.create-grid(lg, 12, 800px);

// creates hidden classes for using hidden-@{size}, hidden-min-@{size}, and hidden-max-@{size}
.create-hidden(xs, 0, 480);
.create-hidden(sm, 480, 768);
.create-hidden(md, 768, 960);
.create-hidden(lg, 960);
```
npm package: @nathanfaucett/create_component_function
Description: create component function for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

createComponentFunction
=======

create component function for the browser and node.js


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


function stringChecker(props, propName, displayName/*, locale */) {
    if (typeof(props[propName]) !== "string") {
        return new TypeError(propName + " must be a string from "+ displayName);
    } else {
        return null;
    }
}

var signIn = createComponentFunction({
        name: "signIn",
        propTypes: {
            username: stringChecker,
            password: stringChecker
        }
    },
    function(props, callback) {
        var username = props.username,
            password = props.password;

        callback(undefined, {
            username: username,
            password: password
        });
    }
);

signIn({
    username: "username",
    password: "password"
}, "en", function(errors, data) {
    if (errors) {
        // handle errors
    } else {
        // do stuff with data
    }
});
```
npm package: @nathanfaucett/create_form
Description: create form
Author: Nathan Faucett
Latest version: 0.1.0

# js-create_form

create form

```javascript
import React from "react";
import axios from "axios";

class Form extends React.Component {
	constructor(props) {
		super(props);

		this.state = {
			values: {
				email: "",
				password: ""
			},
			errors: {
				email: [],
				password: []
			}
		};

		this.form = createForm(
			{
				email: ({ onChange }) => ({
					props: {
						type: "text",
						value: state.values.email,
						onChange: e => onChange(e.target.value)
					}
				}),
				password: ({ onChange }) => ({
					props: {
						type: "password",
						value: state.values.email,
						onChange: e => onChange(e.target.value)
					}
				})
			},
			{
				get: () => ({ ...this.state.values }),
				set: (errors, values) => {
					this.setState({
						errors: errors,
						values: values
					});
				},
				changeset: changeset =>
					changeset
						.validateRequired(["email", "password"])
						.validateFormat("email", /@/)
						.validateLength("password", { ">=": 6, "<=": 1024 })
			}
		);

		this.onSubmit = e => {
			e.preventDefault();

			if (this.form.isValid()) {
				const { email, password } = this.state.values;

				axios
					.post("/sign_in", { email, password })
					.then(response => {
						console.log(response);
						this.form.reset();
					})
					.catch(errors => this.form.setErrors(errors));
			}
		};
	}

	render() {
		const { errors, values } = this.state,
			fields = this.form.render(errors, values);

		return (
			<form onSubmit={this.onSubmit}>
				<input {...fields.email.props} />
				<Errors errors={fields.email.errors} />
				<br />
				<input {...fields.password.props} />
				<Errors errors={fields.email.errors} />
				<br />
				<input type="submit" value="Submit" onClick={this.onSubmit} />
			</form>
		);
	}
}

const Errors = ({ errors }) => (
	<ul>
		{errors.map((error, index) => <li key={index}>{error.message}</li>)}
	</ul>
);
```
npm package: @nathanfaucett/create_function_wrapper
Description: creates a function wrapper for binding arguments and this values
Author: Nathan Faucett
Latest version: 0.0.2

createFunctionWrapper
=======

creates a function wrapper for binding arguments and this values

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


function test(a, b, c) {
    return this.name + " age: " + a + " last: " + b + " pet: " + c;
}

var wrapper = createFunctionWrapper(test);

wrapper.__wrapper__.setThisArg({
    name: "Bob"
});
wrapper.__wrapper__.addArgsLeft([32]);
wrapper.__wrapper__.addArgsRight(["Dog"]);

// wrapper("Bobby") === "Bob age: 32 last: Bobby pet: Dog");
```
npm package: @nathanfaucett/create_loop
Description: create a loop to manage requestAnimationFrame calls
Author: Nathan Faucett
Latest version: 0.0.1

createLoop
=======

create a loop to manage requestAnimationFrame calls

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


function loopHandler(ms) {
    loop.isRunning() === true;
    loop.pause();
    loop.isPaused() === true;
}

var loop = createLoop(loopHandler, document.body);

loop.run();
```
npm package: @nathanfaucett/create_map
Description: linear map for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

createMap
=======

linear map for the browser and node.js


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


var map = createMap();


var nan = NaN,
    object = {},
    array = [],
    number = 10;

map.set(nan, "NaN");
map.set(object, "{}");
map.set(array, "[]");
map.set(number, "10");

console.log(
    map.get(nan),
    map.get(object),
    map.get(array),
    map.get(number)
);

```
npm package: @nathanfaucett/create_pool
Description: creates a pooler function for a Constructors
Author: Nathan Faucett
Latest version: 0.0.3

createPool
=======

creates a pooler function for a Constructors


```javascript
var createPool = reqiure("@nathanfaucett/create_pool");

function Vector(x, y) {
    this.x = x;
    this.y = y;
}

var createVector = createPool(Vector),
    vec = createVector(10, 5); // Vector {x: 10, y: 5}
```
npm package: @nathanfaucett/create_store
Description: create private stores
Author: Nathan Faucett
Latest version: 0.0.2

createStore
=======

create private stores


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


var store = createStore();


var object = {},
    array = [];

store.set(object, "{}");
store.set(array, "[]");

console.log(
    store.get(object),
    store.get(array)
);

```
npm package: @nathanfaucett/css
Description: css helpers functions
Author: Bakasho Team
Latest version: 0.0.4

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

css helpers functions

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

var style = {
    background: "#ffffff"
};

css.alignContent(style, "left");
css.transition(
    style,
    "background 200ms "+ css.easing.inOut +" 0ms",
    "opacity 100ms "+ css.easing.out +" 0ms",
    "width 100ms "+ css.easing["in"] +" 0ms"
);
css.textShadow(style, "0 0 2px #000", "0 2px 2px #000");
```
npm package: @nathanfaucett/curry
Description: creates function with arguments bound to it
Author: Nathan Faucett
Latest version: 0.0.2

curry
=======

creates function with arguments bound to it


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


function add(x, y) {
    return x + y;
}

/*
function one_plus(y) {
    return add(1, y);
}
*/
var one_plus = curry(add, 1);

one_plus(5); // 6
```
npm package: @nathanfaucett/curry_right
Description: creates function with arguments bound to it
Author: Nathan Faucett
Latest version: 0.0.2

curryRight
=======

creates function with arguments bound to it


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


function subtract(x, y) {
    return x - y;
}

/*
function subtract_one(y) {
    return subtract(x, 1);
}
*/
var subtract_one = curryRight(subtract, 1);

subtract_one(5); // 4
```
npm package: @nathanfaucett/dasherize
Description: dasherize string, "some_string" to "some-string"
Author: Nathan Faucett
Latest version: 0.0.1

dasherize
=======

dasherize string, "some_string" to "some-string"

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


dasherize("string-string") === "string-string";
dasherize("stringString") === "string-string";
```
npm package: @nathanfaucett/debounce
Description: debounce for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.4

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

debounce for the browser and node.js
npm package: @nathanfaucett/deep_equals
Description: deep check for equality
Author: Nathan Faucett
Latest version: 0.0.1

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

deep check for equality

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


deepEquals(0, 0) === true;
deepEquals(0, 1) === false;

deepEquals("string", "string") === true;
deepEquals("string", "diff_string") === false;

deepEquals([0, 1, 2], [0, 1, 2]) === true;
deepEquals([0, 1, 2], [0, 1, 2, 3]) === false;
deepEquals([0, 1, 2], [0, 1]) === false;

deepEquals({a: 0, b: 1}, {a: 0, b: 1}) === true;
deepEquals({a: 0, b: 1}, {a: 0, b: 1, c: 2}) === false;
deepEquals({a: 0, b: 1}, {a: 0})
```
npm package: @nathanfaucett/deep_mixin
Description: deep mixin for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

deep mixin [![Build Status](https://travis-ci.org/nathanfaucett/deep_mixin.svg)](https://travis-ci.org/nathanfaucett/deep_mixin)
=======

deep mixin for the browser and node.js
npm package: @nathanfaucett/dependency_tree
Description: commonjs style dependency tree parser
Author: Nathan Faucett
Latest version: 0.0.5

DependencyTree
=======

commonjs style dependency tree parser

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


var tree = DependencyTree.create("./path/to/index.js");


tree.parse();

tree.chunks.forEach(function(chunk) {
    console.log(chunk.fullPath);

    chunk.dependencies.forEach(function(dependency) {
        console.log("\t" + dependency.fullPath);
    });
});
```
npm package: @nathanfaucett/easing
Description: easing functions
Author: Nathan Faucett
Latest version: 0.0.1

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

easing functions

```javasctipt
var easing = require("@nathanfaucett/easing");

/*
  percentComplete - (0.0 to 1.0).
  elaspedTime - The number of milliseconds the animation has been running
  startValue - the value to start at (or the value when the percent complete is 0%)
  endValue - the value to end at (or the value when the percent complete is 100%)
  totalDuration - The total desired length of the animation in milliseconds
*/
easing.inOutQuad(percentComplete, elaspedTime, startValue, endValue, totalDuration);
```