# esm_reader

> Read data from Fallout 3 ESM files.

Latest version **0.4.0** (published 2016-08-10) · ISC license · 0 weekly downloads

## Install

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

## 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.4.0 |
| Published | 2016-08-10 |
| First published | 2016-08-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Matt McKellar-Spence |
| Maintainers | mattms |
| Keywords | binary, ESM, Fallout, reader, stream |

## Links

- npm: https://www.npmjs.com/package/esm_reader
- Repository: https://github.com/MattMS/ESM_reader
- Homepage: https://github.com/MattMS/ESM_reader#readme
- Issues: https://github.com/MattMS/ESM_reader/issues
- npm.io page: https://npm.io/package/esm_reader

## Dependencies (3)

- [ramda](https://npm.io/package/ramda.md) ^0.21.0
- [bunyan](https://npm.io/package/bunyan.md) ^1.8.1
- [through2](https://npm.io/package/through2.md) ^2.0.1

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2016-08-10
- 0.3.0 — 2016-08-10
- 0.2.0 — 2016-08-10
- 0.1.0 — 2016-08-08

## README

# Read Fallout 3 ESM files

**Please note:** This is a work in progress.
It is only partially implemented and barely tested.
Come back later.

This package parses the `*.esm` data files used by Fallout 3 and exposes the data as Objects via a Node.js Stream.

Another aim of this project is to provide documentation of the file format.


## Usage

Add this as a dependency to your project:

	npm install esm_reader --save


## File structure and parsers

Values are stored in [little endian](https://en.wikipedia.org/wiki/Endianness) format.
This controls the Node Buffer methods to use.

Files always start with a TES4 record.

The rest of the file is divided into groups, described next.

[parser/main.coffee.md](./parser/main.coffee.md) switches to the appropriate parser based on the current state.


### Groups

[read_group_header.coffee.md](./read_group_header.coffee.md) parses the start of each group.

The rest of the group is made up of records, described next.


### Records

[read_record_header.coffee.md](./read_record_header.coffee.md) parses the start of each record.

The rest of the record is made up of fields, described next.


### Fields

[read_field.coffee.md](./read_field.coffee.md) parses field data from a Buffer.

A field contains a 4 byte label and then 2 bytes indicating the size of the field data.
The remaining bytes store the value of the field.

Fields can contain different types of values: text, numbers, bit flags, or lists of those.
The type of the value are not described by the field, but rather determined by the labels of the group+record+field.

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