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

cbor

Package Overview
Dependencies
Maintainers
3
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbor - npm Package Compare versions

Comparing version 4.3.0 to 5.0.1

5

lib/simple.js

@@ -81,4 +81,5 @@ 'use strict'

* @param {number} val - the CBOR additional info to convert
* @param {boolean=true} has_parent - Does the CBOR item have a parent?
* @param {boolean=false} parent_indefinite - Is the parent element indefinitely encoded?
* @param {boolean} [has_parent=true] - Does the CBOR item have a parent?
* @param {boolean} [parent_indefinite=false] - Is the parent element
* indefinitely encoded?
* @returns {(null|undefined|boolean|Symbol|Simple)} - the decoded value

@@ -85,0 +86,0 @@ */

'use strict'
const fs = require('fs')
const stream = require('stream')
const util = require('util')

@@ -220,44 +218,2 @@ const bignumber = require('bignumber.js').BigNumber

exports.DeHexStream = class DeHexStream extends stream.Readable {
constructor(hex) {
super()
hex = hex.replace(/^0x/, '')
if (hex) {
this.push(Buffer.from(hex, 'hex'))
}
this.push(null)
}
}
exports.HexStream = class HexStream extends stream.Transform {
constructor(options) {
super(options)
}
_transform(fresh, encoding, cb) {
this.push(fresh.toString('hex'))
return cb()
}
}
exports.printError = function printError(er) {
if (er != null) {
return console.error(er)
}
}
exports.streamFiles = function streamFiles(files, streamFunc, cb) {
const f = files.shift()
if (!f) {
return cb()
}
const sf = streamFunc()
sf.on('end', () => exports.streamFiles(files, streamFunc, cb))
sf.on('error', cb)
const s = (f === '-') ?
process.stdin : (f instanceof stream.Stream) ? f : fs.createReadStream(f)
s.on('error', cb)
return s.pipe(sf)
}
exports.guessEncoding = function guessEncoding(input) {

@@ -264,0 +220,0 @@ if (typeof input == 'string') {

17

package.json
{
"name": "cbor",
"version": "4.3.0",
"version": "5.0.1",
"description": "Encode and parse data in the Concise Binary Object Representation (CBOR) data format (RFC7049).",

@@ -12,11 +12,4 @@ "main": "./lib/cbor.js",

"directories": {
"lib": "lib",
"man": "man"
"lib": "lib"
},
"bin": {
"cbor2comment": "./bin/cbor2comment",
"cbor2diag": "./bin/cbor2diag",
"cbor2json": "./bin/cbor2json",
"json2cbor": "./bin/json2cbor"
},
"browser": {

@@ -65,3 +58,3 @@ "fs": false

"@types/node": "^12.7.2",
"ava": "^1.4.1",
"ava": "1.4.1",
"concordance": "^4.0",

@@ -71,5 +64,3 @@ "garbage": "0.0",

"live-server": "*",
"marked-man": "^0.7.0",
"minami": "*",
"mock-stdio": "^1.0.3",
"npm-run-all": "^4.1.5",

@@ -83,4 +74,2 @@ "nyc": "^14.1.1",

"bignumber.js": "^9.0.0",
"commander": "^3.0.0",
"json-text-sequence": "^0.1",
"nofilter": "^1.0.3"

@@ -87,0 +76,0 @@ },

@@ -22,8 +22,3 @@ cbor

From the command line:
```
$ bin/json2cbor package.json > package.cbor
$ bin/cbor2json package.cbor
$ bin/cbor2diag package.cbor
```
For a command-line interface, see [cbor-cli](https://github.com/hildjj/node-cbor/tree/master/cli).

@@ -30,0 +25,0 @@ Example:

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