bufrw
Buffer Reading and Writing
Last updated 2 years ago by usiarhei .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install bufrw 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.2.1                                ...           alpha (10 years ago)
  • 1.4.0                                ...           latest (2 years ago)

35 Versions

  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           7 years ago
  • 1.2.1                                ...           10 years ago
  • 1.2.0                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.9.27                                ...           10 years ago
  • 0.9.26                                ...           10 years ago
  • 0.9.25                                ...           11 years ago
  • 0.9.24                                ...           11 years ago
  • 0.9.23                                ...           11 years ago
  • 0.9.22                                ...           11 years ago
  • 0.9.21                                ...           11 years ago
  • 0.9.20                                ...           11 years ago
  • 0.9.19                                ...           11 years ago
  • 0.9.18                                ...           11 years ago
  • 0.9.17                                ...           11 years ago
  • 0.9.16                                ...           11 years ago
  • 0.9.15                                ...           11 years ago
  • 0.9.14                                ...           11 years ago
  • 0.9.13                                ...           11 years ago
  • 0.9.12                                ...           11 years ago
  • 0.9.11                                ...           11 years ago
  • 0.9.10                                ...           11 years ago
  • 0.9.9                                ...           11 years ago
  • 0.9.8                                ...           11 years ago
  • 0.9.7                                ...           11 years ago
  • 0.9.6                                ...           11 years ago
  • 0.9.5                                ...           11 years ago
  • 0.9.4                                ...           11 years ago
  • 0.9.3                                ...           11 years ago
  • 0.9.2                                ...           11 years ago
  • 0.9.1                                ...           11 years ago
  • 0.9.0                                ...           11 years ago
Downloads
Today 0
This Week 28
This Month 43
Last Day 3
Last Week 15
Last Month 20
Dependencies (4)
Dev Dependencies (9)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |