Socket
Socket
Sign inDemoInstall

bencode

Package Overview
Dependencies
Maintainers
11
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bencode - npm Package Compare versions

Comparing version 2.0.3 to 3.0.0

12

CHANGELOG.md

@@ -0,1 +1,13 @@

# [3.0.0](https://github.com/themasch/node-bencode/compare/v2.0.3...v3.0.0) (2022-11-28)
### Features
* esm ([#131](https://github.com/themasch/node-bencode/issues/131)) ([b111818](https://github.com/themasch/node-bencode/commit/b111818695c8e85e1268fa771fc49c7c6687167f))
### BREAKING CHANGES
* ESM only
## [2.0.3](https://github.com/themasch/node-bencode/compare/v2.0.2...v2.0.3) (2022-05-13)

@@ -2,0 +14,0 @@

2

lib/decode.js

@@ -168,2 +168,2 @@ const INTEGER_START = 0x69 // 'i'

module.exports = decode
export default decode

@@ -1,2 +0,2 @@

const { getType } = require('./util.js')
import { getType } from './util.js'

@@ -134,2 +134,2 @@ /**

module.exports = encode
export default encode

@@ -1,2 +0,2 @@

const { digitCount, getType } = require('./util.js')
import { digitCount, getType } from './util.js'

@@ -69,2 +69,2 @@ function listLength (list) {

module.exports = encodingLength
export default encodingLength

@@ -1,6 +0,4 @@

const bencode = module.exports
bencode.encode = require('./encode.js')
bencode.decode = require('./decode.js')
import encode from './encode.js'
import decode from './decode.js'
import byteLength from './encoding-length.js'
/**

@@ -12,2 +10,3 @@ * Determines the amount of bytes

*/
bencode.byteLength = bencode.encodingLength = require('./encoding-length.js')
const encodingLength = byteLength
export default { encode, decode, byteLength, encodingLength }

@@ -1,4 +0,2 @@

const util = module.exports
util.digitCount = function digitCount (value) {
export function digitCount (value) {
// Add a digit for negative numbers, as the sign will be prefixed

@@ -12,3 +10,3 @@ const sign = value < 0 ? 1 : 0

util.getType = function getType (value) {
export function getType (value) {
if (Buffer.isBuffer(value)) return 'buffer'

@@ -15,0 +13,0 @@ if (ArrayBuffer.isView(value)) return 'arraybufferview'

{
"name": "bencode",
"description": "Bencode de/encoder",
"version": "2.0.3",
"version": "3.0.0",
"bugs": {
"url": "https://github.com/themasch/node-bencode/issues"
},
"type": "module",
"contributors": [

@@ -41,3 +42,8 @@ {

"license": "MIT",
"main": "lib",
"engines": {
"node": ">=12.20.0"
},
"exports": {
"import": "./lib/index.js"
},
"repository": {

@@ -44,0 +50,0 @@ "type": "git",

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