JSPM

buf

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3169
  • Score
    100M100P100Q114279F
  • License MPLv2.0

Auto buffer and unbuffer values.

Package Exports

  • buf

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (buf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

buf

A simple utility for converting between Strings and Buffers.

var buf = require('buf');

var aBuffer = buf.hex(strOrBuf);
var aString = buf.to.hex(strOrBuf);

API

  • buf(stringOrBuffer, encoding): Buffer - Converts value to a Buffer.
  • unbuf(stringOrBuffer, encoding): String - Converts value to a String
    • aliases: buf.unbuf, buf.un, buf.str, buf.to
  • encoding methods
    • All the encodings that native Buffers can handle are methods on buf and unbuf. These are useful if you'll only ever be using 1 encoding, such as: var buf = require('buf').base64; buf(val).

License

MPLv2.0