1.3.0 • Published 5 years ago

bufrw v1.3.0

Weekly downloads
106,652
License
-
Repository
github
Last release
5 years ago

bufrw

Buffer Reading and Writing

Example

Simple length-prefixed string:

var bufrw = require("bufrw");

var buf = bufrw.toBuffer(bufrw.str1, "hello world");
// <Buffer 0b 68 65 6c 6c 6f 20 77 6f 72 6c 64>
var str = bufrw.fromBuffer(bufrw.str1, buf)
// "hello world"

// TODO more examples

Concept and Motivation

A combinatoric library for synchronous binary buffer reading and writing.

The design is to combine:

  • needed byte length calculation
  • writing into a pre-allocated buffer
  • reading from a buffer

Into a single re-combinable data type, eventually supporting code generation for efficiency.

Any of those three steps may result in an error, so rather than rely on error throw/catching we use an error-able result type.

API Documentation

See docs.jsig

Installation

npm install bufrw

Tests

npm test

NPM scripts

  • npm run add-licence This will add the licence headers.
  • npm run cover This runs the tests with code coverage
  • npm run lint This will run the linter on your code
  • npm test This will run the tests.
  • npm run trace This will run your tests in tracing mode.
  • npm run travis This is run by travis.CI to run your tests
  • npm run view-cover This will show code coverage in a browser

Contributors

  • Joshua T Corbin

MIT Licenced

1.3.0

5 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.9.27

8 years ago

0.9.26

8 years ago

0.9.25

9 years ago

0.9.24

9 years ago

0.9.23

9 years ago

0.9.22

9 years ago

0.9.21

9 years ago

0.9.20

9 years ago

0.9.19

9 years ago

0.9.18

9 years ago

0.9.17

9 years ago

0.9.16

9 years ago

0.9.15

9 years ago

0.9.14

9 years ago

0.9.13

9 years ago

0.9.12

9 years ago

0.9.11

9 years ago

0.9.10

9 years ago

0.9.9

9 years ago

0.9.8

9 years ago

0.9.7

9 years ago

0.9.6

9 years ago

0.9.5

9 years ago

0.9.4

9 years ago

0.9.3

9 years ago

0.9.2

9 years ago

0.9.1

9 years ago

0.9.0

9 years ago