<commit_before># mercury

[![build status][1]][2]
[![NPM version][3]][4]
[![Coverage Status][5]][6]
[![Davis Dependency status][9]][10]

<!-- [![browser support][11]][12] -->

[![Sauce Test Status](https://saucelabs.com/browser-matrix/raynos.svg)](https://saucelabs.com/u/raynos)

A truly modular frontend framework

To understand what I mean by truly modular just [read the source](https://github.com/Raynos/mercury/blob/master/index.js)

## Examples

### Hello world

```js
var mercury = require("mercury")
var h = mercury.h

var clicks = mercury.input()
var clickCount = mercury.value(0)

clicks(function () {
    clickCount.set(clickCount() + 1)
})

function render(clickCount) {
    return h("div.counter", [
        "The state ", h("code", "clickCount"),
        " has value: " + clickCount + ".", h("input.button", {
            type: "button",
            value: "Click me!",
            "ev-click": mercury.event(clicks)
        })
    ])
}

mercury.app(document.body, clickCount, render)
```

### Basic Examples

 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=1156430c25a28cd8cfe1) [count](examples/count.js)
 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=e11f95b67ff92808eed0) [shared-state](examples/shared-state.js)
 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=6f286fc3641dbd199206) [field-reset](examples/field-reset.js)
 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=3752124345d5dbd8cccb) [bmi-counter](examples/bmi-counter.js)
 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=fb9c8a1938ab9d536879) [canvas](examples/canvas.js)

### Intermediate Examples

 - [TodoMVC](examples/todomvc)
 - [markdown editor](examples/markdown)
 - [number-input](examples/number-input)
 - [2048 (wip)](https://github.com/Raynos/mercury/tree/2048-wip/examples/2048)
 - [github issues (wip)](https://github.com/Raynos/mercury/tree/github-issues/examples/github-issues-viewer)
 - [serverside rendering (wip)](https://github.com/Raynos/mercury/tree/server-rendering/examples/server-rendering)
<commit_msg>server rendering is not wip<commit_after># mercury

[![build status][1]][2]
[![NPM version][3]][4]
[![Coverage Status][5]][6]
[![Davis Dependency status][9]][10]

<!-- [![browser support][11]][12] -->

[![Sauce Test Status](https://saucelabs.com/browser-matrix/raynos.svg)](https://saucelabs.com/u/raynos)

A truly modular frontend framework

To understand what I mean by truly modular just [read the source](https://github.com/Raynos/mercury/blob/master/index.js)

## Examples

### Hello world

```js
var mercury = require("mercury")
var h = mercury.h

var clicks = mercury.input()
var clickCount = mercury.value(0)

clicks(function () {
    clickCount.set(clickCount() + 1)
})

function render(clickCount) {
    return h("div.counter", [
        "The state ", h("code", "clickCount"),
        " has value: " + clickCount + ".", h("input.button", {
            type: "button",
            value: "Click me!",
            "ev-click": mercury.event(clicks)
        })
    ])
}

mercury.app(document.body, clickCount, render)
```

### Basic Examples

 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=1156430c25a28cd8cfe1) [count](examples/count.js)
 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=e11f95b67ff92808eed0) [shared-state](examples/shared-state.js)
 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=6f286fc3641dbd199206) [field-reset](examples/field-reset.js)
 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=3752124345d5dbd8cccb) [bmi-counter](examples/bmi-counter.js)
 - [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=fb9c8a1938ab9d536879) [canvas](examples/canvas.js)

### Intermediate Examples

 - [TodoMVC](examples/todomvc)
 - [markdown editor](examples/markdown)
 - [number-input](examples/number-input)
 - [serverside rendering](examples/server-rendering)
 - [2048 (wip)](https://github.com/Raynos/mercury/tree/2048-wip/examples/2048)
 - [github issues (wip)](https://github.com/Raynos/mercury/tree/github-issues/examples/github-issues-viewer)

{'fraction_non_alphanumeric': 0.1932078935291418, 'fraction_numerical': 0.041762276273519965, 'mean_word_length': 4.581306017925736, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 11, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3762176', 'n_tokens_mistral': 1694, 'n_tokens_neox': 1533, 'n_words': 223}