aboutsummaryrefslogtreecommitdiff
path: root/node_modules/load-json-file
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
commitabd94a7f5a50f43c797a11b53549ae48fff667c3 (patch)
treeab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/load-json-file
parenta0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff)
downloadwallet-core-abd94a7f5a50f43c797a11b53549ae48fff667c3.tar.xz
add node_modules to address #4364
Diffstat (limited to 'node_modules/load-json-file')
-rw-r--r--node_modules/load-json-file/index.js21
-rw-r--r--node_modules/load-json-file/license21
-rw-r--r--node_modules/load-json-file/package.json109
-rw-r--r--node_modules/load-json-file/readme.md45
4 files changed, 196 insertions, 0 deletions
diff --git a/node_modules/load-json-file/index.js b/node_modules/load-json-file/index.js
new file mode 100644
index 000000000..96d4d9f6f
--- /dev/null
+++ b/node_modules/load-json-file/index.js
@@ -0,0 +1,21 @@
+'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');
+
+function parse(x, fp) {
+ return parseJson(stripBom(x), path.relative(process.cwd(), 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);
+};
diff --git a/node_modules/load-json-file/license b/node_modules/load-json-file/license
new file mode 100644
index 000000000..654d0bfe9
--- /dev/null
+++ b/node_modules/load-json-file/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/load-json-file/package.json b/node_modules/load-json-file/package.json
new file mode 100644
index 000000000..50810b371
--- /dev/null
+++ b/node_modules/load-json-file/package.json
@@ -0,0 +1,109 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "load-json-file@^1.0.0",
+ "scope": null,
+ "escapedName": "load-json-file",
+ "name": "load-json-file",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "/home/dold/repos/taler/wallet-webex/node_modules/read-pkg"
+ ]
+ ],
+ "_from": "load-json-file@>=1.0.0 <2.0.0",
+ "_id": "load-json-file@1.1.0",
+ "_inCache": true,
+ "_location": "/load-json-file",
+ "_nodeVersion": "4.2.1",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "_npmVersion": "2.14.7",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "load-json-file@^1.0.0",
+ "scope": null,
+ "escapedName": "load-json-file",
+ "name": "load-json-file",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/read-pkg"
+ ],
+ "_resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
+ "_shasum": "956905708d58b4bab4c2261b04f59f31c99374c0",
+ "_shrinkwrap": null,
+ "_spec": "load-json-file@^1.0.0",
+ "_where": "/home/dold/repos/taler/wallet-webex/node_modules/read-pkg",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/load-json-file/issues"
+ },
+ "dependencies": {
+ "graceful-fs": "^4.1.2",
+ "parse-json": "^2.2.0",
+ "pify": "^2.0.0",
+ "pinkie-promise": "^2.0.0",
+ "strip-bom": "^2.0.0"
+ },
+ "description": "Read and parse a JSON file",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "956905708d58b4bab4c2261b04f59f31c99374c0",
+ "tarball": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "115157a417380d3160da418d4ff25bb33b0051eb",
+ "homepage": "https://github.com/sindresorhus/load-json-file",
+ "keywords": [
+ "json",
+ "read",
+ "parse",
+ "file",
+ "fs",
+ "graceful",
+ "load"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "load-json-file",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/load-json-file.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "1.1.0",
+ "xo": {
+ "ignores": [
+ "test.js"
+ ]
+ }
+}
diff --git a/node_modules/load-json-file/readme.md b/node_modules/load-json-file/readme.md
new file mode 100644
index 000000000..fa982b549
--- /dev/null
+++ b/node_modules/load-json-file/readme.md
@@ -0,0 +1,45 @@
+# load-json-file [![Build Status](https://travis-ci.org/sindresorhus/load-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/load-json-file)
+
+> Read and parse a JSON file
+
+[Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom), uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs), and throws more [helpful JSON errors](https://github.com/sindresorhus/parse-json).
+
+
+## Install
+
+```
+$ npm install --save load-json-file
+```
+
+
+## Usage
+
+```js
+const loadJsonFile = require('load-json-file');
+
+loadJsonFile('foo.json').then(json => {
+ console.log(json);
+ //=> {foo: true}
+});
+```
+
+
+## API
+
+### loadJsonFile(filepath)
+
+Returns a promise that resolves to the parsed JSON.
+
+### loadJsonFile.sync(filepath)
+
+Returns the parsed JSON.
+
+
+## Related
+
+- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)