npm-registry-fetch
Advanced tools
Comparing version 3.7.0 to 3.8.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="3.8.0"></a> | ||
# [3.8.0](https://github.com/npm/registry-fetch/compare/v3.7.0...v3.8.0) (2018-08-23) | ||
### Features | ||
* **mapJson:** add support for passing in json stream mapper ([0600986](https://github.com/npm/registry-fetch/commit/0600986)) | ||
<a name="3.7.0"></a> | ||
@@ -7,0 +17,0 @@ # [3.7.0](https://github.com/npm/registry-fetch/compare/v3.6.0...v3.7.0) (2018-08-23) |
@@ -46,2 +46,5 @@ 'use strict' | ||
}, | ||
'map-json': 'mapJson', | ||
'mapJSON': 'mapJson', | ||
'mapJson': {}, | ||
'max-sockets': 'maxsockets', | ||
@@ -48,0 +51,0 @@ 'maxsockets': { |
@@ -117,3 +117,4 @@ 'use strict' | ||
function fetchJSONStream (uri, jsonPath, opts) { | ||
const parser = JSONStream.parse(jsonPath) | ||
opts = config(opts) | ||
const parser = JSONStream.parse(jsonPath, opts.mapJson) | ||
const pt = parser.pipe(new PassThrough({objectMode: true})) | ||
@@ -120,0 +121,0 @@ parser.on('error', err => pt.emit('error', err)) |
{ | ||
"name": "npm-registry-fetch", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"description": "Fetch-based http client for use with npm registry APIs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -339,2 +339,12 @@ # npm-registry-fetch [![npm version](https://img.shields.io/npm/v/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) [![license](https://img.shields.io/npm/l/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) [![Travis](https://img.shields.io/travis/npm/npm-registry-fetch/latest.svg)](https://travis-ci.org/npm/npm-registry-fetch) [![AppVeyor](https://img.shields.io/appveyor/ci/zkat/npm-registry-fetch/latest.svg)](https://ci.appveyor.com/project/npm/npm-registry-fetch) [![Coverage Status](https://coveralls.io/repos/github/npm/npm-registry-fetch/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-registry-fetch?branch=latest) | ||
##### <a name="opts-map-json"></a> `opts.map-json` | ||
* Alias: `mapJson`, `mapJSON` | ||
* Type: Function | ||
* Default: undefined | ||
When using `fetch.json.stream()` (NOT `fetch.json()`), this will be passed down | ||
to [`JSONStream`](https://npm.im/JSONStream) as the second argument to | ||
`JSONStream.parse`, and can be used to transform stream data before output. | ||
##### <a name="opts-maxsockets"></a> `opts.maxsockets` | ||
@@ -341,0 +351,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41701
512
610