open-index/open-npm huggingface dataset:
npm package: @nathanfaucett/request
Description: http requests for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.11

# Request

http requests for the browser and node.js

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

request({
	url: "https://www.google.com",
	method: "GET",
	success: function(response) {
		console.log(response);
	},
	error: function(response) {
		console.log(response);
	}
});
```
npm package: @nathanfaucett/request_animation_frame
Description: requestAnimationFrame for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.4

requestAnimationFrame
=======

requestAnimationFrame for the browser and node.js


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

requestAnimationFrame(function(ms) {
    console.log(ms);
});
```
npm package: @nathanfaucett/resolve
Description: resolve node type file paths
Author: Nathan Faucett
Latest version: 0.0.4

resolve
=======

resolve node type file paths

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


var module = resolve("path/to/module");

module === {
    fullPath: "full/path/to/module",
    pkgFullPath: "full/path/to/package.json",
    pkg: {} // parsed json package if has one
};
```
npm package: @nathanfaucett/ri
Description: request and response interface
Author: Nathan Faucett
Latest version: 0.0.4

ri
=======

request and response interface


```javascript
var ri = require("@nathanfaucett/ri"),
    config = {
        "json spaces": 4
    };

server.on("request", function(req, res) {
    ri.init(req, res, config);
});
```
npm package: @nathanfaucett/same_origin
Description: same origin url checker
Author: Nathan Faucett
Latest version: 0.0.3

sameOrigin
=======

same origin url checker

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


sameOrigin("http://bob.com/request", "http://test.com") === false;

sameOrigin("http://test.com:9999/request", "http://test.com:3000") === false;
sameOrigin("http://test.com:1234/request", "http://test.com:443") === false;
sameOrigin("http://test.com:4321/request", "http://test.com:80") === false;

sameOrigin("http://test.com:9999/request", "http://test.com:9999") === true;

sameOrigin("https://test.com/request", "https://test.com:80") === true;
sameOrigin("https://test.com/request", "https://test.com:443") === true;
```
npm package: @nathanfaucett/scene_graph
Description: scene_graph
Author: Nathan Faucett
Latest version: 0.0.2

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

entity component scene graph

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


var Scene = sceneGraph.Scene,
    Entity = sceneGraph.Entity;


var scene = Scene.create(),
    entity = Entity.create();


scene.addEntity(entity);
```
npm package: @nathanfaucett/scene_renderer
Description: scene renderer
Author: Nathan Faucett
Latest version: 0.0.2

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

entity component scene graph

```javascript
var sceneGraph = require("@nathanfaucett/scene_graph"),
    sceneRenderer = require("@nathanfaucett/scene_renderer");


var Scene = sceneGraph.Scene,
    SceneRenderer = sceneRenderer.SceneRenderer;


var scene = Scene.create(),
    renderer = SceneRenderer.create(scene);

SceneRenderer.addRenderer(SomeRenderer);
SceneRenderer.addPlugin(SomePlugin);

scene.init();
scene.update();

renderer.init();
renderer.render();
```
npm package: @nathanfaucett/scroll_to
Description: easing scroll to function
Author: Nathan Faucett
Latest version: 0.0.4

scroll_to
=======

easing scroll to function

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


var cancel = scrollTo(
      window.scrollX,      // start x
      window.scrollY,      // start y
      div.offsetLeft,      // end y
      div.offsetTop,       // end y
      1000,                // duration
      easing.inOutQuad,    // easing function
      window.scrollTo,     // scroll to function
      function onScrollTo() {
          console.log("DONE");
      }
  );
```
npm package: @nathanfaucett/seq
Description: create iteratable sequences from javascript objects
Author: Nathan Faucett
Latest version: 0.0.5

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

create iteratable sequences from javascript objects

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


// Arrays
var seq = Seq.of([0, 1, 2, 3]),
    iterator = seq.iterator(),
    step;

while (!(step = iterator.next()).done) {
    console.log(step.value);
}

// Objects
var seq = Seq({
        a: 0,
        b: 1,
        c: 2
    }),
    iterator = seq.iterator(),
    step;

while (!(step = iterator.next()).done) {
    console.log(step.value[0], step.value[1]);
}

// Iterators
var array = [0, 1, 2, 3, 4],
    seq = Seq({
        iterator: function() {
            var index = 0,
                length = array.length;

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

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

series
=======

series for the browser and node.js

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

series(
    ["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/shallow_equals
Description: shallow check for equality
Author: Nathan Faucett
Latest version: 0.0.2

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

shallow check for equality

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


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

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

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

shallowEquals({a: 0, b: 1}, {a: 0, b: 1}) === true;
shallowEquals({a: 0, b: 1}, {a: 0, b: 1, c: 2}) === false;
shallowEquals({a: 0, b: 1}, {a: 0})
```
npm package: @nathanfaucett/singularize
Description: singularize words, uses global inflector from inflections @nathanfaucett/inflections
Author: Nathan Faucett
Latest version: 0.0.1

singularize
=======

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

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


var en = inflections("en");

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

singularize("words") === "word";
singularize("skies") === "sky";
singularize("boxes") === "box";
```
npm package: @nathanfaucett/sprite_component
Description: sprite component for scene_graph
Author: Nathan Faucett
Latest version: 0.0.2

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

sprite component for scene_graph
npm package: @nathanfaucett/state
Description: state management for applications
Author: Nathan Faucett
Latest version: 0.3.3

# js-state

state management for applications

## States

a State is the single source of truth for application,
states have stores which are used to update the state.

```javascript
createStore(name: String[, initialState: Object]) -> Store
removeStore(name: String)
```

### Example

```javascript
import State from "@nathanfaucett/state";

const state = new State();
const store = state.createStore("storeName", {
    key: "value"
});

state.on("update", name => {
    console.log("Store " + name + " updated!");
    console.log(state.current());
});

store.setState({
    new_key: "value"
});
```

## Stores

stores are views into your state, they trigger updates with these methods

```javascript
setState(partialState: Object)
updateState(updateFn: Function(prevState: Object) -> Object)
replaceState(nextState: Object)
```

### Example

```javascript
import state from "./state";

const store = state.createStore("storeName", {
    key: "value"
});

console.log(store.state()); // { key: "value", new_key: "value" }

store.replaceState({
    replaced: true
});
console.log(store.state()); // { replaced: true }

store.replaceState({
    replaced: true
});
console.log(store.state()); // { replaced: true }
```

### Example Store

```javascript
import State from "@nathanfaucett/state";

const state = new State();

let ID = 0;

const todos = state.createStore("todos", {
    list: []
});

todos.create = text => {
    const id = ID++;

    todos.updateState(state => {
        const list = state.list.slice();

        list.push({
            id: id,
            text: text
        });

        return {
            list: list
        };
    });
};

todos.remove = id => {
    todos.updateState(state => {
        let list = state.list;

        const index = list.findIndex(todo => todo.id === id);

        if (index !== -1) {
            list = list.slice();
            list.slice(index, 1);
        }

        return {
            list: list
        };
    });
};
```
npm package: @nathanfaucett/state-immutable
Description: immutable state management for applications
Author: Nathan Faucett
Latest version: 0.1.3

# js-state-immutable

immutable state management for applications

## States

a State is the single source of truth for application,
states have stores which are used to update the state.

```javascript
createStore(name: String[, initialState: Object | Immutable.Map]) -> Store
removeStore(name: String)
```

### Example

```javascript
import State from "@nathanfaucett/state-immutable";

const state = new State();
const store = state.createStore("storeName", {
    key: "value"
});

state.on("update", name => {
    console.log("Store " + name + " updated!");
    console.log(state.current());
});

store.setState({
    new_key: "value"
});
```

## Stores

stores are views into your state, they trigger updates with these methods

```javascript
setState(partialState: Object | Immutable.Map)
updateState(updateFn: Function(prevState: Object | Immutable.Map) -> Immutable.Map)
replaceState(nextState: Object | Immutable.Map)
```

### Example

```javascript
import { Map, fromJS } from "immutable";
import state from "./state";

const store = state.createStore("storeName", {
    key: "value"
});

console.log(store.current()); // Map { key: "value", new_key: "value" }

store.replaceState({
    replaced: true
});
console.log(store.current()); // Map { replaced: true }

store.replaceState({
    replaced: true
});
console.log(store.current()); // Map { replaced: true }
```

### Example Store

```javascript
import { Map, List } from "immutable";
import State from "@nathanfaucett/state-immutable";

const state = new State();

let ID = 0;

const todos = state.createStore("todos", {
    list: List()
});

todos.create = text => {
    const id = ID++;

    todos.updateState(state =>
        state.update("list", list =>
            list.push(Map({
                id: id,
                text: text
            }))
        );
    );
};

todos.remove = id => {
    todos.updateState(prev => {
        return prev.update("list", list =>
            list.remove(list.findIndex((todo) => todo.get("id") === id))
        );
    });
};
```
npm package: @nathanfaucett/state-immutable-react
Description: connect react components with immutable state stores
Author: Nathan Faucett
Latest version: 0.2.1

# js-state-immutable-react

connect react components with immutable state stores

## State Stores

```javascript
import { Map, List } from "immutable";
import state from "./state";

let ID = 0;

const todos = state.createStore("todos", {
    list: List()
});

todos.create = text => {
    let id = ID++;

    todos.updateState(state =>
        state.update("list", list => list.push(Map({ id: id, text: text })))
    );
};

todos.remove = id => {
    todos.updateState(prev => {
        return prev.update("list", list =>
            list.remove(list.findIndex(todo => todo.get("id") === id))
        );
    });
};

export default todos;
```

## Components

```javascript
import React from "react";
import connect from "@nathanfaucett/state-immutable-react";
import state from "./state";
import todos from "./stores/todos";

// create store for form input
let todoListForm = state.createStore("todoListForm", { text: "" });

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

        this.onSubmit = e => {
            e.preventDefault();
            todos.create(this.props.todoListForm.text);
            todoListForm.setState({ text: "" });
        };

        this.onChange = e => {
            todoListForm.setState({ text: e.target.value });
        };
    }
    render() {
        return (
            <div class="TodoList">
                <form onSubmit={this.onSubmit}>
                    <input
                        value={this.props.todoListForm.text}
                        onChange={this.onChange}
                    />
                </form>
                {this.props.todos.list.map(todo => (
                    <p key={todo.id}>{todo.text}</p>
                ))}
            </div>
        );
    }
}

// update TodoList when todos or todoListForm emit an update
// on update adds todos state and todoListForm state to props
export default connect([todos, todoListForm], {
    mapping: (nextState, nextProps, props) => {
        // called on render should extract values from nextState to pass to component props
    },
    shouldUpdate: (prevState, nextState) => {
        // called on update, if returns false cancels update
    }
})(TodoList);
```
npm package: @nathanfaucett/state-react
Description: connect react components with state stores
Author: Nathan Faucett
Latest version: 0.3.2

# js-state-react

connect react components with state stores

## State Stores

```javascript
import State from "@nathanfaucett/state";

const state = new State();

let ID = 0;

const todos = state.createStore("todos", {
    list: []
});

todos.create = text => {
    const id = ID++;

    todos.updateState(state => {
        const list = state.list.slice();

        list.push({
            id: id,
            text: text
        });

        return {
            list: list
        };
    });
};

todos.remove = id => {
    todos.updateState(state => {
        const index = list.findIndex(todo => todo.id === id);

        let list = state.list;

        if (index !== -1) {
            list = list.slice();
            list.slice(index, 1);
        }

        return {
            list: list
        };
    });
};
```

## Components

```javascript
import React from "react";
import connect from "@nathanfaucett/state-react";
import state from "./state";
import todos from "./stores/todos";

// create store for form input
let todoListForm = state.createStore("todoListForm", { text: "" });

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

        this.onSubmit = e => {
            e.preventDefault();
            todos.create(this.props.todoListForm.text);
            todoListForm.setState({ text: "" });
        };

        this.onChange = e => {
            todoListForm.setState({ text: e.target.value });
        };
    }
    render() {
        return (
            <div class="TodoList">
                <form onSubmit={this.onSubmit}>
                    <input
                        value={this.props.todoListForm.text}
                        onChange={this.onChange}
                    />
                </form>
                {this.props.todos.list.map(todo => (
                    <p key={todo.id}>{todo.text}</p>
                ))}
            </div>
        );
    }
}

// update TodoList when todos or todoListForm emit an update
// on update adds todos state and todoListForm state to props
export default connect([todos, todoListForm], {
    mapping: (nextState, nextProps, props) => {
        // called on render should extract values from nextState to pass to component props
    },
    shouldUpdate: (prevState, nextState) => {
        // called on update, if returns false cancels update
    }
})(TodoList);
```
npm package: @nathanfaucett/store
Description: redux like store
Author: Nathan Faucett
Latest version: 0.0.3

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

redux like lib

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


var count = 0,
    store = createStore();

store.subscribe(function onDispatch(state, action) {
    console.log(state, action);
});

store.addMiddleware(function counterMiddleware(store, action, next) {
    switch (action.type) {
        case "INC":
            store.dispatch({
                type: "INC_DONE",
                count: ++count
            });
            break;
        case "DEC":
            store.dispatch({
                type: "DEC_DONE",
                count: --count
            });
            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;
    }
});

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

store.dispatch({
    type: "INC"
});
store.dispatch({
    type: "INC"
});
store.dispatch({
    type: "DEC"
});
store.dispatch({
    type: "DEC"
});
```
npm package: @nathanfaucett/tableize
Description: tableize strings
Author: Nathan Faucett
Latest version: 0.0.1

tableize
=======

tableize strings

```javascript
var tableize = require("@nathanfaucett/tableize"),
    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");

tableize("Box") === "boxes";
tableize("Sky") === "skies";
tableize("BikeRider", false) === "bike_riders";
tableize("MegaBigSale") === "megaBigSales";
```
npm package: @nathanfaucett/task
Description: task scheduler
Author: Nathan Faucett
Latest version: 0.0.10

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

task scheduler


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


task("series", task.series(
    function someSeriesTask0() {},
    function someSeriesTask1() {}
));
task("parallel", task.parallel(
    function someParallelTask0() {},
    function someParallelTask1() {}
));
task("complex", "this task is complex", task.parallel(
    function someSimpleTask() {},
    task("series"),
    task("parallel")
));

task.run("complex", function onComplex(error) {
    if (error) {
        // handler error
    } else {
        // ran all tasks
    }
});
```
npm package: @nathanfaucett/template
Description: template creator for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

Template
=======

template creator for the browser and node.js

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


var templateFn = template("<p><%= text %></p>");


templateFn({
    text: "Hello World!"
}) === "<p>Hello World!</p>");
```
npm package: @nathanfaucett/transform_components
Description: Class for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

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

transform 2d and 3d components for scene_graph
npm package: @nathanfaucett/url
Description: url parsing and objects for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.3

url
=======

url parsing and objects for the browser and node.js

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


var fullUrl = url.parse(
    "http://some_domain.com/path/name?query=string", // url
    true, // parse query string
    false // slashes denote host
);
```
npm package: @nathanfaucett/utf8_encoding
Description: utf8 encoding/decoding for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.1

utf8 encoding
=======

utf8 encoding/decoding for the browser and node.js

```javascript
var utf8 = require("utf8_encoding");


utf8.stringToBytes("this is a test") === [116, 104, 105, 115, 32, 105, 115, 32, 97, 32, 116, 101, 115, 116];
utf8.bytesToString([116, 104, 105, 115, 32, 105, 115, 32, 97, 32, 116, 101, 115, 116]) === "this is a test";
```
npm package: @nathanfaucett/uuid
Description: uuid for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

uuid
=======

uuid for the browser and node.js

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


var v1_uuid = uuid(uuid.V1, {
    node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
    clockseq: 0x1234,
    msecs: new Date("1970-0-01").getTime(),
    nsecs: 0
});

var v3_uuid = uuid(uuid.V3, "nathanfaucett@gmail.com");

var v4_uuid = uuid(uuid.V4, {
    random: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
});

var v5_uuid = uuid(uuid.V5, "nathanfaucett@gmail.com");

var bytes = uuid.parse(uuid(uuid.V5, "nathanfaucett@gmail.com"));
```
npm package: @nathanfaucett/virt
Description: A tool for creating interactive UIs
Author: Nathan Faucett
Latest version: 0.0.13

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

A tool for creating interactive UIs. Use views for each state in your application, and virt will find the differences and create a JSON object of the changes.

use of a renderer for the JSON is nesseecary the only one aviable right now is [virt-dom](https://github.com/nathanfaucett/virt-dom)


###Components
```javascript
var virt = require("virt");

/*
    Components are used in Views like type strings
    virt.createView(SomeComponent, { ... props }, ... children)
*/
function SomeComponent(props, children, context) {
    virt.Component.call(this, props, children, context);
}
// SomeComponent.prototype = Object.create(virt.Component.prototype);
// SomeComponent.prototype.displayName = "List";
virt.Component.extend(SomeComponent, "SomeComponent");

// Called after first render and mounted
SomeComponent.prototype.componentDidMount = function() {};

// Called after first updated
SomeComponent.prototype.componentDidUpdate = function(
    previousProps, previousChildren, previousState, previousContext
) {};

// Called before component rendered and mounted
SomeComponent.prototype.componentWillMount = function() {};

// Called before component will be removed
SomeComponent.prototype.componentWillUnmount = function() {};

// Called before component will receive properties
SomeComponent.prototype.componentWillReceiveProps = function(
    nextProps, nextChildren, nextContext
) {};

// Called before component is going to update
SomeComponent.prototype.componentWillUpdate = function(
    nextProps, nextChildren, nextState, nextContext
) {};

// Called before component is updated and can return false to not re-render
SomeComponent.prototype.shouldComponentUpdate = function(
    nextProps, nextChildren, nextState, nextContext
) {};

SomeComponent.prototype.render = function() {
    return virt.createView("div", { ... props }, ... children);
};
```
npm package: @nathanfaucett/virt-css_transition_group
Description: Virt CSSTransitionGroup for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.1

Virt CSSTransitionGroup
=======

Virt CSSTransitionGroup for the browser and node.js


```javascript
var CSSTransitionGroup = require("@nathanfaucett/virt-css_transition_group");;


// require this in DOM thread
require("virt-css_transition_group/src/handlers");


virt.createView(CSSTransitionGroup, {
        component: "ul"
    },
    children...
);


```
npm package: @nathanfaucett/virt-gravatar
Description: Gravatars for virt
Author: Nathan Faucett
Latest version: 0.0.8

virt Gravatar
=======

Gravatars for virt

```javascript
var virt = require("@nathanfaucett/virt"),
    Gravatar = require("@nathanfaucett/gravatar");


virt.createView(Gravatar, {
    size: 32,
    rating: "g",
    defaults: "retro",
    email: "nathanfaucett@gmail.com"
});
```
npm package: @nathanfaucett/virt-modal
Description: Modals for virt
Author: Nathan Faucett
Latest version: 0.0.9

virt Modal
=======

Modals for virt

```javascript
var virt = require("@nathanfaucett/virt"),
    virtDOM = require("@nathanfaucett/virt-dom"),
    EventEmitter = require("@nathanfaucett/event_emitter"),
    modal = require("@nathanfaucett/virt-modal");


var dispatcher = new EventEmitter(-1),
    application = {
        dispatcher: dispatcher
    },
    ModalStore = modal.ModalStore;


dispatcher.dispatch = function(action) {
    dispatcher.emitArg("dispatch", action);
};
ModalStore.application = application;

dispatcher.on("dispatch", function(action) {
    ModalStore.handler(action);
});


function renderApp() {
    return (
        virt.createView("div",
            virt.createView("a", {
                style: {
                    cursor: "pointer"
                },
                onClick: function() {
                    dispatcher.dispatch({
                        type: ModalStore.consts.OPEN,
                        name: "modal"
                    });
                }
            }, "Open Modal"),
            virt.createView(modal.Modals, {
                modalContent: {
                    backgroundColor: "#fff"
                },
                modals: {
                    modal: {
                        name: "modal",
                        onClose: function(modal) {
                            dispatcher.dispatch({
                                type: ModalStore.consts.CLOSE,
                                id: modal.id
                            });
                        },
                        render: function(modal) {
                            return (
                                virt.createView("div",
                                    virt.createView("h1", "hello world!"),
                                    virt.createView("a", {
                                        onClick: modal.close
                                    }, "X")
                                )
                            )
                        }
                    }
                }
            })
        )
    );
}


virtDOM.render(renderApp(), document.getElementById("app"));
```
npm package: @nathanfaucett/virt-store
Description: store bindings for virt
Author: Nathan Faucett
Latest version: 0.0.3

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

store bindings for virt

```javascript
var virt = require("@nathanfaucett/virt"),
    propTypes = require("@nathanfaucett/prop_types"),
    virtDOM = require("@nathanfaucett/virt-dom"),
    createStore = require("@nathanfaucett/store"),

    virt = require("@nathanfaucett/virt"),
    virtStore = require("@nathanfaucett/virt-store");


var store = createStore(),
    Component = virt.Component,
    Provider = virtStore.Provider,
    connect = virtStore.connect;


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

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);
}
Component.extend(Counter, "Counter");

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

Counter.prototype.render = function() {
    return (
        virt.createView("div",
            virt.createView("button", {
                onClick: this.props.incCount
            }, "+"),
            virt.createView("button", {
                onClick: this.props.decCount
            }, "-"),
            virt.createView("p", 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);


virtDOM.render(
    virt.createView(Provider, {
        store: store,
        render: function render() {
            return virt.createView(CounterContainer);
        }
    }),
    document.getElementById("app")
);
```
npm package: @nathanfaucett/waterfall
Description: waterfall for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.1

waterfall
=======

waterfall for the browser and node.js

```javascript
var waterfall = require("@nathanfaucett/waterfall"),
    assert = require("@nathanfaucett/assert");


waterfall([
        function(next) {
            next(undefined, "a", "b", "c");
        },
        function(a, b, c, next) {
            assert.equal(a, "a");
            assert.equal(b, "b");
            assert.equal(c, "c");
            next(undefined, a + b, b + c);
        }
    ],
    function(error, ab, bc) {
        if (error) {
            // handle error;
        } else {
            assert.equal(ab, "ab");
            assert.equal(bc, "bc");
        }
    }
);

```
npm package: @nathanfaucett/weak_map_polyfill
Description: WeakMap polyfill
Author: Nathan Faucett
Latest version: 0.0.2

WeakMap
=======

WeakMap polyfill


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


var map = new WeakMap();
var key = {};

map.set(key, "value");
map.get(key); // "value"
````
npm package: @nathanfaucett/web_app-cli
Description: cli for bootstrapping web app projects
Author: Nathan Faucett
Latest version: 0.1.14

# js-web_app-cli

cli for bootstrapping web app projects

### Install

```bash
$ npm i @nathanfaucett/web_app-cli -g
```

### Usage

```bash
// -n is the package.json name, defaults to lowercase and underscored AppName
// -d is the directory name, defaults to -name
// -i installs npm packages
$ web_app new AppName -n app_name -d ./directory_name -i
```
npm package: @nathanfaucett/xmlhttprequest_polyfill
Description: xmlhttprequest polyfill for the browser
Author: Nathan Faucett
Latest version: 0.0.4

xmlhttprequest_polyfill
=======

xmlhttprequest polyfill for the browser

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


var xhr = new XMLHttpRequestPolyfill();


xhr.open("GET", "/test", true);

xhr.setRequestHeader("Content-Type", "application/json");

xhr.getRequestHeader("Content-Type") === "application/json";
xhr.getRequestHeaders() === {
    "Content-Type": "application/json"
};

xhr.addEventListener("readystatechange", function(e) {
    e.type === "readystatechange";
});
xhr.addEventListener("progress", function(e) {
    e.type === "progress";
});
xhr.addEventListener("loadstart", function(e) {
    e.type === "loadstart";
});
xhr.addEventListener("load", function(e) {
    e.type === "load";
});
xhr.addEventListener("loadend", function() {
    xhr.status === 404;
});

xhr.send(null);
```
npm package: @nathanfeitoza/components
Description: This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\ Documentation of [StoryBook](https://storybook.js.org/docs/react/get-started/whats-a-story)
Author: Nathan Feitoza
Latest version: 0.2.4

# Getting Started with Create React App and storybook init

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\
Documentation of [StoryBook](https://storybook.js.org/docs/react/get-started/whats-a-story)

## Available Scripts StoryBook

In the project directory, you can run:

### `npm run storybook`

Runs the app in the development mode.\
Open [http://localhost:6006](http://localhost:6006) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### To publish
npm package: @nathanfriend/fortune-flash-briefings
Description: Small utilities that power the Fortune Cookie and Oddly Specific Fortunes Alexa flash briefings
Author: Nathan Friend
Latest version: 2.0.2

# fortune-flash-briefings

Small utilities that power the [Fortune
Cookie](https://www.amazon.ca/Nathan-Friend-Fortune-Cookie/dp/B07DMYQPTS) and
[Oddly Specific Fortunes](https://www.amazon.com/gp/product/B07DNTS3MP) Alexa
flash briefings.

## Deployment

Regeneration and deployment of these files is handled by a scheduled pipeline in
the [`website-3.0-docker`](https://gitlab.com/nfriend/website-3.0-docker)
project (specifically, the `regenerate jsons` job).

Once deployed, these filed should be available via a GET requests to:

- https://nathanfriend.io/flash-briefings/fortune-cookie.json
- https://nathanfriend.io/flash-briefings/oddly-specific-fortunes.json

## Developing

1. Run `node update-fortune-cookie.js` or `node update-oddly-specific-fortunes.js`