Package Exports
- bencodec
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 (bencodec) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
bencodec
Bencode codec. Fast, easy to use, without dependencies.
Installation
npm install bencodec --saveUsage
const bencodec = require('bencodec');
// decode example
const decoded = bencodec.decode('d3:bar4:spam3:fooi42ee');
// encode number
const encoded = bencodec.encode(42);
// encode string
const encoded = bencodec.encode('spam');
// encode Array
const encoded = bencodec.encode(['spam', 42]);
// encode Object
const encoded = bencodec.encode({ bar: 'spam', foo: 42 }); Check Wiki for more information.
Tests
npm test