python-rencode
TypeScript icon, indicating that this package has built-in type declarations

1.4.4 • Public • Published

python-rencode

Arbitrary data encoder/decoder that matches python rencode.

Coverage Status

Usage

npm install python-rencode
const { encode, decode } = require('python-rencode');
 
// Could be basically any data that would convert correctly to JSON
const thing = 1;
 
// Encode some data into a Buffer
const encoded = encode(thing);
 
// Decode a Buffer into some data
const decoded = decode(encoded);

Install as Git Dependency

If you'd rather not use the versions published to npm, you can easily install from github directly with:

npm install cinderblock/python-rencode         # Defaults to master 
npm install cinderblock/python-rencode#branch  # Use a named branch 
npm install cinderblock/python-rencode#v1.4.0  # Use a tagged version 
npm install cinderblock/python-rencode#hash    # Use a hash directly 

Change Log

v1.4.0

v1.4.0 slightly changed the API.

  • undefined has been replaced with null.
  • undefined is no longer allowed as a value and will now throw. This behavior might change in the future. Make an issue to discuss.

v1.3.0

  • Export data type: RencodableData

v1.2.0

  • Add TypeScript Support

v1.1.0

  • Decode UTF8 by default

Package Sidebar

Install

npm i python-rencode

Weekly Downloads

15

Version

1.4.4

License

ISC

Unpacked Size

16 kB

Total Files

4

Last publish

Collaborators

  • cinderblock