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/index.js | |
parent | c9f5ac8e763eda19aa0564179300cfff76785435 (diff) | |
download | wallet-core-5f466137ad6ac596600e3ff53c9b786815398445.tar.xz |
node_modules, clean up package.json
Diffstat (limited to 'node_modules/load-json-file/index.js')
-rw-r--r-- | node_modules/load-json-file/index.js | 26 |
1 files changed, 8 insertions, 18 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); |