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

big-json

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

big-json - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

10

CHANGES.md

@@ -0,1 +1,11 @@

## 1.1.0
#### Chore
* fix changelog bug with versioning ([aa23d6b](https://github.com/DonutEspresso/big-json/commit/aa23d6b0cc70c4032625bac0bc6b0880cf603f97))
#### New
* add support for multibyte chars (#2) ([ec4bb36](https://github.com/DonutEspresso/big-json/commit/ec4bb3661ecde84c2d214e4b8d24a4f9725d8722))
## 1.0.0

@@ -2,0 +12,0 @@

22

lib/index.js

@@ -9,2 +9,3 @@ 'use strict';

const stringifyStreamFactory = require('json-stream-stringify');
const utf8Stream = require('utf8-stream');

@@ -38,6 +39,16 @@

* @public
* @param {Object} [options] an options object
* @param {Object} [options.multibyte] when true, support multibyte
* @function createParseStream
* @return {Stream}
*/
function createParseStream() {
function createParseStream(options) {
const opts = Object.assign({
multibyte: true
}, options);
assert.optionalObject(opts, 'opts');
assert.optionalBool(opts.multibyte, 'opts.multibyte');
const assembler = new Assembler();

@@ -68,3 +79,10 @@ const parseStream = new JSONParseStream({

source.unpipe(this);
this.transformStream = source.pipe(parseStream);
// pipe the stream, prepend with multibyte if necessary. utf8stream can
// never error, so no need to handle errors here.
if (opts.multibyte === true) {
this.transformStream = source.pipe(utf8Stream()).pipe(parseStream);
} else {
this.transformStream = source.pipe(parseStream);
}
redirected = true;

@@ -71,0 +89,0 @@ });

5

package.json
{
"name": "big-json",
"version": "1.0.0",
"version": "1.1.0",
"main": "lib/index.js",

@@ -40,4 +40,5 @@ "description": "A stream based implementation of JSON.parse and JSON.stringify for big POJOs",

"stream-json": "^0.5.2",
"through2": "^2.0.3"
"through2": "^2.0.3",
"utf8-stream": "0.0.0"
}
}

@@ -87,4 +87,7 @@ # big-json

### createParseStream()
### createParseStream(opts)
* `opts` {Object} an options object
* `opts.multibyte` {Boolean} handle multibyte chars, defaults to true
__Returns__: {Stream} a JSON.parse stream

@@ -91,0 +94,0 @@

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