JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 34
  • Score
    100M100P100Q59835F
  • License MIT

Fast and easy to use bencode codec.

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

NPM

build codecov

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.