Socket
Socket
Sign inDemoInstall

bufrw

Package Overview
Dependencies
7
Maintainers
6
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bufrw

Buffer Reading and Writing


Version published
Weekly downloads
540K
decreased by-1.9%
Maintainers
6
Install size
302 kB
Created
Weekly downloads
 

Changelog

Source

v1.3.0

  • Addresses a dependency issue with hexer that complicated bundling for use in browser scripts.

Readme

Source

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

FAQs

Last updated on 25 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc