# @shinyoshiaki/ebml-builder

> Simple DSL for building EBML byte array (mkv/webm).

Latest version **0.0.1** (published 2021-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @shinyoshiaki/ebml-builder
pnpm add @shinyoshiaki/ebml-builder
yarn add @shinyoshiaki/ebml-builder
bun add @shinyoshiaki/ebml-builder
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-08-24 |
| First published | 2021-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 28.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | ryiwamoto |
| Maintainers | shinyoshiaki |
| Keywords | ebml, mkv, webm |

## Links

- npm: https://www.npmjs.com/package/@shinyoshiaki/ebml-builder
- Repository: https://github.com/ryiwamoto/simple-ebml-builder-js
- npm.io page: https://npm.io/package/@shinyoshiaki/ebml-builder

## Dependencies (1)

- [lodash.memoize](https://npm.io/package/lodash.memoize.md) ^4.1.2

## Recent versions

- 0.0.1 (latest) — 2021-08-24

## README

simple-ebml-builder
====

Simple DSL for building EBML byte array (mkv/webm).

## install
```
npm install simple-ebml-builder
```

## Sample code
```TypeScript
import * as EBML from "simple-ebml-builder";

// EBML element object. The name is EBMLVersion and body is 1. The Size is generated automatically.
EBML.element(EBML.ID.EBMLVersion, EBML.number(1));

// 0x01FFFFFFFFFFFFFF is assigned as the element size for unknownSizeElement.
EBML.unknownSizeElement(EBML.ID.EBMLVersion, EBML.number(1));

// Element can have multiple elements.
EBML.element(EBML.ID.Info, [
    EBML.element(EBML.ID.TimecodeScale, EBML.number(1000000)),
    EBML.element(EBML.ID.MuxingApp, EBML.string("MuxingApp")),
    EBML.element(EBML.ID.WritingApp, EBML.string("WritingApp")),
]);

// Build single Uint8Array from element.
EBML.build(EBML.element(EBML.ID.EBMLVersion, EBML.number(1))); // => Uint8Array.of(0x42, 0x86, 0x81, 0x01)

// dumpBytes is useful for debugging.
console.log(EBML.dumpBytes(EBML.build(EBML.element(EBML.ID.EBMLVersion, EBML.number(1))))); // "0x42, 0x86, 0x81, 0x1"
```

## npm scripts
- __build__ Compile TypeScript to JavaScript file
- __test__ Run test
- __test:watch__ Watch files and run test.
- __benchmark:test__ Run benchmark
- __benchmark:update__ Run benchmark and update baseline.

## Licence
[MIT](./LICENSE)

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