![NPM](https://nodei.co/npm/bencodec.png)
![codecov](https://codecov.io/gh/IvanSolomakhin/bencodec/branch/master/graph/badge.svg)
Bencodec
Library for decoding and encoding bencoded data.
Compliant with the BitTorrent bencoding specification.
Fast and easy to use.
Written in TypeScript.
Fully tested with 100% code coverage.
Without dependencies.
Installation
npm | yarn |
---|
npm install --save bencodec | yarn add bencodec |
Getting Started
Import library
typescript | javascript |
---|
import bencodec from 'bencodec' | const bencodec = require('bencodec') |
Decode data
const decoded = bencodec.decode('d3:bar4:spam3:fooi42ee');
Encode data
const encoded = bencodec.encode({ bar: 'spam', foo: 42 });
Tests
npm test
License
This project is licensed under the MIT License - see the LICENSE file for details.