# microbuffer

> Light implementation of binary buffer with helpers for easy access.

Latest version **1.0.0** (published 2015-04-11) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2015-04-11 |
| First published | 2015-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | vitaly |
| Keywords | buffer |

## Links

- npm: https://www.npmjs.com/package/microbuffer
- Repository: https://github.com/fontello/microbuffer
- Issues: https://github.com/fontello/microbuffer/issues
- npm.io page: https://npm.io/package/microbuffer

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-04-11

## README

microbuffer
===========

[![Build Status](https://img.shields.io/travis/fontello/microbuffer/master.svg?style=flat)](https://travis-ci.org/fontello/microbuffer)
[![NPM version](https://img.shields.io/npm/v/microbuffer.svg?style=flat)](https://www.npmjs.org/package/microbuffer)

> Light implementation of binary buffer with helpers for easy access.

This library was written for fontello's font convertors -
[svg2ttf](https://github.com/fontello/svg2ttf)
[ttf2woff](https://github.com/fontello/ttf2woff)
[ttf2eot](https://github.com/fontello/ttf2eot). Main features are:
- good speed & compact size (no dependencies)
- transparent typed arrays support in browsers
- methods to simplify binary data read/write


API
---

### Constructor

- `new MicroBuffer(microbuffer [, offset, length])` - wrap MicroBuffer
  instanse, sharing the same data.
- `new MicroBuffer(Uint8Array|Array [, offset, length])` - wrap Uint8Array|Array.
- `new MicroBuffer(size)` - create new MicroBuffer of specified size.

### Methods

- `.getUint8(pos)`
- `.getUint16(pos, littleEndian)`
- `.getUint32(pos, littleEndian)`
- `.setUint8(pos, value)`
- `.setUint16(pos, value, littleEndian)`
- `.setUint32(pos, value, littleEndian)`

With position update:

- `.writeUint8(value)`
- `.writeInt8(value)`
- `.writeUint16(value, littleEndian)`
- `.writeInt16(value, littleEndian)`
- `.writeUint32(value, littleEndian)`
- `.writeInt32(value, littleEndian)`
- `.writeUint64(value)`

Other:

- `.seek(pos)`
- `.fill(value)`
- `.writeBytes(Uint8Array|Array)`
- `.toString()`
- `.toArray()`

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