New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

json-patch-stream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-patch-stream

JSON-patch utilities for transforming a stream of JSON documents into a stream of JSON patches and vice versa

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

json-patch-stream

JSON-patch utilities for transforming a stream of JSON documents into a stream of JSON patches and vice versa

build status

Installation

This module is installed via npm:

$ npm install json-patch-stream

Example Usage

var streamify = require('stream-array'),
var stdout = require('stdout');

var jsonPatchStream = require('json-patch-stream');

streamify([{"a": 10}, {"a": 20}])
  .pipe(jsonPatchStream.toPatches())
  .pipe(stdout());

// Ouputs these two json patches
// [ { op: 'add', path: '/a', value: 10 } ]
// [ { op: 'test', path: '/a', value: 10 }, {} op: 'replace', path: '/a', value: 20 } ]

streamify([
  [ { op: 'add', path: '/a', value: 10 } ],
  [ { op: 'test', path: '/a', value: 10 }, {} op: 'replace', path: '/a', value: 20 } ]
])
.pipe(jsonPatchStream.toDocs())
.pipe(stdout());

// Outputs these two docs
// {"a": 10}
// {"a": 20}

Keywords

json-patch stream

FAQs

Package last updated on 01 Jan 2015

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