Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bencodex

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bencodex

bencodex

  • 0.1.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
20
decreased by-56.52%
Maintainers
1
Weekly downloads
 
Created
Source

bencodex

requirements

  • nodejs 11 (or 10 with Array.prototype.flat polyfill)
  • typescript 3.2 (bigint)

install

npm install bencodex

usage

const { encode, decode } = require('bencodex');

console.log(encode({ a: 1, b: 2 }));
// => <Buffer 64 75 31 3a 61 69 31 65 75 31 3a 62 69 32 65 65>

console.log(encode({ a: 1, b: 2 }).toString());
// => du1:ai1eu1:bi2ee

console.log(decode(Buffer.from('du1:ai1eu1:bi2ee')));
// => Map { 'a' => 1n, 'b' => 2n }

Keywords

FAQs

Package last updated on 06 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc