An open API service indexing awesome lists of open source software.

https://github.com/tkers/bencode

Simple JavaScript library for bencoding
https://github.com/tkers/bencode

Last synced: 4 months ago
JSON representation

Simple JavaScript library for bencoding

Awesome Lists containing this project

README

        

# bencode [![Build Status](https://travis-ci.com/Lapixx/bencode.svg?token=vxmw15dfW4TqsU8zCCkf&branch=master)](https://travis-ci.com/Lapixx/bencode)
A small JavaScript library for encoding and decoding data following the Bencode specification.

## Usage

```js
const { encode, decode } = require('bencode');

encode({ foo: 42, hello: 'World!' });
// => d3:fooi42e5:hello6:World!e

decode('d3:fooi42e5:hello6:World!e');
// => { foo: 42, hello: 'World!' }
```