Socket
Socket
Sign inDemoInstall

json-stream-stringify

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-stream-stringify - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

package.json
{
"name": "json-stream-stringify",
"version": "1.3.0",
"version": "1.3.1",
"description": "JSON.Stringify as a readable stream",

@@ -5,0 +5,0 @@ "repository": {

# JSON Stream Stringify
[![NPM version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Dependency Status][dependency-image]][dependency-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![License][license-image]](LICENSE) [![Gratipay][gratipay-image]][gratipay-url]
[![NPM version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Dependency Status][dependency-image]][dependency-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![License][license-image]](LICENSE)
[![Gratipay][gratipay-image]][gratipay-url]
JSON Stringify as a Readable Stream with rescursive resolving of any Readable stream and Promises.
JSON Stringify as a Readable Stream with rescursive resolving of any readable streams and Promises.
Main Features:
- Promises are rescursively resolved and the result is piped through JSONStreamify
- Streams (ObjectMode) are piped through a transform which pipes the data through JSONStreamify (enabling recursive streams)
- Streams (Non-ObjectMode) is stringified and piped.
- Output is streamed optimally
## Main Features
- Promises are rescursively resolved and the result is piped through JSONStreamStreamify
- Streams (ObjectMode) are piped through a transform which pipes the data through JSONStreamStreamify (enabling recursive resolving)
- Streams (Non-ObjectMode) is stringified and piped
- Output is streamed optimally with as small chunks as possible
- Great memory management with reference release post process (When a key and value has been processed the value is dereferenced)

@@ -21,5 +27,7 @@ - Stream pressure handling

## API
(value[, replacer])
- ``value`` Any type to convert to JSON.
- ``replacer`` Function(key, value) or Array.
### JSONStreamStringify(value[, replacer])
Convert value to JSON string. Returns a readable stream.
- ``value`` Any data to convert to JSON.
- ``replacer`` Optional ``Function(key, value)`` or ``Array``.
As a function the returned value replaces the value associated with the key. [Details](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter)

@@ -79,3 +87,3 @@ As an array all other keys are filtered. [Details](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Example_with_an_array)

## Practical Express + Mongoose Example
## Practical Example with Express + Mongoose
```javascript

@@ -82,0 +90,0 @@ app.get('/api/users', (req, res, next) => JSONStreamify(Users.find().stream()).pipe(res));

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