diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-27 17:36:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-27 17:36:13 +0200 |
commit | 5f466137ad6ac596600e3ff53c9b786815398445 (patch) | |
tree | f914c221874f0b16bf3def7ac01d59d1a99a3b0b /node_modules/load-json-file | |
parent | c9f5ac8e763eda19aa0564179300cfff76785435 (diff) | |
download | wallet-core-5f466137ad6ac596600e3ff53c9b786815398445.tar.xz |
node_modules, clean up package.json
Diffstat (limited to 'node_modules/load-json-file')
-rw-r--r-- | node_modules/load-json-file/index.js | 26 | ||||
-rw-r--r-- | node_modules/load-json-file/package.json | 13 | ||||
-rw-r--r-- | node_modules/load-json-file/readme.md | 4 |
3 files changed, 15 insertions, 28 deletions
diff --git a/node_modules/load-json-file/index.js b/node_modules/load-json-file/index.js index 96d4d9f6f..b2767e302 100644 --- a/node_modules/load-json-file/index.js +++ b/node_modules/load-json-file/index.js @@ -1,21 +1,11 @@ 'use strict'; -var path = require('path'); -var fs = require('graceful-fs'); -var stripBom = require('strip-bom'); -var parseJson = require('parse-json'); -var Promise = require('pinkie-promise'); -var pify = require('pify'); +const path = require('path'); +const fs = require('graceful-fs'); +const stripBom = require('strip-bom'); +const parseJson = require('parse-json'); +const pify = require('pify'); -function parse(x, fp) { - return parseJson(stripBom(x), path.relative(process.cwd(), fp)); -} +const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp)); -module.exports = function (fp) { - return pify(fs.readFile, Promise)(fp, 'utf8').then(function (data) { - return parse(data, fp); - }); -}; - -module.exports.sync = function (fp) { - return parse(fs.readFileSync(fp, 'utf8'), fp); -}; +module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp)); +module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp); diff --git a/node_modules/load-json-file/package.json b/node_modules/load-json-file/package.json index b44c8a128..e5809e515 100644 --- a/node_modules/load-json-file/package.json +++ b/node_modules/load-json-file/package.json @@ -1,6 +1,6 @@ { "name": "load-json-file", - "version": "1.1.0", + "version": "2.0.0", "description": "Read and parse a JSON file", "license": "MIT", "repository": "sindresorhus/load-json-file", @@ -10,7 +10,7 @@ "url": "sindresorhus.com" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" }, "scripts": { "test": "xo && ava" @@ -19,8 +19,8 @@ "index.js" ], "keywords": [ - "json", "read", + "json", "parse", "file", "fs", @@ -31,16 +31,13 @@ "graceful-fs": "^4.1.2", "parse-json": "^2.2.0", "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" + "strip-bom": "^3.0.0" }, "devDependencies": { "ava": "*", "xo": "*" }, "xo": { - "ignores": [ - "test.js" - ] + "esnext": true } } diff --git a/node_modules/load-json-file/readme.md b/node_modules/load-json-file/readme.md index fa982b549..3319c266c 100644 --- a/node_modules/load-json-file/readme.md +++ b/node_modules/load-json-file/readme.md @@ -28,7 +28,7 @@ loadJsonFile('foo.json').then(json => { ### loadJsonFile(filepath) -Returns a promise that resolves to the parsed JSON. +Returns a promise for the parsed JSON. ### loadJsonFile.sync(filepath) @@ -42,4 +42,4 @@ Returns the parsed JSON. ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) |