# hive-parser

> A JSON crawler that parses a JSON tree and responds to content patterns

Latest version **0.0.2** (published 2013-08-23) · BSD license · 0 weekly downloads

## Install

```sh
npm install hive-parser
pnpm add hive-parser
yarn add hive-parser
bun add hive-parser
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2013-08-23 |
| First published | 2013-05-02 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Dave Edelhart |
| Maintainers | bingomanatee |
| Keywords | JSON, node.js, hive |

## Links

- npm: https://www.npmjs.com/package/hive-parser
- Repository: https://github.com/bingomanatee/hive-parser
- Issues: https://github.com/bingomanatee/hive-parser/issues
- npm.io page: https://npm.io/package/hive-parser

## Dependencies (4)

- [q](https://npm.io/package/q.md) ~0.9.3
- [gate](https://npm.io/package/gate.md) ~0.3.0
- [underscore](https://npm.io/package/underscore.md) ~1.4.4
- [hive-component](https://npm.io/package/hive-component.md) ~0.0.1a

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.2 (latest) — 2013-08-23
- 0.0.1a — 2013-05-19
- 0.0.1 — 2013-05-02

## README

# hive-parser

Hive parser is an event driven parser for a JSON object.

the parsers in hive parser are designed to handle the key-value pairs of a single object or array. They apply each
relevant handler in their stack to the key-value pairs therein.

Handlers apply themselves to each node that passes their test() function.

Both the creation of the handlers and parsers and the excution of parse() are callback-centric; they use promises to
return their values, as demonstrated in the unit tests.

## Using hive-parser

Hive-parser uses two components in combination to parse a JSON object:

### Parsers

A parser walks a JSON object and emits each property with the type `property`
as a JSON object in the form:

``` javascript

{
    value: value, // {variant}
    key: key, //{String}
    root: obj, //{Objecct}
    loader: this, //{Parser} sic
    gate: gate //{Gate*}
}

```

* **name** is the property name
* **value** is the value of the property
* **root** is the object under inspection
* **loader** the parser
* **gate** a gate&apos; that lets you spawn callbacks for async actions

### Handlers

Handlers are designed to listen to this emitted data. they have two driving parameters:

* **key** {String || Regex} A test/match for a key
* **respond** {function} a handler for the emitted data described above

## Designing recursive parsers

Parsers do not automatically recurse. To design a recursive parser, you must create new parsers within your handlers.

## Asyncronous handlers

Each emitted data comes with a gate&apos; To executa asynchronous activity (file handling, database entry, call

``` javascript

   var callback = params.gate.latch();
   my_model.save({params.value, callback);


```

--------------
&apos; See https://github.com/nakamura-to/gate

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