# nanochoo

> choo but half the size

Latest version **6.13.0** (published 2018-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install nanochoo
pnpm add nanochoo
yarn add nanochoo
bun add nanochoo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.13.0 |
| Published | 2018-09-07 |
| First published | 2018-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 103.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Maintainers | nanalan |
| Keywords | client, frontend, framework, minimal, composable, tiny |

## Links

- npm: https://www.npmjs.com/package/nanochoo
- Repository: https://github.com/heyitsmeuralex/nanochoo
- Homepage: https://github.com/heyitsmeuralex/nanochoo#readme
- Issues: https://github.com/heyitsmeuralex/nanochoo/issues
- npm.io page: https://npm.io/package/nanochoo

## Dependencies (5)

- [nanobus](https://npm.io/package/nanobus.md) ^4.2.0
- [nanoraf](https://npm.io/package/nanoraf.md) ^3.0.0
- [nanomorph](https://npm.io/package/nanomorph.md) ^5.1.2
- [nanoquery](https://npm.io/package/nanoquery.md) ^1.1.0
- [nanoassert](https://npm.io/package/nanoassert.md) ^1.1.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 6.13.0 (latest) — 2018-09-07
- 6.8.0 — 2018-02-16
- 6.6.3 — 2018-01-12
- 6.6.2 — 2018-01-08

## README

<h1 align="center">nanochoo</h1>

<div align="center">
  ½🚂🚋🚋🚋🚋
</div>
<div align="center">
  <strong><a href='https://github.com/choojs/choo'>choo</a> but half the size</strong>
</div>
<div align="center">
  A <code>2kb</code> framework for creating sturdy frontend applications on a diet
</div>

<br />

<div align="center">
  <sub>Fork of <a href='https://github.com/choojs/choo'>choo</a>. Built with ❤︎ by
  <a href="https://twitter.com/yoshuawuyts">Yoshua Wuyts</a> and
  <a href="https://github.com/heyitsmeuralex/nanochoo/graphs/contributors">
    contributors
  </a>
</div>

#### with npm

```
> npm install nanochoo
```

#### with <script>

```html
<script src='//unpkg.com/nanochoo/dist/bundle.min.js'></script>
```

Major and minor version numbers equate to choo's: `choo@^7.0 == nanochoo@^7.0`. Patch
numbers don't!

## Key differences

* `choo/html` removed - use [nanohtml](https://wzrd.in/standalone/nanohtml@latest) (`npm install nanohtml`) directly
* Removed router:
  * `choo()` no longer takes an `opts` argument
  * `choo.route(location, handler)` replaced by `choo.view(handler)`
  * `pushState`, `popState`, `replaceState`, `navigate` events removed
  * nanorouter, nanohref, scroll-to-anchor, nanolocation no longer dependencies
* document-ready no longer a dependency
* `choo.toString` not exported in the browser

See [choo](https://github.com/choojs/choo) for documentation - just ignore
routing-related things, use `choo.view` over `choo.route`, and you'll be fine.

## Example
```js
var html = require('nanohtml')
var choo = require('nanochoo')

var app = choo()
app.use(countStore)
app.view(mainView) // !!!
app.mount('body')

function mainView (state, emit) {
  return html`
    <body>
      <h1>count is ${state.count}</h1>
      <button onclick=${onclick}>Increment</button>
    </body>
  `

  function onclick () {
    emit('increment', 1)
  }
}

function countStore (state, emitter) {
  state.count = 0
  emitter.on('increment', function (count) {
    state.count += count
    emitter.emit('render')
  })
}
```

## License
[MIT](https://tldrlegal.com/license/mit-license). See [choo](https://github.com/choojs/choo)

---
_Source: https://npm.io/package/nanochoo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
