# dissolve-chunks

> A declarative parser generator based on dissolve

Latest version **1.3.0** (published 2016-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install dissolve-chunks
pnpm add dissolve-chunks
yarn add dissolve-chunks
bun add dissolve-chunks
```

## 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 | 1.3.0 |
| Published | 2016-12-20 |
| First published | 2015-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Simen Li |
| Maintainers | simenkid |
| Keywords | dissolve, parse, parser, stream |

## Links

- npm: https://www.npmjs.com/package/dissolve-chunks
- Repository: https://github.com/simenkid/dissolve-chunks
- Issues: https://github.com/simenkid/dissolve-chunks/issues
- npm.io page: https://npm.io/package/dissolve-chunks

## Dependencies (1)

- [dissolve](https://npm.io/package/dissolve.md) 0.3.3

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2016-12-20
- 1.2.1 — 2016-12-20
- 1.2.0 — 2016-08-18
- 1.0.8 — 2016-06-17
- 1.0.7 — 2016-06-17
- 1.0.6 — 2016-06-15
- 1.0.5 — 2016-06-15
- 1.0.4 — 2016-06-15
- 1.0.3 — 2016-06-15
- 1.0.2 — 2016-03-03
- 1.0.1 — 2015-11-05
- 1.0.0 — 2015-10-01
- 0.0.4 — 2015-09-24
- 0.0.3 — 2015-09-24
- 0.0.2 — 2015-09-23
- … 1 more at https://npm.io/package/dissolve-chunks/versions

## README

# Dissolve-chunks
A declarative parser generator based on dissolve.  

[![Travis branch](https://img.shields.io/travis/simenkid/dissolve-chunks/master.svg?maxAge=2592000)](https://travis-ci.org/simenkid/dissolve-chunks)
[![npm](https://img.shields.io/npm/v/dissolve-chunks.svg?maxAge=2592000)](https://www.npmjs.com/package/dissolve-chunks)
[![npm](https://img.shields.io/npm/l/dissolve-chunks.svg?maxAge=2592000)](https://www.npmjs.com/package/dissolve-chunks)

<br />
  
## Documentation  

Please visit the [Wiki](https://github.com/simenkid/dissolve-chunks/wiki).

<br />

## Overview  

With dissolve-chunks (**DChunks**), you can make a parser by defining the parsing rules for each chunk of the binaries. This means that you need not to write your parsing codes from the beginning to the end of the binaries. You can separate the targeting data into smaller chunks, and then define the parsing rules for each of them. After all rules are ready, you can call the chainable method **join()** to sequentially connect all your rules . Finally, just call **compile()** to get your parser.  

Here is an pseudo example:  

```javascript
var chunk1_rules = [ rule1, rule2, rule3 ],
    chunk2_rules = [ rule4, squash([ rule5_1, rule5_2 ]) ],
    chunk3_rule = squash([ rule6, rule7 ]),
    chunk4_rule = rule8,
    chunk5_rule = squash('key_name', [ rule9, rule10 ]);

var parser = DChunks().join(chunk1_rules).join(chunk2_rules)
                     .join(chunk3_rule).join(chunk4_rule)
                     .join(chunk5_rule).compile();

parser.on('parsed', function (result) {
    console.log(result);
});
```
  
<br />

## Features  

* Making your parser in a declarative way.  
* More manageable by cutting the targeting data into smaller chunks and defining the rules for each of them.  
* You can squash some rules into a single rule by using `squash([name,] rules)`. If `name` is specified while squashing, the **DChunks** will automatically put the parsed result under that namespace. It's handy.  
* Making a parser is mostly just about declaring rules. Integrating and compiling the parsing rules is easy.  

<br />

## Installation  

> $ npm install dissolve-chunks --save  
  
<br />

## Usage  

See [Usage](https://github.com/simenkid/dissolve-chunks/wiki#Usage) on the Wiki.  

<br />

## License  

Licensed under [MIT](https://github.com/simenkid/dissolve-chunks/blob/master/LICENSE).

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