# bin-parser

> General binary file parser

Latest version **1.0.1** (published 2018-06-21) · MIT license · 0 weekly downloads

## Install

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

Provides the command `bin_parser`.

## 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.0.1 |
| Published | 2018-06-21 |
| First published | 2015-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 40.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Jeroen F.J. Laros |
| Maintainers | jfjlaros |
| Keywords | binary, general, parser |

## Links

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

## Dependencies (5)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.3.1
- [argparse](https://npm.io/package/argparse.md) ^1.0.3
- [iconv-lite](https://npm.io/package/iconv-lite.md) ^0.4.13
- [python-struct](https://npm.io/package/python-struct.md) ^1.0.6
- [buffer-extend-split](https://npm.io/package/buffer-extend-split.md) ^0.0.0

## 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.0.1 (latest) — 2018-06-21
- 1.0.0 — 2018-06-15
- 0.0.20 — 2018-06-03
- 0.0.19 — 2018-06-03
- 0.0.18 — 2018-06-03
- 0.0.17 — 2018-06-03
- 0.0.16 — 2018-06-02
- 0.0.15 — 2018-06-02
- 0.0.14 — 2018-04-03
- 0.0.13 — 2017-07-13
- 0.0.12 — 2015-10-26
- 0.0.11 — 2015-10-19
- 0.0.10 — 2015-10-18
- 0.0.9 — 2015-10-18
- 0.0.8 — 2015-10-04
- … 1 more at https://npm.io/package/bin-parser/versions

## README

General binary file parser
==========================

[![image](https://img.shields.io/github/last-commit/jfjlaros/bin-parser.svg)](https://github.com/jfjlaros/bin-parser/graphs/commit-activity)
[![image](https://travis-ci.org/jfjlaros/bin-parser.svg?branch=master)](https://travis-ci.org/jfjlaros/bin-parser)
[![image](https://readthedocs.org/projects/bin-parser/badge/?version=latest)](https://bin-parser.readthedocs.io/en/latest)
[![image](https://img.shields.io/github/release-date/jfjlaros/bin-parser.svg)](https://github.com/jfjlaros/bin-parser/releases)
[![image](https://img.shields.io/github/release/jfjlaros/bin-parser.svg)](https://github.com/jfjlaros/bin-parser/releases)
[![image](https://img.shields.io/pypi/v/bin-parser.svg)](https://pypi.org/project/bin-parser/)
[![image](https://img.shields.io/npm/v/bin-parser.svg)](https://www.npmjs.com/package/bin-parser)
[![image](https://img.shields.io/github/languages/code-size/jfjlaros/bin-parser.svg)](https://github.com/jfjlaros/bin-parser)
[![image](https://img.shields.io/github/languages/count/jfjlaros/bin-parser.svg)](https://github.com/jfjlaros/bin-parser)
[![image](https://img.shields.io/github/languages/top/jfjlaros/bin-parser.svg)](https://github.com/jfjlaros/bin-parser)
[![image](https://img.shields.io/github/license/jfjlaros/bin-parser.svg)](https://raw.githubusercontent.com/jfjlaros/bin-parser/master/LICENSE.md)

------------------------------------------------------------------------

This library provides general binary file parsing by interpreting
documentation of a file structure and data types. By default, it
supports basic data types like big-endian and little-endian integers,
floats and doubles, variable length (delimited) strings, maps and bit
fields (flags) and it can iterate over sub structures. Other data types
are easily added.

The file structure and the types are stored in nested dictionaries. The
structure is separated from the types, this way multiple file formats
using the same types (within one project for example) can be easily
supported without much duplication.

The design of the library is such that all operations can be reversed.
This means that fully functional binary editing is possible using this
implementation; first use the reader to convert a binary file to a
serialised dictionary representation, this representation is easily
edited using a text editor, and then use the writer to convert back to
binary.

This idea is implemented in two languages; Python and JavaScript. All
main development is done in Python. We chose YAML as our preferred
serialised dictionary format, but other serialisation formats (JSON for
example) can be used too.

Please see
[ReadTheDocs](https://bin-parser.readthedocs.io/en/latest/index.html)
for the latest documentation.

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