buf
A simple utility for converting between Strings and Buffers.
var buf = ; var aBuffer = buf;var aString = bufto;
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
- aliases:
- encoding methods
- All the encodings that native Buffers can handle are methods on
buf
andunbuf
. These are useful if you'll only ever be using 1 encoding, such as:var buf = require('buf').base64; buf(val)
.
- All the encodings that native Buffers can handle are methods on
License
MPLv2.0