From b021e2044ab3f3e724d659d34f4248f400ccb6f1 Mon Sep 17 00:00:00 2001 From: zkochan Date: Sat, 15 Jul 2017 16:39:04 +0300 Subject: [PATCH] docs: add usage example --- README.md | 37 +- example/.gitignore | 1 + example/index.js | 7 + example/node_modules/.modules.yaml | 5 + .../5.0.0/node_modules/detect-indent/index.js | 122 ++ .../5.0.0/node_modules/detect-indent/license | 21 + .../node_modules/detect-indent/package.json | 41 + .../node_modules/detect-indent/readme.md | 111 ++ .../4.1.11/node_modules/graceful-fs/LICENSE | 15 + .../4.1.11/node_modules/graceful-fs/README.md | 133 ++ .../4.1.11/node_modules/graceful-fs/fs.js | 21 + .../node_modules/graceful-fs/graceful-fs.js | 262 +++ .../graceful-fs/legacy-streams.js | 118 ++ .../node_modules/graceful-fs/package.json | 47 + .../node_modules/graceful-fs/polyfills.js | 330 ++++ .../0.1.4/node_modules/imurmurhash/README.md | 122 ++ .../node_modules/imurmurhash/imurmurhash.js | 138 ++ .../imurmurhash/imurmurhash.min.js | 12 + .../node_modules/imurmurhash/package.json | 40 + .../1.1.0/node_modules/is-plain-obj/index.js | 7 + .../1.1.0/node_modules/is-plain-obj/license | 21 + .../node_modules/is-plain-obj/package.json | 36 + .../1.1.0/node_modules/is-plain-obj/readme.md | 35 + .../1.0.0/node_modules/make-dir/index.js | 83 + .../1.0.0/node_modules/make-dir/license | 21 + .../1.0.0/node_modules/make-dir/package.json | 54 + .../1.0.0/node_modules/make-dir/readme.md | 113 ++ .../make-dir/1.0.0/node_modules/pify | 1 + .../pify/2.3.0/node_modules/pify/index.js | 68 + .../pify/2.3.0/node_modules/pify/license | 21 + .../pify/2.3.0/node_modules/pify/package.json | 48 + .../pify/2.3.0/node_modules/pify/readme.md | 119 ++ .../slide/1.1.6/node_modules/slide/LICENSE | 15 + .../slide/1.1.6/node_modules/slide/README.md | 143 ++ .../slide/1.1.6/node_modules/slide/index.js | 1 + .../1.1.6/node_modules/slide/package.json | 20 + .../sort-keys/1.1.2/node_modules/is-plain-obj | 1 + .../1.1.2/node_modules/sort-keys/index.js | 44 + .../1.1.2/node_modules/sort-keys/license | 21 + .../1.1.2/node_modules/sort-keys/package.json | 40 + .../1.1.2/node_modules/sort-keys/readme.md | 60 + .../sort-keys/2.0.0/node_modules/is-plain-obj | 1 + .../2.0.0/node_modules/sort-keys/index.js | 55 + .../2.0.0/node_modules/sort-keys/license | 9 + .../2.0.0/node_modules/sort-keys/package.json | 40 + .../2.0.0/node_modules/sort-keys/readme.md | 60 + .../2.1.0/node_modules/graceful-fs | 1 + .../2.1.0/node_modules/imurmurhash | 1 + .../2.1.0/node_modules/slide | 1 + .../node_modules/write-file-atomic/LICENSE | 6 + .../node_modules/write-file-atomic/README.md | 47 + .../node_modules/write-file-atomic/index.js | 134 ++ .../write-file-atomic/package.json | 38 + .../2.2.0/node_modules/detect-indent | 1 + .../2.2.0/node_modules/graceful-fs | 1 + .../2.2.0/node_modules/make-dir | 1 + .../write-json-file/2.2.0/node_modules/pify | 1 + .../2.2.0/node_modules/sort-keys | 1 + .../2.2.0/node_modules/write-file-atomic | 1 + .../node_modules/write-json-file/index.js | 73 + .../node_modules/write-json-file/license | 9 + .../node_modules/write-json-file/package.json | 48 + .../node_modules/write-json-file/readme.md | 83 + .../write-pkg/3.1.0/node_modules/sort-keys | 1 + .../3.1.0/node_modules/write-json-file | 1 + .../3.1.0/node_modules/write-pkg/index.js | 53 + .../3.1.0/node_modules/write-pkg/license | 9 + .../3.1.0/node_modules/write-pkg/package.json | 41 + .../3.1.0/node_modules/write-pkg/readme.md | 59 + example/node_modules/.shrinkwrap.yaml | 63 + example/node_modules/write-pkg | 1 + example/package.json | 7 + example/shrinkwrap.yaml | 63 + package.json | 21 +- shrinkwrap.yaml | 1627 +++++++++++++++++ src/index.ts | 10 +- 76 files changed, 5110 insertions(+), 13 deletions(-) create mode 100644 example/.gitignore create mode 100644 example/index.js create mode 100644 example/node_modules/.modules.yaml create mode 100644 example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/index.js create mode 100644 example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/license create mode 100644 example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/package.json create mode 100644 example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/readme.md create mode 100644 example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/LICENSE create mode 100644 example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/README.md create mode 100644 example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/fs.js create mode 100644 example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/graceful-fs.js create mode 100644 example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/legacy-streams.js create mode 100644 example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/package.json create mode 100644 example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/polyfills.js create mode 100644 example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/README.md create mode 100644 example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/imurmurhash.js create mode 100644 example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/imurmurhash.min.js create mode 100644 example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/package.json create mode 100644 example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/index.js create mode 100644 example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/license create mode 100644 example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/package.json create mode 100644 example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/readme.md create mode 100644 example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/index.js create mode 100644 example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/license create mode 100644 example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/package.json create mode 100644 example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/readme.md create mode 120000 example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/pify create mode 100644 example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/index.js create mode 100644 example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/license create mode 100644 example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/package.json create mode 100644 example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/readme.md create mode 100644 example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/LICENSE create mode 100644 example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/README.md create mode 100644 example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/index.js create mode 100644 example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/package.json create mode 120000 example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/is-plain-obj create mode 100644 example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/index.js create mode 100644 example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/license create mode 100644 example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/package.json create mode 100644 example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/readme.md create mode 120000 example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj create mode 100644 example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js create mode 100644 example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license create mode 100644 example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json create mode 100644 example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md create mode 120000 example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/graceful-fs create mode 120000 example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/imurmurhash create mode 120000 example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/slide create mode 100644 example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/LICENSE create mode 100644 example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/README.md create mode 100644 example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/index.js create mode 100644 example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/package.json create mode 120000 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/detect-indent create mode 120000 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/graceful-fs create mode 120000 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/make-dir create mode 120000 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/pify create mode 120000 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/sort-keys create mode 120000 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-file-atomic create mode 100644 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/index.js create mode 100644 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/license create mode 100644 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/package.json create mode 100644 example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/readme.md create mode 120000 example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/sort-keys create mode 120000 example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-json-file create mode 100644 example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/index.js create mode 100644 example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/license create mode 100644 example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/package.json create mode 100644 example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/readme.md create mode 100644 example/node_modules/.shrinkwrap.yaml create mode 120000 example/node_modules/write-pkg create mode 100644 example/package.json create mode 100644 example/shrinkwrap.yaml diff --git a/README.md b/README.md index b2b5fa252b..091b552499 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,44 @@ # pnpm-list -[![Status](https://travis-ci.org/pnpm/pnpm-list.svg?branch=master)](https://travis-ci.org/pnpm/pnpm-list "See test builds") +> List installed packages in a symlinked \`node_modules\` -> List installed packages in a symlinked `node_modules` + +[![npm version](https://img.shields.io/npm/v/pnpm-list.svg)](https://www.npmjs.com/package/pnpm-list) [![Build Status](https://img.shields.io/travis/pnpm/pnpm-list/master.svg)](https://travis-ci.org/pnpm/pnpm-list) + + +[![Status](https://travis-ci.org/pnpm/pnpm-list.svg?branch=master)](https://travis-ci.org/pnpm/pnpm-list "See test builds") ## Install Install it via npm. + npm install pnpm-list + +## Usage + + +```js +'use strict' +const pnpmList = require('pnpm-list').default + +pnpmList(__dirname, [], {depth: 2}) + .then(output => { + console.log(output) + //> pnpm-list@0.0.1 /home/zkochan/src/pnpm/pnpm-list/example + // └─┬ write-pkg@3.1.0 + // ├─┬ sort-keys@2.0.0 + // │ └── is-plain-obj@1.1.0 + // └─┬ write-json-file@2.2.0 + // ├── detect-indent@5.0.0 + // ├── graceful-fs@4.1.11 + // ├── make-dir@1.0.0 + // ├── pify@2.3.0 + // ├── sort-keys@1.1.2 + // └── write-file-atomic@2.1.0 + }) ``` -npm install pnpm-list -``` + ## License -[MIT](LICENSE) +[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io/) diff --git a/example/.gitignore b/example/.gitignore new file mode 100644 index 0000000000..cf4bab9ddd --- /dev/null +++ b/example/.gitignore @@ -0,0 +1 @@ +!node_modules diff --git a/example/index.js b/example/index.js new file mode 100644 index 0000000000..e37f95f7c9 --- /dev/null +++ b/example/index.js @@ -0,0 +1,7 @@ +'use strict' +const pnpmList = require('../lib').default + +pnpmList(__dirname, [], {depth: 2}) + .then(output => { + console.log(output) + }) diff --git a/example/node_modules/.modules.yaml b/example/node_modules/.modules.yaml new file mode 100644 index 0000000000..ab2aabc366 --- /dev/null +++ b/example/node_modules/.modules.yaml @@ -0,0 +1,5 @@ +independentLeaves: false +layoutVersion: 1 +packageManager: pnpm@1.4.0 +skipped: [] +store: /home/zkochan/.pnpm-store/2 diff --git a/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/index.js b/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/index.js new file mode 100644 index 0000000000..eda0b1b1aa --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/index.js @@ -0,0 +1,122 @@ +'use strict'; + +// detect either spaces or tabs but not both to properly handle tabs +// for indentation and spaces for alignment +const INDENT_RE = /^(?:( )+|\t+)/; + +function getMostUsed(indents) { + let result = 0; + let maxUsed = 0; + let maxWeight = 0; + + for (const entry of indents) { + // TODO: use destructuring when targeting Node.js 6 + const key = entry[0]; + const val = entry[1]; + + const u = val[0]; + const w = val[1]; + + if (u > maxUsed || (u === maxUsed && w > maxWeight)) { + maxUsed = u; + maxWeight = w; + result = Number(key); + } + } + + return result; +} + +module.exports = str => { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + // used to see if tabs or spaces are the most used + let tabs = 0; + let spaces = 0; + + // remember the size of previous line's indentation + let prev = 0; + + // remember how many indents/unindents as occurred for a given size + // and how much lines follow a given indentation + // + // indents = { + // 3: [1, 0], + // 4: [1, 5], + // 5: [1, 0], + // 12: [1, 0], + // } + const indents = new Map(); + + // pointer to the array of last used indent + let current; + + // whether the last action was an indent (opposed to an unindent) + let isIndent; + + for (const line of str.split(/\n/g)) { + if (!line) { + // ignore empty lines + continue; + } + + let indent; + const matches = line.match(INDENT_RE); + + if (matches) { + indent = matches[0].length; + + if (matches[1]) { + spaces++; + } else { + tabs++; + } + } else { + indent = 0; + } + + const diff = indent - prev; + prev = indent; + + if (diff) { + // an indent or unindent has been detected + + isIndent = diff > 0; + + current = indents.get(isIndent ? diff : -diff); + + if (current) { + current[0]++; + } else { + current = [1, 0]; + indents.set(diff, current); + } + } else if (current) { + // if the last action was an indent, increment the weight + current[1] += Number(isIndent); + } + } + + const amount = getMostUsed(indents); + + let type; + let indent; + if (!amount) { + type = null; + indent = ''; + } else if (spaces >= tabs) { + type = 'space'; + indent = ' '.repeat(amount); + } else { + type = 'tab'; + indent = '\t'.repeat(amount); + } + + return { + amount, + type, + indent + }; +}; diff --git a/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/license b/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/package.json b/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/package.json new file mode 100644 index 0000000000..81c7edf311 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/package.json @@ -0,0 +1,41 @@ +{ + "name": "detect-indent", + "version": "5.0.0", + "description": "Detect the indentation of code", + "license": "MIT", + "repository": "sindresorhus/detect-indent", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "indent", + "indentation", + "detect", + "infer", + "identify", + "code", + "string", + "text", + "source", + "space", + "tab" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "xo": { + "esnext": true + } +} diff --git a/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/readme.md b/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/readme.md new file mode 100644 index 0000000000..3aeb1badf7 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/detect-indent/5.0.0/node_modules/detect-indent/readme.md @@ -0,0 +1,111 @@ +# detect-indent [![Build Status](https://travis-ci.org/sindresorhus/detect-indent.svg?branch=master)](https://travis-ci.org/sindresorhus/detect-indent) + +> Detect the indentation of code + +Pass in a string of any kind of text and get the indentation. + + +## Use cases + +- Persisting the indentation when modifying a file. +- Have new content match the existing indentation. +- Setting the right indentation in your editor. + + +## Install + +``` +$ npm install --save detect-indent +``` + + +## Usage + +Here we modify a JSON file while persisting the indentation: + +```js +const fs = require('fs'); +const detectIndent = require('detect-indent'); + +/* +{ + "ilove": "pizza" +} +*/ +const file = fs.readFileSync('foo.json', 'utf8'); + +// tries to detect the indentation and falls back to a default if it can't +const indent = detectIndent(file).indent || ' '; + +const json = JSON.parse(file); + +json.ilove = 'unicorns'; + +fs.writeFileSync('foo.json', JSON.stringify(json, null, indent)); +/* +{ + "ilove": "unicorns" +} +*/ +``` + + +## API + +Accepts a string and returns an object with stats about the indentation: + +* `amount` {number} - Amount of indentation, for example `2` +* `type` {string|null} - Type of indentation. Possible values are `tab`, `space` or `null` if no indentation is detected +* `indent` {string} - Actual indentation + + +## Algorithm + +The current algorithm looks for the most common difference between two consecutive non-empty lines. + +In the following example, even if the 4-space indentation is used 3 times whereas the 2-space one is used 2 times, it is detected as less used because there were only 2 differences with this value instead of 4 for the 2-space indentation: + +```css +html { + box-sizing: border-box; +} + +body { + background: gray; +} + +p { + line-height: 1.3em; + margin-top: 1em; + text-indent: 2em; +} +``` + +[Source.](https://medium.com/@heatherarthur/detecting-code-indentation-eff3ed0fb56b#3918) + +Furthermore, if there are more than one most used difference, the indentation with the most lines is selected. + +In the following example, the indentation is detected as 4-spaces: + +```css +body { + background: gray; +} + +p { + line-height: 1.3em; + margin-top: 1em; + text-indent: 2em; +} +``` + + +## Related + +- [detect-indent-cli](https://github.com/sindresorhus/detect-indent-cli) - CLI for this module +- [detect-newline](https://github.com/sindresorhus/detect-newline) - Detect the dominant newline character of a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/LICENSE b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000000..9d2c803696 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/README.md b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/README.md new file mode 100644 index 0000000000..5273a50ad6 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/README.md @@ -0,0 +1,133 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/fs.js b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/fs.js new file mode 100644 index 0000000000..8ad4a38396 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/fs.js @@ -0,0 +1,21 @@ +'use strict' + +var fs = require('fs') + +module.exports = clone(fs) + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/graceful-fs.js b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000000..33b30d2e98 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,262 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var queue = [] + +var util = require('util') + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(queue) + require('assert').equal(queue.length, 0) + }) +} + +module.exports = patch(require('./fs.js')) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { + module.exports = patch(fs) +} + +// Always patch fs.close/closeSync, because we want to +// retry() whenever a close happens *anywhere* in the program. +// This is essential when multiple graceful-fs instances are +// in play at the same time. +module.exports.close = +fs.close = (function (fs$close) { return function (fd, cb) { + return fs$close.call(fs, fd, function (err) { + if (!err) + retry() + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) +}})(fs.close) + +module.exports.closeSync = +fs.closeSync = (function (fs$closeSync) { return function (fd) { + // Note that graceful-fs also retries when fs.closeSync() fails. + // Looks like a bug to me, although it's probably a harmless one. + var rval = fs$closeSync.apply(fs, arguments) + retry() + return rval +}})(fs.closeSync) + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + fs.FileReadStream = ReadStream; // Legacy name. + fs.FileWriteStream = WriteStream; // Legacy name. + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + var args = [path] + if (typeof options !== 'function') { + args.push(options) + } else { + cb = options + } + args.push(go$readdir$cb) + + return go$readdir(args) + + function go$readdir$cb (err, files) { + if (files && files.sort) + files.sort() + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [args]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + } + } + + function go$readdir (args) { + return fs$readdir.apply(fs, args) + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + + var fs$WriteStream = fs.WriteStream + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + + fs.ReadStream = ReadStream + fs.WriteStream = WriteStream + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + queue.push(elem) +} + +function retry () { + var elem = queue.shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} diff --git a/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/legacy-streams.js b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000000..d617b50fc0 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/package.json b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/package.json new file mode 100644 index 0000000000..cde9d0dd86 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/package.json @@ -0,0 +1,47 @@ +{ + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "4.1.11", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-graceful-fs" + }, + "main": "graceful-fs.js", + "engines": { + "node": ">=0.4.0" + }, + "directories": { + "test": "test" + }, + "scripts": { + "test": "node test.js | tap -" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^5.4.2" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js" + ] +} diff --git a/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/polyfills.js b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000000..4c6aca78a3 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/graceful-fs/4.1.11/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,330 @@ +var fs = require('./fs.js') +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + }})(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) +} + +function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } +} + +function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } +} + +function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + +function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, cb) { + return orig.call(fs, target, function (er, stats) { + if (!stats) return cb.apply(this, arguments) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + if (cb) cb.apply(this, arguments) + }) + } +} + +function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target) { + var stats = orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } +} + +// ENOSYS means that the fs doesn't support the op. Just ignore +// that, because it doesn't matter. +// +// if there's no getuid, or if getuid() is something other +// than 0, and the error is EINVAL or EPERM, then just ignore +// it. +// +// This specific case is a silent failure in cp, install, tar, +// and most other unix tools that manage permissions. +// +// When running as root, or if other types of errors are +// encountered, then it's strict. +function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false +} diff --git a/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/README.md b/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/README.md new file mode 100644 index 0000000000..f35b20a0ef --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +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/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/imurmurhash.js b/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 0000000000..e63146a2b7 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/imurmurhash.min.js b/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 0000000000..dc0ee88d6b --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/package.json b/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/package.json new file mode 100644 index 0000000000..8a93edb55a --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/imurmurhash/0.1.4/node_modules/imurmurhash/package.json @@ -0,0 +1,40 @@ +{ + "name": "imurmurhash", + "version": "0.1.4", + "description": "An incremental implementation of MurmurHash3", + "homepage": "https://github.com/jensyt/imurmurhash-js", + "main": "imurmurhash.js", + "files": [ + "imurmurhash.js", + "imurmurhash.min.js", + "package.json", + "README.md" + ], + "repository": { + "type": "git", + "url": "https://github.com/jensyt/imurmurhash-js" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "keywords": [ + "murmur", + "murmurhash", + "murmurhash3", + "hash", + "incremental" + ], + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, + "license": "MIT", + "dependencies": { + }, + "devDependencies": { + }, + "engines": { + "node": ">=0.8.19" + } +} diff --git a/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/index.js b/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/index.js new file mode 100644 index 0000000000..0d1ba9eeb8 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/index.js @@ -0,0 +1,7 @@ +'use strict'; +var toString = Object.prototype.toString; + +module.exports = function (x) { + var prototype; + return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); +}; diff --git a/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/license b/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/package.json b/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/package.json new file mode 100644 index 0000000000..d331f6e816 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/package.json @@ -0,0 +1,36 @@ +{ + "name": "is-plain-obj", + "version": "1.1.0", + "description": "Check if a value is a plain object", + "license": "MIT", + "repository": "sindresorhus/is-plain-obj", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "obj", + "object", + "is", + "check", + "test", + "type", + "plain", + "vanilla", + "pure", + "simple" + ], + "devDependencies": { + "ava": "0.0.4" + } +} diff --git a/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/readme.md b/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/readme.md new file mode 100644 index 0000000000..269e56aeff --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/is-plain-obj/1.1.0/node_modules/is-plain-obj/readme.md @@ -0,0 +1,35 @@ +# is-plain-obj [![Build Status](https://travis-ci.org/sindresorhus/is-plain-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-plain-obj) + +> Check if a value is a plain object + +An object is plain if it's created by either `{}`, `new Object()` or `Object.create(null)`. + + +## Install + +``` +$ npm install --save is-plain-obj +``` + + +## Usage + +```js +var isPlainObj = require('is-plain-obj'); + +isPlainObj({foo: 'bar'}); +//=> true + +isPlainObj([1, 2, 3]); +//=> false +``` + + +## Related + +- [is-obj](https://github.com/sindresorhus/is-obj) - Check if a value is an object + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/index.js b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/index.js new file mode 100644 index 0000000000..ca1f5e9c6a --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/index.js @@ -0,0 +1,83 @@ +'use strict'; +const fs = require('fs'); +const path = require('path'); +const pify = require('pify'); + +const defaults = { + mode: 0o777 & (~process.umask()), + fs +}; + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const checkPath = pth => { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); + + if (pathHasInvalidWinCharacters) { + const err = new Error(`Path contains invalid characters: ${pth}`); + err.code = 'EINVAL'; + throw err; + } + } +}; + +module.exports = (input, opts) => Promise.resolve().then(() => { + checkPath(input); + opts = Object.assign({}, defaults, opts); + const fsP = pify(opts.fs); + + const make = pth => { + return fsP.mkdir(pth, opts.mode) + .then(() => pth) + .catch(err => { + if (err.code === 'ENOENT') { + if (err.message.includes('null bytes') || path.dirname(pth) === pth) { + throw err; + } + + return make(path.dirname(pth)).then(() => make(pth)); + } + + return fsP.stat(pth) + .then(stats => stats.isDirectory() ? pth : Promise.reject()) + .catch(() => { + throw err; + }); + }); + }; + + return make(path.resolve(input)); +}); + +module.exports.sync = (input, opts) => { + checkPath(input); + opts = Object.assign({}, defaults, opts); + + const make = pth => { + try { + opts.fs.mkdirSync(pth, opts.mode); + } catch (err) { + if (err.code === 'ENOENT') { + if (err.message.includes('null bytes') || path.dirname(pth) === pth) { + throw err; + } + + make(path.dirname(pth)); + return make(pth); + } + + try { + if (!opts.fs.statSync(pth).isDirectory()) { + throw new Error(); + } + } catch (_) { + throw err; + } + } + + return pth; + }; + + return make(path.resolve(input)); +}; diff --git a/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/license b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/package.json b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/package.json new file mode 100644 index 0000000000..83a1def18c --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/package.json @@ -0,0 +1,54 @@ +{ + "name": "make-dir", + "version": "1.0.0", + "description": "Make a directory and its parents if needed - Think `mkdir -p`", + "license": "MIT", + "repository": "sindresorhus/make-dir", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "mkdir", + "mkdirp", + "make", + "directories", + "dir", + "dirs", + "folders", + "directory", + "folder", + "path", + "parent", + "parents", + "intermediate", + "recursively", + "recursive", + "create", + "fs", + "filesystem", + "file-system" + ], + "dependencies": { + "pify": "^2.3.0" + }, + "devDependencies": { + "ava": "*", + "coveralls": "^2.13.0", + "graceful-fs": "^4.1.11", + "nyc": "^10.2.0", + "path-type": "^2.0.0", + "tempy": "^0.1.0", + "xo": "*" + } +} diff --git a/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/readme.md b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/readme.md new file mode 100644 index 0000000000..23cf232521 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/make-dir/readme.md @@ -0,0 +1,113 @@ +# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/make-dir/badge.svg)](https://coveralls.io/github/sindresorhus/make-dir) + +> Make a directory and its parents if needed - Think `mkdir -p` + + +## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) + +- Promise API *(Async/await ready!)* +- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66) +- 100% test coverage +- CI-tested on macOS, Linux, and Windows +- Actively maintained +- Doesn't bundle a CLI + + +## Install + +``` +$ npm install --save make-dir +``` + + +## Usage + +``` +$ pwd +/Users/sindresorhus/fun +$ tree +. +``` + +```js +const makeDir = require('make-dir'); + +makeDir('unicorn/rainbow/cake').then(path => { + console.log(path); + //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' +}); +``` + +``` +$ tree +. +└── unicorn + └── rainbow + └── cake +``` + +Multiple directories: + +```js +const makeDir = require('make-dir'); + +Promise.all([ + makeDir('unicorn/rainbow') + makeDir('foo/bar') +]).then(paths => { + console.log(paths); + /* + [ + '/Users/sindresorhus/fun/unicorn/rainbow', + '/Users/sindresorhus/fun/foo/bar' + ] + */ +}); +``` + + +## API + +### makeDir(path, [options]) + +Returns a `Promise` for the path to the created directory. + +### makeDir.sync(path, [options]) + +Returns the path to the created directory. + +#### path + +Type: `string` + +Directory to create. + +#### options + +Type: `Object` + +##### mode + +Type: `integer`
+Default: `0o777 & (~process.umask())` + +Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). + +##### fs + +Type: `Object`
+Default: `require('fs')` + +Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). + + +## Related + +- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module +- [del](https://github.com/sindresorhus/del) - Delete files and directories +- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/pify b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/pify new file mode 120000 index 0000000000..39b64b43bb --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/make-dir/1.0.0/node_modules/pify @@ -0,0 +1 @@ +../../../pify/2.3.0/node_modules/pify \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/index.js b/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/index.js new file mode 100644 index 0000000000..7c720ebee8 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var processFn = function (fn, P, opts) { + return function () { + var that = this; + var args = new Array(arguments.length); + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P(function (resolve, reject) { + args.push(function (err, result) { + if (err) { + reject(err); + } else if (opts.multiArgs) { + var results = new Array(arguments.length - 1); + + for (var i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + + fn.apply(that, args); + }); + }; +}; + +var pify = module.exports = function (obj, P, opts) { + if (typeof P !== 'function') { + opts = P; + P = Promise; + } + + opts = opts || {}; + opts.exclude = opts.exclude || [/.+Sync$/]; + + var filter = function (key) { + var match = function (pattern) { + return typeof pattern === 'string' ? key === pattern : pattern.test(key); + }; + + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + var ret = typeof obj === 'function' ? function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, P, opts).apply(this, arguments); + } : {}; + + return Object.keys(obj).reduce(function (ret, key) { + var x = obj[key]; + + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + + return ret; + }, ret); +}; + +pify.all = pify; diff --git a/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/license b/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/package.json b/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/package.json new file mode 100644 index 0000000000..311d1982e0 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/package.json @@ -0,0 +1,48 @@ +{ + "name": "pify", + "version": "2.3.0", + "description": "Promisify a callback-style function", + "license": "MIT", + "repository": "sindresorhus/pify", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava && npm run optimization-test", + "optimization-test": "node --allow-natives-syntax optimization-test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "promise", + "promises", + "promisify", + "denodify", + "denodeify", + "callback", + "cb", + "node", + "then", + "thenify", + "convert", + "transform", + "wrap", + "wrapper", + "bind", + "to", + "async", + "es2015" + ], + "devDependencies": { + "ava": "*", + "pinkie-promise": "^1.0.0", + "v8-natives": "0.0.2", + "xo": "*" + } +} diff --git a/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/readme.md b/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/readme.md new file mode 100644 index 0000000000..c79ca8bf64 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/pify/2.3.0/node_modules/pify/readme.md @@ -0,0 +1,119 @@ +# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) + +> Promisify a callback-style function + + +## Install + +``` +$ npm install --save pify +``` + + +## Usage + +```js +const fs = require('fs'); +const pify = require('pify'); + +// promisify a single function + +pify(fs.readFile)('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); + +// or promisify all methods in a module + +pify(fs).readFile('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); +``` + + +## API + +### pify(input, [promiseModule], [options]) + +Returns a promise wrapped version of the supplied function or module. + +#### input + +Type: `function`, `object` + +Callback-style function or module whose methods you want to promisify. + +#### promiseModule + +Type: `function` + +Custom promise module to use instead of the native one. + +Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. + +#### options + +##### multiArgs + +Type: `boolean` +Default: `false` + +By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. + +```js +const request = require('request'); +const pify = require('pify'); + +pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { + const [httpResponse, body] = result; +}); +``` + +##### include + +Type: `array` of (`string`|`regex`) + +Methods in a module to promisify. Remaining methods will be left untouched. + +##### exclude + +Type: `array` of (`string`|`regex`) +Default: `[/.+Sync$/]` + +Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. + +##### excludeMain + +Type: `boolean` +Default: `false` + +By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module. + +```js +const pify = require('pify'); + +function fn() { + return true; +} + +fn.method = (data, callback) => { + setImmediate(() => { + callback(data, null); + }); +}; + +// promisify methods but not fn() +const promiseFn = pify(fn, {excludeMain: true}); + +if (promiseFn()) { + promiseFn.method('hi').then(data => { + console.log(data); + }); +} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/LICENSE b/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/LICENSE new file mode 100644 index 0000000000..05eeeb88c2 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/README.md b/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/README.md new file mode 100644 index 0000000000..59ad738bca --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/README.md @@ -0,0 +1,143 @@ +# Controlling Flow: callbacks are easy + +## What's actually hard? + +- Doing a bunch of things in a specific order. +- Knowing when stuff is done. +- Handling failures. +- Breaking up functionality into parts (avoid nested inline callbacks) + + +## Common Mistakes + +- Abandoning convention and consistency. +- Putting all callbacks inline. +- Using libraries without grokking them. +- Trying to make async code look sync. + +## Define Conventions + +- Two kinds of functions: *actors* take action, *callbacks* get results. +- Essentially the continuation pattern. Resulting code *looks* similar + to fibers, but is *much* simpler to implement. +- Node works this way in the lowlevel APIs already, and it's very flexible. + +## Callbacks + +- Simple responders +- Must always be prepared to handle errors, that's why it's the first argument. +- Often inline anonymous, but not always. +- Can trap and call other callbacks with modified data, or pass errors upwards. + +## Actors + +- Last argument is a callback. +- If any error occurs, and can't be handled, pass it to the callback and return. +- Must not throw. Return value ignored. +- return x ==> return cb(null, x) +- throw er ==> return cb(er) + +```javascript +// return true if a path is either +// a symlink or a directory. +function isLinkOrDir (path, cb) { + fs.lstat(path, function (er, s) { + if (er) return cb(er) + return cb(null, s.isDirectory() || s.isSymbolicLink()) + }) +} +``` + +# asyncMap + +## Usecases + +- I have a list of 10 files, and need to read all of them, and then continue when they're all done. +- I have a dozen URLs, and need to fetch them all, and then continue when they're all done. +- I have 4 connected users, and need to send a message to all of them, and then continue when that's done. +- I have a list of n things, and I need to dosomething with all of them, in parallel, and get the results once they're all complete. + + +## Solution + +```javascript +var asyncMap = require("slide").asyncMap +function writeFiles (files, what, cb) { + asyncMap(files, function (f, cb) { + fs.writeFile(f, what, cb) + }, cb) +} +writeFiles([my, file, list], "foo", cb) +``` + +# chain + +## Usecases + +- I have to do a bunch of things, in order. Get db credentials out of a file, + read the data from the db, write that data to another file. +- If anything fails, do not continue. +- I still have to provide an array of functions, which is a lot of boilerplate, + and a pita if your functions take args like + +```javascript +function (cb) { + blah(a, b, c, cb) +} +``` + +- Results are discarded, which is a bit lame. +- No way to branch. + +## Solution + +- reduces boilerplate by converting an array of [fn, args] to an actor + that takes no arguments (except cb) +- A bit like Function#bind, but tailored for our use-case. +- bindActor(obj, "method", a, b, c) +- bindActor(fn, a, b, c) +- bindActor(obj, fn, a, b, c) +- branching, skipping over falsey arguments + +```javascript +chain([ + doThing && [thing, a, b, c] +, isFoo && [doFoo, "foo"] +, subChain && [chain, [one, two]] +], cb) +``` + +- tracking results: results are stored in an optional array passed as argument, + last result is always in results[results.length - 1]. +- treat chain.first and chain.last as placeholders for the first/last + result up until that point. + + +## Non-trivial example + +- Read number files in a directory +- Add the results together +- Ping a web service with the result +- Write the response to a file +- Delete the number files + +```javascript +var chain = require("slide").chain +function myProgram (cb) { + var res = [], last = chain.last, first = chain.first + chain([ + [fs, "readdir", "the-directory"] + , [readFiles, "the-directory", last] + , [sum, last] + , [ping, "POST", "example.com", 80, "/foo", last] + , [fs, "writeFile", "result.txt", last] + , [rmFiles, "./the-directory", first] + ], res, cb) +} +``` + +# Conclusion: Convention Profits + +- Consistent API from top to bottom. +- Sneak in at any point to inject functionality. Testable, reusable, ... +- When ruby and python users whine, you can smile condescendingly. diff --git a/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/index.js b/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/index.js new file mode 100644 index 0000000000..0a9277f6ee --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/index.js @@ -0,0 +1 @@ +module.exports=require("./lib/slide") diff --git a/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/package.json b/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/package.json new file mode 100644 index 0000000000..7799184791 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/slide/1.1.6/node_modules/slide/package.json @@ -0,0 +1,20 @@ +{ + "name": "slide", + "version": "1.1.6", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "contributors": [ + "S. Sriram (http://www.565labs.com)" + ], + "description": "A flow control lib small enough to fit on in a slide presentation. Derived live at Oak.JS", + "main": "./lib/slide.js", + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": "*" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/slide-flow-control.git" + }, + "license": "ISC" +} diff --git a/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/is-plain-obj b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/is-plain-obj new file mode 120000 index 0000000000..72bf97d869 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/is-plain-obj @@ -0,0 +1 @@ +../../../is-plain-obj/1.1.0/node_modules/is-plain-obj \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/index.js b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/index.js new file mode 100644 index 0000000000..f75a0e0535 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/index.js @@ -0,0 +1,44 @@ +'use strict'; +var isPlainObj = require('is-plain-obj'); + +module.exports = function (obj, opts) { + if (!isPlainObj(obj)) { + throw new TypeError('Expected a plain object'); + } + + opts = opts || {}; + + // DEPRECATED + if (typeof opts === 'function') { + opts = {compare: opts}; + } + + var deep = opts.deep; + var seenInput = []; + var seenOutput = []; + + var sortKeys = function (x) { + var seenIndex = seenInput.indexOf(x); + + if (seenIndex !== -1) { + return seenOutput[seenIndex]; + } + + var ret = {}; + var keys = Object.keys(x).sort(opts.compare); + + seenInput.push(x); + seenOutput.push(ret); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var val = x[key]; + + ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; + } + + return ret; + }; + + return sortKeys(obj); +}; diff --git a/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/license b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/package.json b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/package.json new file mode 100644 index 0000000000..dff0653827 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/package.json @@ -0,0 +1,40 @@ +{ + "name": "sort-keys", + "version": "1.1.2", + "description": "Sort the keys of an object", + "license": "MIT", + "repository": "sindresorhus/sort-keys", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "sort", + "object", + "keys", + "obj", + "key", + "stable", + "deterministic", + "deep", + "recursive", + "recursively" + ], + "dependencies": { + "is-plain-obj": "^1.0.0" + }, + "devDependencies": { + "mocha": "*", + "xo": "*" + } +} diff --git a/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/readme.md b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/readme.md new file mode 100644 index 0000000000..a671ffb3de --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/1.1.2/node_modules/sort-keys/readme.md @@ -0,0 +1,60 @@ +# sort-keys [![Build Status](https://travis-ci.org/sindresorhus/sort-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/sort-keys) + +> Sort the keys of an object + +Useful to get a deterministically ordered object, as the order of keys can vary between engines. + + +## Install + +``` +$ npm install --save sort-keys +``` + + +## Usage + +```js +const sortKeys = require('sort-keys'); + +sortKeys({c: 0, a: 0, b: 0}); +//=> {a: 0, b: 0, c: 0} + +sortKeys({b: {b: 0, a: 0}, a: 0}, {deep: true}); +//=> {a: 0, b: {a: 0, b: 0}} + +sortKeys({c: 0, a: 0, b: 0}, { + compare: (a, b) => -a.localeCompare(b) +}); +//=> {c: 0, b: 0, a: 0} +``` + + +## API + +### sortKeys(input, [options]) + +Returns a new object with sorted keys. + +#### input + +Type: `Object` + +#### options + +##### deep + +Type: `boolean` + +Recursively sort keys. + +##### compare + +Type: `Function` + +[Compare function.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj new file mode 120000 index 0000000000..72bf97d869 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/is-plain-obj @@ -0,0 +1 @@ +../../../is-plain-obj/1.1.0/node_modules/is-plain-obj \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js new file mode 100644 index 0000000000..53489d7888 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/index.js @@ -0,0 +1,55 @@ +'use strict'; +const isPlainObj = require('is-plain-obj'); + +module.exports = (obj, opts) => { + if (!isPlainObj(obj)) { + throw new TypeError('Expected a plain object'); + } + + opts = opts || {}; + + // DEPRECATED + if (typeof opts === 'function') { + throw new TypeError('Specify the compare function as an option instead'); + } + + const deep = opts.deep; + const seenInput = []; + const seenOutput = []; + + const sortKeys = x => { + const seenIndex = seenInput.indexOf(x); + + if (seenIndex !== -1) { + return seenOutput[seenIndex]; + } + + const ret = {}; + const keys = Object.keys(x).sort(opts.compare); + + seenInput.push(x); + seenOutput.push(ret); + + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const val = x[key]; + + if (deep && Array.isArray(val)) { + const retArr = []; + + for (let j = 0; j < val.length; j++) { + retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j]; + } + + ret[key] = retArr; + continue; + } + + ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; + } + + return ret; + }; + + return sortKeys(obj); +}; diff --git a/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license new file mode 100644 index 0000000000..e7af2f7710 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json new file mode 100644 index 0000000000..3da9c7659d --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/package.json @@ -0,0 +1,40 @@ +{ + "name": "sort-keys", + "version": "2.0.0", + "description": "Sort the keys of an object", + "license": "MIT", + "repository": "sindresorhus/sort-keys", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "sort", + "object", + "keys", + "obj", + "key", + "stable", + "deterministic", + "deep", + "recursive", + "recursively" + ], + "dependencies": { + "is-plain-obj": "^1.0.0" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md new file mode 100644 index 0000000000..a671ffb3de --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/sort-keys/2.0.0/node_modules/sort-keys/readme.md @@ -0,0 +1,60 @@ +# sort-keys [![Build Status](https://travis-ci.org/sindresorhus/sort-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/sort-keys) + +> Sort the keys of an object + +Useful to get a deterministically ordered object, as the order of keys can vary between engines. + + +## Install + +``` +$ npm install --save sort-keys +``` + + +## Usage + +```js +const sortKeys = require('sort-keys'); + +sortKeys({c: 0, a: 0, b: 0}); +//=> {a: 0, b: 0, c: 0} + +sortKeys({b: {b: 0, a: 0}, a: 0}, {deep: true}); +//=> {a: 0, b: {a: 0, b: 0}} + +sortKeys({c: 0, a: 0, b: 0}, { + compare: (a, b) => -a.localeCompare(b) +}); +//=> {c: 0, b: 0, a: 0} +``` + + +## API + +### sortKeys(input, [options]) + +Returns a new object with sorted keys. + +#### input + +Type: `Object` + +#### options + +##### deep + +Type: `boolean` + +Recursively sort keys. + +##### compare + +Type: `Function` + +[Compare function.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/graceful-fs b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/graceful-fs new file mode 120000 index 0000000000..4db8bdb9f8 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/graceful-fs @@ -0,0 +1 @@ +../../../graceful-fs/4.1.11/node_modules/graceful-fs \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/imurmurhash b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/imurmurhash new file mode 120000 index 0000000000..9bfdc15b1e --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/imurmurhash @@ -0,0 +1 @@ +../../../imurmurhash/0.1.4/node_modules/imurmurhash \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/slide b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/slide new file mode 120000 index 0000000000..e4aacf8846 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/slide @@ -0,0 +1 @@ +../../../slide/1.1.6/node_modules/slide \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/LICENSE b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/LICENSE new file mode 100644 index 0000000000..95e65a7706 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/LICENSE @@ -0,0 +1,6 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/README.md b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/README.md new file mode 100644 index 0000000000..63f00420ca --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/README.md @@ -0,0 +1,47 @@ +write-file-atomic +----------------- + +This is an extension for node's `fs.writeFile` that makes its operation +atomic and allows you set ownership (uid/gid of the file). + +### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], callback) + +* filename **String** +* data **String** | **Buffer** +* options **Object** + * chown **Object** + * uid **Number** + * gid **Number** + * encoding **String** | **Null** default = 'utf8' + * fsync **Boolean** default = true + * mode **Number** default = 438 (aka 0666 in Octal) +callback **Function** + +Atomically and asynchronously writes data to a file, replacing the file if it already +exists. data can be a string or a buffer. + +The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. +If writeFile completes successfully then, if passed the **chown** option it will change +the ownership of the file. Finally it renames the file back to the filename you specified. If +it encounters errors at any of these steps it will attempt to unlink the temporary file and then +pass the error back to the caller. + +If provided, the **chown** option requires both **uid** and **gid** properties or else +you'll get an error. + +The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. + +If the **fsync** option is **false**, writeFile will skip the final fsync call. + +Example: + +```javascript +writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { + if (err) throw err; + console.log('It\'s saved!'); +}); +``` + +### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) + +The synchronous version of **writeFileAtomic**. diff --git a/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/index.js b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/index.js new file mode 100644 index 0000000000..c677ee9622 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/index.js @@ -0,0 +1,134 @@ +'use strict' +module.exports = writeFile +module.exports.sync = writeFileSync +module.exports._getTmpname = getTmpname // for testing + +var fs = require('graceful-fs') +var chain = require('slide').chain +var MurmurHash3 = require('imurmurhash') + +var invocations = 0 +function getTmpname (filename) { + return filename + '.' + + MurmurHash3(__filename) + .hash(String(process.pid)) + .hash(String(++invocations)) + .result() +} + +function writeFile (filename, data, options, callback) { + if (options instanceof Function) { + callback = options + options = null + } + if (!options) options = {} + fs.realpath(filename, function (_, realname) { + _writeFile(realname || filename, data, options, callback) + }) +} +function _writeFile (filename, data, options, callback) { + var tmpfile = getTmpname(filename) + + if (options.mode && options.chown) { + return thenWriteFile() + } else { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + return fs.stat(filename, function (err, stats) { + if (err || !stats) return thenWriteFile() + + options = Object.assign({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + return thenWriteFile() + }) + } + + function thenWriteFile () { + chain([ + [writeFileAsync, tmpfile, data, options.mode, options.encoding || 'utf8'], + options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid], + options.mode && [fs, fs.chmod, tmpfile, options.mode], + [fs, fs.rename, tmpfile, filename] + ], function (err) { + err ? fs.unlink(tmpfile, function () { callback(err) }) + : callback() + }) + } + + // doing this instead of `fs.writeFile` in order to get the ability to + // call `fsync`. + function writeFileAsync (file, data, mode, encoding, cb) { + fs.open(file, 'w', options.mode, function (err, fd) { + if (err) return cb(err) + if (Buffer.isBuffer(data)) { + return fs.write(fd, data, 0, data.length, 0, syncAndClose) + } else if (data != null) { + return fs.write(fd, String(data), 0, String(encoding), syncAndClose) + } else { + return syncAndClose() + } + function syncAndClose (err) { + if (err) return cb(err) + if (options.fsync !== false) { + fs.fsync(fd, function (err) { + if (err) return cb(err) + fs.close(fd, cb) + }) + } else { + fs.close(fd, cb) + } + } + }) + } +} + +function writeFileSync (filename, data, options) { + if (!options) options = {} + try { + filename = fs.realpathSync(filename) + } catch (ex) { + // it's ok, it'll happen on a not yet existing file + } + var tmpfile = getTmpname(filename) + + try { + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + var stats = fs.statSync(filename) + options = Object.assign({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + var fd = fs.openSync(tmpfile, 'w', options.mode) + if (Buffer.isBuffer(data)) { + fs.writeSync(fd, data, 0, data.length, 0) + } else if (data != null) { + fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) + } + if (options.fsync !== false) { + fs.fsyncSync(fd) + } + fs.closeSync(fd) + if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + if (options.mode) fs.chmodSync(tmpfile, options.mode) + fs.renameSync(tmpfile, filename) + } catch (err) { + try { fs.unlinkSync(tmpfile) } catch (e) {} + throw err + } +} diff --git a/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/package.json b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/package.json new file mode 100644 index 0000000000..b43cbe09ff --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-file-atomic/2.1.0/node_modules/write-file-atomic/package.json @@ -0,0 +1,38 @@ +{ + "name": "write-file-atomic", + "version": "2.1.0", + "description": "Write files in an atomic fashion w/configurable ownership", + "main": "index.js", + "scripts": { + "test": "standard && tap --100 test/*.js" + }, + "repository": { + "type": "git", + "url": "git@github.com:iarna/write-file-atomic.git" + }, + "keywords": [ + "writeFile", + "atomic" + ], + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/write-file-atomic/issues" + }, + "homepage": "https://github.com/iarna/write-file-atomic", + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + }, + "devDependencies": { + "mkdirp": "^0.5.1", + "require-inject": "^1.4.0", + "rimraf": "^2.5.4", + "standard": "^10.0.2", + "tap": "^10.3.2" + }, + "files": [ + "index.js" + ] +} diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/detect-indent b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/detect-indent new file mode 120000 index 0000000000..abe8c4d3f2 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/detect-indent @@ -0,0 +1 @@ +../../../detect-indent/5.0.0/node_modules/detect-indent \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/graceful-fs b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/graceful-fs new file mode 120000 index 0000000000..4db8bdb9f8 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/graceful-fs @@ -0,0 +1 @@ +../../../graceful-fs/4.1.11/node_modules/graceful-fs \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/make-dir b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/make-dir new file mode 120000 index 0000000000..f47c1359b9 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/make-dir @@ -0,0 +1 @@ +../../../make-dir/1.0.0/node_modules/make-dir \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/pify b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/pify new file mode 120000 index 0000000000..39b64b43bb --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/pify @@ -0,0 +1 @@ +../../../pify/2.3.0/node_modules/pify \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/sort-keys b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/sort-keys new file mode 120000 index 0000000000..c3d04f44c7 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/sort-keys @@ -0,0 +1 @@ +../../../sort-keys/1.1.2/node_modules/sort-keys \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-file-atomic b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-file-atomic new file mode 120000 index 0000000000..65010c6645 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-file-atomic @@ -0,0 +1 @@ +../../../write-file-atomic/2.1.0/node_modules/write-file-atomic \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/index.js b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/index.js new file mode 100644 index 0000000000..cbd7e706a0 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/index.js @@ -0,0 +1,73 @@ +'use strict'; +const path = require('path'); +const fs = require('graceful-fs'); +const writeFileAtomic = require('write-file-atomic'); +const sortKeys = require('sort-keys'); +const makeDir = require('make-dir'); +const pify = require('pify'); +const detectIndent = require('detect-indent'); + +const init = (fn, fp, data, opts) => { + if (!fp) { + throw new TypeError('Expected a filepath'); + } + + if (data === undefined) { + throw new TypeError('Expected data to stringify'); + } + + opts = Object.assign({ + indent: '\t', + sortKeys: false + }, opts); + + if (opts.sortKeys) { + data = sortKeys(data, { + deep: true, + compare: typeof opts.sortKeys === 'function' && opts.sortKeys + }); + } + + return fn(fp, data, opts); +}; + +const readFile = fp => pify(fs.readFile)(fp, 'utf8').catch(() => {}); + +const main = (fp, data, opts) => { + return (opts.detectIndent ? readFile(fp) : Promise.resolve()) + .then(str => { + const indent = str ? detectIndent(str).indent : opts.indent; + const json = JSON.stringify(data, opts.replacer, indent); + + return pify(writeFileAtomic)(fp, `${json}\n`, {mode: opts.mode}); + }); +}; + +const mainSync = (fp, data, opts) => { + let indent = opts.indent; + + if (opts.detectIndent) { + try { + const file = fs.readFileSync(fp, 'utf8'); + indent = detectIndent(file).indent; + } catch (err) { + if (err.code !== 'ENOENT') { + throw err; + } + } + } + + const json = JSON.stringify(data, opts.replacer, indent); + + return writeFileAtomic.sync(fp, `${json}\n`, {mode: opts.mode}); +}; + +module.exports = (fp, data, opts) => { + return makeDir(path.dirname(fp), {fs}) + .then(() => init(main, fp, data, opts)); +}; + +module.exports.sync = (fp, data, opts) => { + makeDir.sync(path.dirname(fp), {fs}); + init(mainSync, fp, data, opts); +}; diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/license b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/license new file mode 100644 index 0000000000..e7af2f7710 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/package.json b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/package.json new file mode 100644 index 0000000000..51f6a1d43c --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/package.json @@ -0,0 +1,48 @@ +{ + "name": "write-json-file", + "version": "2.2.0", + "description": "Stringify and write JSON to a file atomically", + "license": "MIT", + "repository": "sindresorhus/write-json-file", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "write", + "json", + "stringify", + "file", + "fs", + "graceful", + "stable", + "sort", + "newline", + "indent", + "atomic", + "atomically" + ], + "dependencies": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "pify": "^2.0.0", + "sort-keys": "^1.1.1", + "write-file-atomic": "^2.0.0" + }, + "devDependencies": { + "ava": "*", + "tempfile": "^2.0.0", + "xo": "*" + } +} diff --git a/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/readme.md b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/readme.md new file mode 100644 index 0000000000..ab9162889a --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-json-file/2.2.0/node_modules/write-json-file/readme.md @@ -0,0 +1,83 @@ +# write-json-file [![Build Status](https://travis-ci.org/sindresorhus/write-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/write-json-file) + +> Stringify and write JSON to a file [atomically](https://github.com/npm/write-file-atomic) + +Creates directories for you as needed. + + +## Install + +``` +$ npm install --save write-json-file +``` + + +## Usage + +```js +const writeJsonFile = require('write-json-file'); + +writeJsonFile('foo.json', {foo: true}).then(() => { + console.log('done'); +}); +``` + + +## API + +### writeJsonFile(filepath, data, [options]) + +Returns a `Promise`. + +### writeJsonFile.sync(filepath, data, [options]) + +#### options + +Type: `Object` + +##### indent + +Type: `string` `number`
+Default: `\t` + +Indentation as a string or number of spaces.
+Pass in `null` for no formatting. + +##### detectIndent + +Type: `boolean`
+Default: `false` + +Detect indentation automatically if the file exists. + +##### sortKeys + +Type: `boolean` `function`
+Default: `false` + +Sort the keys recursively.
+Optionally pass in a [`compare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) function. + +##### replacer + +Type: `function` + +Passed into [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter). + +##### mode + +Type: `number`
+Default: `0o666` + +[Mode](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) used when writing the file. + + +## Related + +- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file +- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/sort-keys b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/sort-keys new file mode 120000 index 0000000000..5068a4a28c --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/sort-keys @@ -0,0 +1 @@ +../../../sort-keys/2.0.0/node_modules/sort-keys \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-json-file b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-json-file new file mode 120000 index 0000000000..d0a27707d4 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-json-file @@ -0,0 +1 @@ +../../../write-json-file/2.2.0/node_modules/write-json-file \ No newline at end of file diff --git a/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/index.js b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/index.js new file mode 100644 index 0000000000..981cc0b547 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/index.js @@ -0,0 +1,53 @@ +'use strict'; +const path = require('path'); +const writeJsonFile = require('write-json-file'); +const sortKeys = require('sort-keys'); + +const opts = {detectIndent: true}; + +const dependencyKeys = new Set([ + 'dependencies', + 'devDependencies', + 'optionalDependencies', + 'peerDependencies' +]); + +function normalize(pkg) { + const ret = {}; + + for (const key of Object.keys(pkg)) { + if (!dependencyKeys.has(key)) { + ret[key] = pkg[key]; + } else if (Object.keys(pkg[key]).length !== 0) { + ret[key] = sortKeys(pkg[key]); + } + } + + return ret; +} + +module.exports = (fp, data) => { + if (typeof fp !== 'string') { + data = fp; + fp = '.'; + } + + fp = path.basename(fp) === 'package.json' ? fp : path.join(fp, 'package.json'); + + data = normalize(data); + + return writeJsonFile(fp, data, opts); +}; + +module.exports.sync = (fp, data) => { + if (typeof fp !== 'string') { + data = fp; + fp = '.'; + } + + fp = path.basename(fp) === 'package.json' ? fp : path.join(fp, 'package.json'); + + data = normalize(data); + + writeJsonFile.sync(fp, data, opts); +}; diff --git a/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/license b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/license new file mode 100644 index 0000000000..e7af2f7710 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/package.json b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/package.json new file mode 100644 index 0000000000..c0ca39a2ce --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/package.json @@ -0,0 +1,41 @@ +{ + "name": "write-pkg", + "version": "3.1.0", + "description": "Write a package.json file", + "license": "MIT", + "repository": "sindresorhus/write-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "json", + "write", + "stringify", + "file", + "fs", + "graceful", + "pkg", + "package" + ], + "dependencies": { + "sort-keys": "^2.0.0", + "write-json-file": "^2.2.0" + }, + "devDependencies": { + "ava": "*", + "read-pkg": "^2.0.0", + "tempfile": "^2.0.0", + "xo": "*" + } +} diff --git a/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/readme.md b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/readme.md new file mode 100644 index 0000000000..a10a8b6d92 --- /dev/null +++ b/example/node_modules/.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg/readme.md @@ -0,0 +1,59 @@ +# write-pkg [![Build Status](https://travis-ci.org/sindresorhus/write-pkg.svg?branch=master)](https://travis-ci.org/sindresorhus/write-pkg) + +> Write a `package.json` file + +Writes atomically and creates directories for you as needed. Sorts dependencies when writing. Preserves the indentation if the file already exists. + + +## Install + +``` +$ npm install write-pkg +``` + + +## Usage + +```js +const path = require('path'); +const writePkg = require('write-pkg'); + +writePkg({foo: true}).then(() => { + console.log('done'); +}); + +writePkg(__dirname, {foo: true}).then(() => { + console.log('done'); +}); + +writePkg(path.join('unicorn', 'package.json'), {foo: true}).then(() => { + console.log('done'); +}); +``` + + +## API + +### writePkg([path], data) + +Returns a `Promise`. + +### writePkg.sync([path], data) + +#### path + +Type: `string`
+Default: `process.cwd()` + +Path to where the `package.json` file should be written or its directory. + + +## Related + +- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a `package.json` file +- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/example/node_modules/.shrinkwrap.yaml b/example/node_modules/.shrinkwrap.yaml new file mode 100644 index 0000000000..607298fd8f --- /dev/null +++ b/example/node_modules/.shrinkwrap.yaml @@ -0,0 +1,63 @@ +dependencies: + write-pkg: 3.1.0 +packages: + /detect-indent/5.0.0: + resolution: + integrity: sha1-OHHMCmoALow+Wzz38zYmRnXwa50= + /graceful-fs/4.1.11: + resolution: + integrity: sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= + /imurmurhash/0.1.4: + resolution: + integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= + /is-plain-obj/1.1.0: + resolution: + integrity: sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + /make-dir/1.0.0: + dependencies: + pify: 2.3.0 + resolution: + integrity: sha1-l6ARdR6R3YfPre9Ygy67BJNt6Xg= + /pify/2.3.0: + resolution: + integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + /slide/1.1.6: + resolution: + integrity: sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + /sort-keys/1.1.2: + dependencies: + is-plain-obj: 1.1.0 + resolution: + integrity: sha1-RBttTTRnmPG05J6JIK37oOVD+a0= + /sort-keys/2.0.0: + dependencies: + is-plain-obj: 1.1.0 + resolution: + integrity: sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= + /write-file-atomic/2.1.0: + dependencies: + graceful-fs: 4.1.11 + imurmurhash: 0.1.4 + slide: 1.1.6 + resolution: + integrity: sha512-0TZ20a+xcIl4u0+Mj5xDH2yOWdmQiXlKf9Hm+TgDXjTMsEYb+gDrmb8e8UNAzMCitX8NBqG4Z/FUQIyzv/R1JQ== + /write-json-file/2.2.0: + dependencies: + detect-indent: 5.0.0 + graceful-fs: 4.1.11 + make-dir: 1.0.0 + pify: 2.3.0 + sort-keys: 1.1.2 + write-file-atomic: 2.1.0 + resolution: + integrity: sha1-UYYlBruzthnu+reFnx/WxtBTCHY= + /write-pkg/3.1.0: + dependencies: + sort-keys: 2.0.0 + write-json-file: 2.2.0 + resolution: + integrity: sha1-AwqZlMyZk9JbTnWp8aGSNgcpHOk= +registry: 'https://registry.npmjs.org/' +shrinkwrapVersion: 3 +specifiers: + write-pkg: ^3.1.0 diff --git a/example/node_modules/write-pkg b/example/node_modules/write-pkg new file mode 120000 index 0000000000..522c419360 --- /dev/null +++ b/example/node_modules/write-pkg @@ -0,0 +1 @@ +.registry.npmjs.org/write-pkg/3.1.0/node_modules/write-pkg \ No newline at end of file diff --git a/example/package.json b/example/package.json new file mode 100644 index 0000000000..d39525bfcf --- /dev/null +++ b/example/package.json @@ -0,0 +1,7 @@ +{ + "name": "example", + "version": "1.0.0", + "dependencies": { + "write-pkg": "^3.1.0" + } +} diff --git a/example/shrinkwrap.yaml b/example/shrinkwrap.yaml new file mode 100644 index 0000000000..607298fd8f --- /dev/null +++ b/example/shrinkwrap.yaml @@ -0,0 +1,63 @@ +dependencies: + write-pkg: 3.1.0 +packages: + /detect-indent/5.0.0: + resolution: + integrity: sha1-OHHMCmoALow+Wzz38zYmRnXwa50= + /graceful-fs/4.1.11: + resolution: + integrity: sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= + /imurmurhash/0.1.4: + resolution: + integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= + /is-plain-obj/1.1.0: + resolution: + integrity: sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + /make-dir/1.0.0: + dependencies: + pify: 2.3.0 + resolution: + integrity: sha1-l6ARdR6R3YfPre9Ygy67BJNt6Xg= + /pify/2.3.0: + resolution: + integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + /slide/1.1.6: + resolution: + integrity: sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + /sort-keys/1.1.2: + dependencies: + is-plain-obj: 1.1.0 + resolution: + integrity: sha1-RBttTTRnmPG05J6JIK37oOVD+a0= + /sort-keys/2.0.0: + dependencies: + is-plain-obj: 1.1.0 + resolution: + integrity: sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= + /write-file-atomic/2.1.0: + dependencies: + graceful-fs: 4.1.11 + imurmurhash: 0.1.4 + slide: 1.1.6 + resolution: + integrity: sha512-0TZ20a+xcIl4u0+Mj5xDH2yOWdmQiXlKf9Hm+TgDXjTMsEYb+gDrmb8e8UNAzMCitX8NBqG4Z/FUQIyzv/R1JQ== + /write-json-file/2.2.0: + dependencies: + detect-indent: 5.0.0 + graceful-fs: 4.1.11 + make-dir: 1.0.0 + pify: 2.3.0 + sort-keys: 1.1.2 + write-file-atomic: 2.1.0 + resolution: + integrity: sha1-UYYlBruzthnu+reFnx/WxtBTCHY= + /write-pkg/3.1.0: + dependencies: + sort-keys: 2.0.0 + write-json-file: 2.2.0 + resolution: + integrity: sha1-AwqZlMyZk9JbTnWp8aGSNgcpHOk= +registry: 'https://registry.npmjs.org/' +shrinkwrapVersion: 3 +specifiers: + write-pkg: ^3.1.0 diff --git a/package.json b/package.json index d5650f267c..deed451316 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,10 @@ ], "scripts": { "prepare": "cd test && pnpm install", - "test": "cd test && npm test", + "test": "cd test && npm test && mos test", "prepublishOnly": "tsc", - "tsc": "tsc" + "tsc": "tsc", + "md": "tsc && mos" }, "repository": { "type": "git", @@ -22,7 +23,11 @@ "list", "ls" ], - "author": "Zoltan Kochan", + "author": { + "name": "Zoltan Kochan", + "email": "zoltan.kochan@gmail.com", + "url": "https://www.kochan.io/" + }, "license": "MIT", "bugs": { "url": "https://github.com/pnpm/pnpm-list/issues" @@ -41,6 +46,16 @@ "thenify": "^3.3.0" }, "devDependencies": { + "mos": "^2.0.0-alpha.3", + "mos-plugin-readme": "^1.0.4", "typescript": "^2.4.1" + }, + "mos": { + "plugins": [ + "readme" + ], + "installation": { + "useShortAlias": true + } } } diff --git a/shrinkwrap.yaml b/shrinkwrap.yaml index d567fc8947..6c8b2d9f2e 100644 --- a/shrinkwrap.yaml +++ b/shrinkwrap.yaml @@ -10,6 +10,8 @@ dependencies: read-package-json: 2.0.10 thenify: 3.3.0 devDependencies: + mos: 2.0.0-alpha.3 + mos-plugin-readme: 1.0.4 typescript: 2.4.1 packages: /@types/archy/0.0.30: @@ -30,6 +32,43 @@ packages: /@types/semver/5.3.32: resolution: integrity: sha512-MdbWERx4JWmN4zP+skJy9Kio+Cddvmyn1k8x0S8UAqDoMgOJeobQo7yhlE4BfiimonHirgixWfva/hKUlXBsrw== + /@zkochan/async-replace/0.4.1: + dependencies: + babel-run-async: 1.0.0 + babel-runtime: 6.23.0 + dev: true + resolution: + integrity: sha1-TPO97s9S8vasjzKw2IpoLrSEiXk= + /acorn/3.0.4: + dev: true + resolution: + integrity: sha1-BPJElQ/bj6+FUHrUgcLt7nrs3uw= + /amdefine/1.0.1: + dev: true + resolution: + integrity: sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= + /ansi-align/1.1.0: + dependencies: + string-width: 1.0.2 + dev: true + resolution: + integrity: sha1-LwwWWIKXOa3V67FeawxuNCPwFro= + /ansi-regex/0.2.1: + dev: true + resolution: + integrity: sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk= + /ansi-regex/2.1.1: + dev: true + resolution: + integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + /ansi-styles/1.1.0: + dev: true + resolution: + integrity: sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94= + /ansi-styles/2.2.1: + dev: true + resolution: + integrity: sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= /ansi-styles/3.1.0: dependencies: color-convert: 1.9.0 @@ -46,6 +85,193 @@ packages: sprintf-js: 1.0.3 resolution: integrity: sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY= + /arr-exclude/1.0.0: + dev: true + resolution: + integrity: sha1-38fC5VKicHI8zaBM8xKMjL/lxjE= + /array-find-index/1.0.2: + dev: true + resolution: + integrity: sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= + /babel-code-frame/6.22.0: + dependencies: + chalk: 1.1.3 + esutils: 2.0.2 + js-tokens: 3.0.2 + dev: true + resolution: + integrity: sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ= + /babel-core/6.25.0: + dependencies: + babel-code-frame: 6.22.0 + babel-generator: 6.25.0 + babel-helpers: 6.24.1 + babel-messages: 6.23.0 + babel-register: 6.24.1 + babel-runtime: 6.23.0 + babel-template: 6.25.0 + babel-traverse: 6.25.0 + babel-types: 6.25.0 + babylon: 6.17.4 + convert-source-map: 1.5.0 + debug: 2.6.8 + json5: 0.5.1 + lodash: 4.17.4 + minimatch: 3.0.4 + path-is-absolute: 1.0.1 + private: 0.1.7 + slash: 1.0.0 + source-map: 0.5.6 + dev: true + resolution: + integrity: sha1-fdQrBGPHQunVKW3rPsZ6kyLa1yk= + /babel-generator/6.25.0: + dependencies: + babel-messages: 6.23.0 + babel-runtime: 6.23.0 + babel-types: 6.25.0 + detect-indent: 4.0.0 + jsesc: 1.3.0 + lodash: 4.17.4 + source-map: 0.5.6 + trim-right: 1.0.1 + dev: true + resolution: + integrity: sha1-M6GvcNXyiQrrRlpKd5PB32qeqfw= + /babel-helper-define-map/6.24.1: + dependencies: + babel-helper-function-name: 6.24.1 + babel-runtime: 6.23.0 + babel-types: 6.25.0 + lodash: 4.17.4 + dev: true + resolution: + integrity: sha1-epdH8ljYlH0y1RX2qhx70CIEoIA= + /babel-helper-function-name/6.24.1: + dependencies: + babel-helper-get-function-arity: 6.24.1 + babel-runtime: 6.23.0 + babel-template: 6.25.0 + babel-traverse: 6.25.0 + babel-types: 6.25.0 + dev: true + resolution: + integrity: sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= + /babel-helper-get-function-arity/6.24.1: + dependencies: + babel-runtime: 6.23.0 + babel-types: 6.25.0 + dev: true + resolution: + integrity: sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= + /babel-helper-optimise-call-expression/6.24.1: + dependencies: + babel-runtime: 6.23.0 + babel-types: 6.25.0 + dev: true + resolution: + integrity: sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= + /babel-helper-replace-supers/6.24.1: + dependencies: + babel-helper-optimise-call-expression: 6.24.1 + babel-messages: 6.23.0 + babel-runtime: 6.23.0 + babel-template: 6.25.0 + babel-traverse: 6.25.0 + babel-types: 6.25.0 + dev: true + resolution: + integrity: sha1-v22/5Dk40XNpohPKiov3S2qQqxo= + /babel-helpers/6.24.1: + dependencies: + babel-runtime: 6.23.0 + babel-template: 6.25.0 + dev: true + resolution: + integrity: sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= + /babel-messages/6.23.0: + dependencies: + babel-runtime: 6.23.0 + dev: true + resolution: + integrity: sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + /babel-plugin-transform-es2015-classes/6.24.1: + dependencies: + babel-helper-define-map: 6.24.1 + babel-helper-function-name: 6.24.1 + babel-helper-optimise-call-expression: 6.24.1 + babel-helper-replace-supers: 6.24.1 + babel-messages: 6.23.0 + babel-runtime: 6.23.0 + babel-template: 6.25.0 + babel-traverse: 6.25.0 + babel-types: 6.25.0 + dev: true + resolution: + integrity: sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= + /babel-register/6.24.1: + dependencies: + babel-core: 6.25.0 + babel-runtime: 6.23.0 + core-js: 2.4.1 + home-or-tmp: 2.0.0 + lodash: 4.17.4 + mkdirp: 0.5.1 + source-map-support: 0.4.15 + dev: true + resolution: + integrity: sha1-fhDhOi9xBlvfrVoXh7pFvKbe118= + /babel-run-async/1.0.0: + dependencies: + babel-runtime: 6.23.0 + is-promise: 2.1.0 + dev: true + resolution: + integrity: sha1-o0NCX802FY3++ucl0Dk+zkTsRZw= + /babel-runtime/6.23.0: + dependencies: + core-js: 2.4.1 + regenerator-runtime: 0.10.5 + dev: true + resolution: + integrity: sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs= + /babel-template/6.25.0: + dependencies: + babel-runtime: 6.23.0 + babel-traverse: 6.25.0 + babel-types: 6.25.0 + babylon: 6.17.4 + lodash: 4.17.4 + dev: true + resolution: + integrity: sha1-ZlJBFmt8KqTGGdceGSlpVSsQwHE= + /babel-traverse/6.25.0: + dependencies: + babel-code-frame: 6.22.0 + babel-messages: 6.23.0 + babel-runtime: 6.23.0 + babel-types: 6.25.0 + babylon: 6.17.4 + debug: 2.6.8 + globals: 9.18.0 + invariant: 2.2.2 + lodash: 4.17.4 + dev: true + resolution: + integrity: sha1-IldJfi/NGbie3BPEyROB+VEklvE= + /babel-types/6.25.0: + dependencies: + babel-runtime: 6.23.0 + esutils: 2.0.2 + lodash: 4.17.4 + to-fast-properties: 1.0.3 + dev: true + resolution: + integrity: sha1-cK+ySNVmDl0Y+BHZHIMDtUE0oY4= + /babylon/6.17.4: + dev: true + resolution: + integrity: sha512-kChlV+0SXkjE0vUn9OZ7pBMWRFd8uq3mZe8x1K6jhuNcAFAtEnjchFAqB+dYEXKyd+JpT6eppRR78QAr5gTsUw== /balanced-match/1.0.0: resolution: integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c= @@ -55,6 +281,19 @@ packages: individual: 3.0.0 resolution: integrity: sha1-vIpIPKlASdqbg3wa0Rzf6+5uBRQ= + /boxen/0.5.1: + dependencies: + camelcase: 2.1.1 + chalk: 1.1.3 + cli-boxes: 1.0.0 + filled-array: 1.1.0 + object-assign: 4.1.1 + repeating: 2.0.1 + string-width: 1.0.2 + widest-line: 1.0.0 + dev: true + resolution: + integrity: sha1-W3PYhA6388ihVcv2ntPtaNRyABQ= /brace-expansion/1.1.8: dependencies: balanced-match: 1.0.0 @@ -67,6 +306,59 @@ packages: /builtins/1.0.3: resolution: integrity: sha1-y5T662HIaWRR2zZTThQi+U8K7og= + /caller-path/0.1.0: + dependencies: + callsites: 0.2.0 + dev: true + resolution: + integrity: sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= + /callsites/0.2.0: + dev: true + resolution: + integrity: sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= + /callsites/1.0.0: + dev: true + resolution: + integrity: sha1-AlY7EO0x8uvZWJOndvCz2VprFbg= + /camelcase-keys/2.1.0: + dependencies: + camelcase: 2.1.1 + map-obj: 1.0.1 + dev: true + resolution: + integrity: sha1-MIvur/3ygRkFHvodkyITyRuPkuc= + /camelcase/2.1.1: + dev: true + resolution: + integrity: sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + /capture-stack-trace/1.0.0: + dev: true + resolution: + integrity: sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0= + /ccount/1.0.2: + dev: true + resolution: + integrity: sha1-U7ai+BW7d7nChx97mnLDol8djok= + /chalk/0.5.1: + dependencies: + ansi-styles: 1.1.0 + escape-string-regexp: 1.0.5 + has-ansi: 0.1.0 + strip-ansi: 0.3.0 + supports-color: 0.2.0 + dev: true + resolution: + integrity: sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ= + /chalk/1.1.3: + dependencies: + ansi-styles: 2.2.1 + escape-string-regexp: 1.0.5 + has-ansi: 2.0.0 + strip-ansi: 3.0.1 + supports-color: 2.0.0 + dev: true + resolution: + integrity: sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= /chalk/2.0.1: dependencies: ansi-styles: 3.1.0 @@ -74,6 +366,52 @@ packages: supports-color: 4.2.0 resolution: integrity: sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y/c7cqRAz70U7hfekqx6qNYthuKFO6K0g== + /character-entities-html4/1.1.1: + dev: true + resolution: + integrity: sha1-NZoqSg9+KdPcKsmb2+Ie45Q46lA= + /character-entities-legacy/1.1.1: + dev: true + resolution: + integrity: sha1-9Ad53xoQGHK7UQo9KV4fzPFHIC8= + /character-entities/1.2.1: + dev: true + resolution: + integrity: sha1-92hxvl72bdt/j440eOzDdMJ9bco= + /character-reference-invalid/1.1.1: + dev: true + resolution: + integrity: sha1-lCg191Dk7GGjCOYMLvjMEBEgLvw= + /cli-boxes/1.0.0: + dev: true + resolution: + integrity: sha1-T6kXw+WclKAEzWH47lCdplFocUM= + /code-point-at/1.1.0: + dev: true + resolution: + integrity: sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + /codemo/0.2.1: + dependencies: + acorn: 3.0.4 + babel-runtime: 6.23.0 + callsites: 1.0.0 + cross-spawn-async: 2.2.2 + file-position: 0.0.0 + lodash.partition: 4.6.0 + normalize-newline: 2.0.0 + normalize-path: 2.0.1 + promise.prototype.finally: 1.0.1 + rollup: 0.25.8 + rollup-plugin-babel: 2.4.0 + rollup-plugin-includepaths: 0.1.2 + source-map: 0.5.3 + dev: true + resolution: + integrity: sha1-HsA5xPlRrpcOCuK2ZGFl1tSNz4Q= + /collapse-white-space/1.0.3: + dev: true + resolution: + integrity: sha1-S5BvZw5aljqHt2sOFolkM0G2Ajw= /color-convert/1.9.0: dependencies: color-name: 1.1.2 @@ -85,6 +423,87 @@ packages: /concat-map/0.0.1: resolution: integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + /configstore/2.1.0: + dependencies: + dot-prop: 3.0.0 + graceful-fs: 4.1.11 + mkdirp: 0.5.1 + object-assign: 4.1.1 + os-tmpdir: 1.0.2 + osenv: 0.1.4 + uuid: 2.0.3 + write-file-atomic: 1.3.4 + xdg-basedir: 2.0.0 + dev: true + resolution: + integrity: sha1-c3o6cDbpiGECqmCZ5HuzOrGroaE= + /convert-source-map/1.5.0: + dev: true + resolution: + integrity: sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU= + /core-js/2.4.1: + dev: true + resolution: + integrity: sha1-TekR5mew6ukSTjQlS1OupvxhjT4= + /core-util-is/1.0.2: + dev: true + resolution: + integrity: sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + /create-error-class/3.0.2: + dependencies: + capture-stack-trace: 1.0.0 + dev: true + resolution: + integrity: sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y= + /cross-spawn-async/2.2.2: + dependencies: + lru-cache: 4.1.1 + which: 1.2.14 + dev: true + resolution: + integrity: sha1-kN6ptpIPA7L3vHSZYVABrubyMX4= + /cross-spawn/4.0.2: + dependencies: + lru-cache: 4.1.1 + which: 1.2.14 + dev: true + resolution: + integrity: sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE= + /currently-unhandled/0.4.1: + dependencies: + array-find-index: 1.0.2 + dev: true + resolution: + integrity: sha1-mI3zP+qxke95mmE2nddsF635V+o= + /debug/2.6.8: + dependencies: + ms: 2.0.0 + dev: true + resolution: + integrity: sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw= + /decamelize/1.2.0: + dev: true + resolution: + integrity: sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + /deep-equal/1.0.1: + dev: true + resolution: + integrity: sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= + /deep-extend/0.4.2: + dev: true + resolution: + integrity: sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8= + /define-properties/1.1.2: + dependencies: + foreach: 2.0.5 + object-keys: 1.0.11 + dev: true + resolution: + integrity: sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ= + /defined/1.0.0: + dev: true + resolution: + integrity: sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= /dependencies-hierarchy/1.0.0: dependencies: '@types/node': 8.0.13 @@ -99,23 +518,153 @@ packages: encode-registry: 1.0.0 resolution: integrity: sha512-Gvh4PAxxNz453W7sTk0QlVo1/5TcPeHb3WOh03CXNScN4NLxAj2HmyhsH6NoMc7+BY7Q5fdQvl9nJPZp4m6KbA== + /detect-indent/4.0.0: + dependencies: + repeating: 2.0.1 + dev: true + resolution: + integrity: sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + /diff/2.2.3: + dev: true + resolution: + integrity: sha1-YOr9DSjukG5Oj/ClLBIpUhAzv5k= + /dot-prop/3.0.0: + dependencies: + is-obj: 1.0.1 + dev: true + resolution: + integrity: sha1-G3CK8JSknJoOfbyteQq6U52sEXc= + /duplexer/0.1.1: + dev: true + resolution: + integrity: sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= + /duplexer2/0.1.4: + dependencies: + readable-stream: 2.3.3 + dev: true + resolution: + integrity: sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= + /emoji-regex/6.1.1: + dev: true + resolution: + integrity: sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4= /encode-registry/1.0.0: dependencies: mem: 1.1.0 resolution: integrity: sha512-4DiPp5kmIDq9rHDU5C3r9clu+TVcnUXIMoLNiiJxHlGG+cMIApT/mOwLEpcEPN1a2PnNt/Ll3lcf39dyHf3n9w== + /error-ex/1.3.1: + dependencies: + is-arrayish: 0.2.1 + dev: true + resolution: + integrity: sha1-+FWobOYa3E6GIcPNoh56dhLDqNw= + /es-abstract/1.7.0: + dependencies: + es-to-primitive: 1.1.1 + function-bind: 1.1.0 + is-callable: 1.1.3 + is-regex: 1.0.4 + dev: true + resolution: + integrity: sha1-363ndOAb/Nl/lhgCmMRJyGI/uUw= + /es-to-primitive/1.1.1: + dependencies: + is-callable: 1.1.3 + is-date-object: 1.0.1 + is-symbol: 1.0.1 + dev: true + resolution: + integrity: sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0= /escape-string-regexp/1.0.5: resolution: integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= /esprima/4.0.0: resolution: integrity: sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw== + /estree-walker/0.2.1: + dev: true + resolution: + integrity: sha1-va/oCVOD2EFNXcLs9MkXO225QS4= + /esutils/2.0.2: + dev: true + resolution: + integrity: sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + /events-to-array/1.1.2: + dev: true + resolution: + integrity: sha1-LUH1Y+H+QA7Uli/hpNXGp1Od9/Y= /fast-safe-stringify/1.1.13: resolution: integrity: sha1-oB6c2cnkkXFcmKdaQtXwu9EH/3Y= + /figures/1.7.0: + dependencies: + escape-string-regexp: 1.0.5 + object-assign: 4.1.1 + dev: true + resolution: + integrity: sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= + /file-exists/1.0.0: + dev: true + resolution: + integrity: sha1-5tJptWVnuJIlgTmOmQ3XB49y1hY= + /file-position/0.0.0: + dev: true + resolution: + integrity: sha1-rkxlqupgoUyX9xUIwKvIaopfCI4= + /filled-array/1.1.0: + dev: true + resolution: + integrity: sha1-w8T2xmO5I0WamqKZEtLQMfFQf4Q= + /find-up/1.1.2: + dependencies: + path-exists: 2.1.0 + pinkie-promise: 2.0.1 + dev: true + resolution: + integrity: sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + /flatten/1.0.2: + dev: true + resolution: + integrity: sha1-2uRqnXj74lKSJYzB54CkHZXAN4I= + /foreach/2.0.5: + dev: true + resolution: + integrity: sha1-C+4AUBiusmDQo6865ljdATbsG5k= /fs.realpath/1.0.0: resolution: integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + /function-bind/1.1.0: + dev: true + resolution: + integrity: sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E= + /get-stdin/4.0.1: + dev: true + resolution: + integrity: sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= + /github-slugger/1.1.3: + dependencies: + emoji-regex: 6.1.1 + dev: true + resolution: + integrity: sha1-MUpudZoYwrDMV2DVEsy6tUnFSac= + /github-url-to-object/2.2.6: + dependencies: + is-url: 1.2.2 + dev: true + resolution: + integrity: sha1-ypJQFlFJdI7uswv8xgAMb+DSQvc= + /glob/7.0.6: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.3 + minimatch: 3.0.4 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + resolution: + integrity: sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo= /glob/7.1.2: dependencies: fs.realpath: 1.0.0 @@ -126,18 +675,83 @@ packages: path-is-absolute: 1.0.1 resolution: integrity: sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== + /globals/9.18.0: + dev: true + resolution: + integrity: sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + /got/5.7.1: + dependencies: + create-error-class: 3.0.2 + duplexer2: 0.1.4 + is-redirect: 1.0.0 + is-retry-allowed: 1.1.0 + is-stream: 1.1.0 + lowercase-keys: 1.0.0 + node-status-codes: 1.0.0 + object-assign: 4.1.1 + parse-json: 2.2.0 + pinkie-promise: 2.0.1 + read-all-stream: 3.1.0 + readable-stream: 2.3.3 + timed-out: 3.1.3 + unzip-response: 1.0.2 + url-parse-lax: 1.0.0 + dev: true + resolution: + integrity: sha1-X4FjWmHkplifGAVp6k44FoClHzU= /graceful-fs/4.1.11: resolution: integrity: sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= + /has-ansi/0.1.0: + dependencies: + ansi-regex: 0.2.1 + dev: true + resolution: + integrity: sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4= + /has-ansi/2.0.0: + dependencies: + ansi-regex: 2.1.1 + dev: true + resolution: + integrity: sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= /has-flag/2.0.0: resolution: integrity: sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= + /has/1.0.1: + dependencies: + function-bind: 1.1.0 + dev: true + resolution: + integrity: sha1-hGFzP1OLCDfJNh45qauelwTcLyg= + /home-or-tmp/2.0.0: + dependencies: + os-homedir: 1.0.2 + os-tmpdir: 1.0.2 + dev: true + resolution: + integrity: sha1-42w/LSyufXRqhX440Y1fMqeILbg= /hosted-git-info/2.5.0: resolution: integrity: sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg== /imurmurhash/0.1.4: resolution: integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= + /indent-string/2.1.0: + dependencies: + repeating: 2.0.1 + dev: true + resolution: + integrity: sha1-ji1INIdCEhtKghi3oTfppSBJ3IA= + /independent/0.2.0: + dependencies: + '@zkochan/async-replace': 0.4.1 + babel-runtime: 6.23.0 + read-pkg-up: 1.0.1 + relative: 3.0.2 + resolve: 1.1.7 + dev: true + resolution: + integrity: sha1-fP+w1d94AFLyRFzaqPXj29sXyw8= /individual/3.0.0: resolution: integrity: sha1-58pPhfiVewGHNPKFdQ3CLsL5hi0= @@ -150,25 +764,172 @@ packages: /inherits/2.0.3: resolution: integrity: sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + /ini/1.3.4: + dev: true + resolution: + integrity: sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4= + /invariant/2.2.2: + dependencies: + loose-envify: 1.3.1 + dev: true + resolution: + integrity: sha1-nh9WrArNtr8wMwbzOL47IErmA2A= + /is-alphabetical/1.0.0: + dev: true + resolution: + integrity: sha1-4lRMEwWCVfIUTLdXBmzTNCocjEY= + /is-alphanumerical/1.0.0: + dependencies: + is-alphabetical: 1.0.0 + is-decimal: 1.0.0 + dev: true + resolution: + integrity: sha1-4GSS5xnBvxXewjnk8a9fZ7TW578= + /is-arrayish/0.2.1: + dev: true + resolution: + integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= /is-builtin-module/1.0.0: dependencies: builtin-modules: 1.1.1 resolution: integrity: sha1-VAVy0096wxGfj3bDDLwbHgN6/74= + /is-callable/1.1.3: + dev: true + resolution: + integrity: sha1-hut1OSgF3cM69xySoO7fdO52BLI= + /is-date-object/1.0.1: + dev: true + resolution: + integrity: sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + /is-decimal/1.0.0: + dev: true + resolution: + integrity: sha1-lAV5tupjxigICmnmK9qIyEcLT+A= + /is-finite/1.0.2: + dependencies: + number-is-nan: 1.0.1 + dev: true + resolution: + integrity: sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= + /is-fullwidth-code-point/1.0.0: + dependencies: + number-is-nan: 1.0.1 + dev: true + resolution: + integrity: sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + /is-hexadecimal/1.0.0: + dev: true + resolution: + integrity: sha1-XEWXcdKvmi45Ungf1U/LG8/kETw= + /is-npm/1.0.0: + dev: true + resolution: + integrity: sha1-8vtjpl5JBbQGyGBydloaTceTufQ= + /is-obj/1.0.1: + dev: true + resolution: + integrity: sha1-PkcprB9f3gJc19g6iW2rn09n2w8= + /is-plain-obj/1.1.0: + dev: true + resolution: + integrity: sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + /is-promise/2.1.0: + dev: true + resolution: + integrity: sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + /is-redirect/1.0.0: + dev: true + resolution: + integrity: sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= + /is-regex/1.0.4: + dependencies: + has: 1.0.1 + dev: true + resolution: + integrity: sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + /is-retry-allowed/1.1.0: + dev: true + resolution: + integrity: sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= + /is-stream/1.1.0: + dev: true + resolution: + integrity: sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + /is-symbol/1.0.1: + dev: true + resolution: + integrity: sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI= + /is-url/1.2.2: + dev: true + resolution: + integrity: sha1-SYkFpZO/R8wtnn9zg3K792lsfyY= + /is-utf8/0.2.1: + dev: true + resolution: + integrity: sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + /isarray/1.0.0: + dev: true + resolution: + integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + /isexe/2.0.0: + dev: true + resolution: + integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + /isobject/2.1.0: + dependencies: + isarray: 1.0.0 + dev: true + resolution: + integrity: sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= /jju/1.3.0: resolution: integrity: sha1-2t2e8BkkvHKLA/L3l5vb1i96Kqo= + /js-tokens/3.0.2: + dev: true + resolution: + integrity: sha1-mGbfOVECEw449/mWvOtlRDIJwls= /js-yaml/3.9.0: dependencies: argparse: 1.0.9 esprima: 4.0.0 resolution: integrity: sha512-0LoUNELX4S+iofCT8f4uEHIiRBR+c2AINyC8qRWfC6QNruLtxVZRJaPcu/xwMgFIgDxF25tGHaDjvxzJCNE9yw== + /jsesc/1.3.0: + dev: true + resolution: + integrity: sha1-RsP+yMGJKxKwgz25vHYiF226s0s= /json-parse-helpfulerror/1.0.3: dependencies: jju: 1.3.0 resolution: integrity: sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w= + /json5/0.5.1: + dev: true + resolution: + integrity: sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + /jsondiffpatch/0.1.43: + dependencies: + chalk: 0.5.1 + dev: true + resolution: + integrity: sha1-wFKImpnvfroZ0AlfkPclz6cKVhE= + /latest-version/2.0.0: + dependencies: + package-json: 2.4.0 + dev: true + resolution: + integrity: sha1-VvjWE5YghHuAF/jx9NeOIRMkFos= + /load-json-file/1.1.0: + dependencies: + graceful-fs: 4.1.11 + parse-json: 2.2.0 + pify: 2.3.0 + pinkie-promise: 2.0.1 + strip-bom: 2.0.0 + dev: true + resolution: + integrity: sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= /load-yaml-file/0.1.0: dependencies: graceful-fs: 4.1.11 @@ -177,11 +938,86 @@ packages: strip-bom: 3.0.0 resolution: integrity: sha1-9oAGbmkbPutFAXZy5KOVavW4O4k= + /lodash.partition/4.6.0: + dev: true + resolution: + integrity: sha1-o45GtzRp4EILDaEhLmbUFL42S6Q= + /lodash/4.17.4: + dev: true + resolution: + integrity: sha1-eCA6TRwyiuHYbcpkYONptX9AVa4= + /longest-streak/1.0.0: + dev: true + resolution: + integrity: sha1-0GWXxNTDG1LMsfXY+P5xSOr9aWU= + /loose-envify/1.3.1: + dependencies: + js-tokens: 3.0.2 + dev: true + resolution: + integrity: sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg= + /loud-rejection/1.6.0: + dependencies: + currently-unhandled: 0.4.1 + signal-exit: 3.0.2 + dev: true + resolution: + integrity: sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= + /lowercase-keys/1.0.0: + dev: true + resolution: + integrity: sha1-TjNms55/VFfjXxMkvfb4jQv8cwY= + /lru-cache/4.1.1: + dependencies: + pseudomap: 1.0.2 + yallist: 2.1.2 + dev: true + resolution: + integrity: sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew== + /magic-hook/1.0.0: + dependencies: + flatten: 1.0.2 + dev: true + resolution: + integrity: sha1-mu2GAadRK1axlUcNonSk7jqVCfA= + /map-obj/1.0.1: + dev: true + resolution: + integrity: sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= + /markdown-table/0.4.0: + dev: true + resolution: + integrity: sha1-iQwsGzv+g/sA5BKbjkz+ZFJw+dE= + /markdownscript/1.3.0: + dependencies: + babel-runtime: 6.23.0 + dev: true + resolution: + integrity: sha1-vf3/Csk0F4JLI2UjqaaZ5eDOfhE= + /mdast-util-to-string/1.0.4: + dev: true + resolution: + integrity: sha1-XEVch4yTVfDB5/PotxnPWDaRrPs= /mem/1.1.0: dependencies: mimic-fn: 1.1.0 resolution: integrity: sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= + /meow/3.7.0: + dependencies: + camelcase-keys: 2.1.0 + decamelize: 1.2.0 + loud-rejection: 1.6.0 + map-obj: 1.0.1 + minimist: 1.2.0 + normalize-package-data: 2.4.0 + object-assign: 4.1.1 + read-pkg-up: 1.0.1 + redent: 1.0.0 + trim-newlines: 1.0.0 + dev: true + resolution: + integrity: sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= /mimic-fn/1.1.0: resolution: integrity: sha1-5md4PZLonb00KBi1IwudYqZyrRg= @@ -193,6 +1029,10 @@ packages: /minimist/0.0.8: resolution: integrity: sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + /minimist/1.2.0: + dev: true + resolution: + integrity: sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= /mkdirp-promise/5.0.1: dependencies: mkdirp: 0.5.1 @@ -203,6 +1043,223 @@ packages: minimist: 0.0.8 resolution: integrity: sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + /mos-core/1.0.2: + dependencies: + babel-run-async: 1.0.0 + babel-runtime: 6.23.0 + ccount: 1.0.2 + collapse-white-space: 1.0.3 + core-js: 2.4.1 + file-position: 0.0.0 + is-promise: 2.1.0 + longest-streak: 1.0.0 + markdown-table: 0.4.0 + parse-entities: 1.1.1 + repeat-string: 1.6.1 + stringify-entities: 1.3.1 + trim: 0.0.1 + trim-trailing-lines: 1.1.0 + unist-util-remove-position: 1.1.1 + dev: true + resolution: + integrity: sha1-N8JpfBzHhhgkFivQ+rrvJCX55H0= + /mos-hosted-git-info/1.0.0: + dev: true + resolution: + integrity: sha1-yj8BhwBEv14CT4WPEl3FmxrFe2k= + /mos-init/1.1.2: + dependencies: + arr-exclude: 1.0.0 + core-js: 2.4.1 + cross-spawn: 4.0.2 + mos-read-pkg-up: 1.0.0 + the-argv: 1.0.0 + write-pkg: 1.0.0 + dev: true + resolution: + integrity: sha1-DuxN4kE4UjTkwKFUqZhc7NH8RIM= + /mos-normalize-package-data/1.0.0: + dependencies: + is-builtin-module: 1.0.0 + mos-hosted-git-info: 1.0.0 + semver: 5.3.0 + validate-npm-package-license: 3.0.1 + dev: true + resolution: + integrity: sha1-D9oITzRT8B7UtWVTQeYDPxeaeas= + /mos-plugin-dependencies/2.2.2: + dependencies: + babel-runtime: 6.23.0 + github-url-to-object: 2.2.6 + shieldman: 1.2.0 + dev: true + resolution: + integrity: sha1-vm7fN15M9ch8QU0PI3ZmItGO0Xc= + /mos-plugin-ejs/1.1.2: + dependencies: + babel-run-async: 1.0.0 + babel-runtime: 6.23.0 + github-url-to-object: 2.2.6 + mos-read-pkg-up: 1.0.0 + reserved-words: 0.1.1 + dev: true + resolution: + integrity: sha1-1jZXxN9o0yMx1MdHweq/vBC1zBY= + /mos-plugin-example/1.1.2: + dependencies: + babel-runtime: 6.23.0 + codemo: 0.2.1 + independent: 0.2.0 + dev: true + resolution: + integrity: sha1-YmGDjrRVXNmjj7zrkgEz55S4hHc= + /mos-plugin-installation/1.2.2: + dependencies: + babel-runtime: 6.23.0 + markdownscript: 1.3.0 + mdast-util-to-string: 1.0.4 + dev: true + resolution: + integrity: sha1-r2FghByH+zmGnQEHwGWaKTayPH8= + /mos-plugin-license/1.2.2: + dependencies: + babel-runtime: 6.23.0 + file-exists: 1.0.0 + markdownscript: 1.3.0 + mdast-util-to-string: 1.0.4 + dev: true + resolution: + integrity: sha1-BEV+GXukOHeOPbZ/rdi8yYR0fIY= + /mos-plugin-markdownscript/2.1.2: + dependencies: + babel-runtime: 6.23.0 + markdownscript: 1.3.0 + reserved-words: 0.1.1 + dev: true + resolution: + integrity: sha1-Xh02JCByVXeNRbt+elDceSbDA7A= + /mos-plugin-package-json/2.1.2: + dependencies: + babel-runtime: 6.23.0 + dev: true + resolution: + integrity: sha1-kQZoTdMWCYmBXd7Zi7qj6FedeaU= + /mos-plugin-readme/1.0.4: + dependencies: + babel-runtime: 6.23.0 + markdownscript: 1.3.0 + dev: true + resolution: + integrity: sha1-fOweSUjB7B1EKRWAHR9m164khfM= + /mos-plugin-shields/2.2.2: + dependencies: + babel-runtime: 6.23.0 + shieldman: 1.2.0 + dev: true + resolution: + integrity: sha1-LfbfU3wsqPcOk/fkq64N9G69TvY= + /mos-plugin-snippet/2.1.3: + dependencies: + babel-runtime: 6.23.0 + dev: true + resolution: + integrity: sha1-AldDv4iW6GXi9/RIkoz0QHjUxZU= + /mos-plugin-toc/1.2.3: + dependencies: + babel-runtime: 6.23.0 + github-slugger: 1.1.3 + markdownscript: 1.3.0 + dev: true + resolution: + integrity: sha1-gDYFslWs9iUlq1l88ErSa99d4ws= + /mos-processor/1.2.2: + dependencies: + babel-runtime: 6.23.0 + github-url-to-object: 2.2.6 + magic-hook: 1.0.0 + mos-core: 1.0.2 + mos-read-pkg-up: 1.0.0 + normalize-path: 2.1.1 + remi: 1.1.1 + remi-runner: 1.1.3 + dev: true + resolution: + integrity: sha1-ayJKldvmppQ77O1etshS3Im6p9s= + /mos-read-pkg-up/1.0.0: + dependencies: + find-up: 1.1.2 + mos-read-pkg: 1.1.3 + dev: true + resolution: + integrity: sha1-8Ai4XlQve4/T/bnXTtyOf00YJ2k= + /mos-read-pkg/1.1.3: + dependencies: + load-json-file: 1.1.0 + mos-normalize-package-data: 1.0.0 + path-type: 1.1.0 + dev: true + resolution: + integrity: sha1-FM28aoCPD7wbY3hmob7XBaK9EcQ= + /mos-tap-diff/1.0.0: + dependencies: + babel-runtime: 6.23.0 + chalk: 1.1.3 + core-js: 2.4.1 + diff: 2.2.3 + duplexer: 0.1.1 + figures: 1.7.0 + jsondiffpatch: 0.1.43 + pretty-ms: 2.1.0 + tap-parser: 1.3.2 + through2: 2.0.3 + dev: true + resolution: + integrity: sha1-NDOB0f2e1RljsLMVNbf9i64E/3A= + /mos/2.0.0-alpha.3: + dependencies: + babel-runtime: 6.23.0 + chalk: 1.1.3 + glob: 7.0.6 + loud-rejection: 1.6.0 + magic-hook: 1.0.0 + meow: 3.7.0 + mos-init: 1.1.2 + mos-plugin-dependencies: 2.2.2 + mos-plugin-ejs: 1.1.2 + mos-plugin-example: 1.1.2 + mos-plugin-installation: 1.2.2 + mos-plugin-license: 1.2.2 + mos-plugin-markdownscript: 2.1.2 + mos-plugin-package-json: 2.1.2 + mos-plugin-shields: 2.2.2 + mos-plugin-snippet: 2.1.3 + mos-plugin-toc: 1.2.3 + mos-processor: 1.2.2 + mos-read-pkg-up: 1.0.0 + mos-tap-diff: 1.0.0 + normalize-newline: 2.0.0 + normalize-path: 2.0.1 + rcfile: 1.0.3 + relative: 3.0.2 + resolve-cwd: 1.0.0 + resolve-from: 2.0.0 + tape: 4.5.1 + update-notifier: 0.7.0 + dev: true + resolution: + integrity: sha1-t+m8RNw22I6vHVgmBn54ySEeqVE= + /ms/2.0.0: + dev: true + resolution: + integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + /node-status-codes/1.0.0: + dev: true + resolution: + integrity: sha1-WuVUHQJGRdMqWPzdyc7s6nrjrC8= + /normalize-newline/2.0.0: + dev: true + resolution: + integrity: sha1-yIv2pUcUYqzrP2UXE7wjmw+stUk= /normalize-package-data/2.4.0: dependencies: hosted-git-info: 2.5.0 @@ -211,6 +1268,16 @@ packages: validate-npm-package-license: 3.0.1 resolution: integrity: sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== + /normalize-path/2.0.1: + dev: true + resolution: + integrity: sha1-R4hqwWYnYNQmG32XnSQXCdPOP3o= + /normalize-path/2.1.1: + dependencies: + remove-trailing-separator: 1.0.2 + dev: true + resolution: + integrity: sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= /npm-package-arg/5.1.2: dependencies: hosted-git-info: 2.5.0 @@ -219,6 +1286,22 @@ packages: validate-npm-package-name: 3.0.0 resolution: integrity: sha512-wJBsrf0qpypPT7A0LART18hCdyhpCMxeTtcb0X4IZO2jsP6Om7EHN1d9KSKiqD+KVH030RVNpWS9thk+pb7wzA== + /number-is-nan/1.0.1: + dev: true + resolution: + integrity: sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + /object-assign/4.1.1: + dev: true + resolution: + integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + /object-inspect/1.1.0: + dev: true + resolution: + integrity: sha1-NLymRKgPlPi6QaD50JhOr2Os8U0= + /object-keys/1.0.11: + dev: true + resolution: + integrity: sha1-xUYBd4rVYPEULODgG8yotW0TQm0= /once/1.4.0: dependencies: wrappy: 1.0.2 @@ -239,12 +1322,70 @@ packages: /p-limit/1.1.0: resolution: integrity: sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw= + /package-json/2.4.0: + dependencies: + got: 5.7.1 + registry-auth-token: 3.3.1 + registry-url: 3.1.0 + semver: 5.3.0 + dev: true + resolution: + integrity: sha1-DRW9Z9HLvduyyiIv8u24a8sxqLs= + /parse-entities/1.1.1: + dependencies: + character-entities: 1.2.1 + character-entities-legacy: 1.1.1 + character-reference-invalid: 1.1.1 + is-alphanumerical: 1.0.0 + is-decimal: 1.0.0 + is-hexadecimal: 1.0.0 + dev: true + resolution: + integrity: sha1-gRLYhHExnyerrk1klksSL+ThuJA= + /parse-json/2.2.0: + dependencies: + error-ex: 1.3.1 + dev: true + resolution: + integrity: sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + /parse-ms/1.0.1: + dev: true + resolution: + integrity: sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0= + /path-exists/2.1.0: + dependencies: + pinkie-promise: 2.0.1 + dev: true + resolution: + integrity: sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= /path-is-absolute/1.0.1: resolution: integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + /path-type/1.1.0: + dependencies: + graceful-fs: 4.1.11 + pify: 2.3.0 + pinkie-promise: 2.0.1 + dev: true + resolution: + integrity: sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= /pify/2.3.0: resolution: integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + /pinkie-promise/2.0.1: + dependencies: + pinkie: 2.0.4 + dev: true + resolution: + integrity: sha1-ITXW36ejWMBprJsXh3YogihFD/o= + /pinkie/2.0.4: + dev: true + resolution: + integrity: sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + /plur/1.0.0: + dev: true + resolution: + integrity: sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY= /pnpm-logger/0.3.0: dependencies: bole: 3.0.2 @@ -264,9 +1405,65 @@ packages: write-file-atomic: 2.1.0 resolution: integrity: sha512-mFMdm0fCmh+kwxmGVD8Bl5QO4E7h/SCWdayKRtdzexHon0nN7YNkEz/llj1lHrb99pzQmE4NCI6BEvTYP/XeIg== + /prepend-http/1.0.4: + dev: true + resolution: + integrity: sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= + /pretty-ms/2.1.0: + dependencies: + is-finite: 1.0.2 + parse-ms: 1.0.1 + plur: 1.0.0 + dev: true + resolution: + integrity: sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw= + /private/0.1.7: + dev: true + resolution: + integrity: sha1-aM5eih7woju1cMwoU3tTMqumPvE= + /process-nextick-args/1.0.7: + dev: true + resolution: + integrity: sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= + /promise.prototype.finally/1.0.1: + dev: true + resolution: + integrity: sha1-kRgvkckkhplXQPoF4NqUKsmGvvo= + /pseudomap/1.0.2: + dev: true + resolution: + integrity: sha1-8FKijacOYYkX7wqKw0wa5aaChrM= /ramda/0.24.1: resolution: integrity: sha1-w7d1UZfzW43DUCIoJixMkd22uFc= + /rc/1.2.1: + dependencies: + deep-extend: 0.4.2 + ini: 1.3.4 + minimist: 1.2.0 + strip-json-comments: 2.0.1 + dev: true + resolution: + integrity: sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU= + /rcfile/1.0.3: + dependencies: + debug: 2.6.8 + js-yaml: 3.9.0 + json5: 0.5.1 + object-assign: 4.1.1 + object-keys: 1.0.11 + path-exists: 2.1.0 + require-uncached: 1.0.3 + dev: true + resolution: + integrity: sha1-wdgXXCiRh8Hci7OpY7bURAF7FXY= + /read-all-stream/3.1.0: + dependencies: + pinkie-promise: 2.0.1 + readable-stream: 2.3.3 + dev: true + resolution: + integrity: sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po= /read-package-json/2.0.10: dependencies: glob: 7.1.2 @@ -276,6 +1473,126 @@ packages: graceful-fs: 4.1.11 resolution: integrity: sha512-iNWaEs9hW9nviu5rHADmkm/Ob5dvah5zajtTS1XbyERSzkWgSwWZ6Z12bION7bEAzVc2YRFWnAz8k/tAr+5/eg== + /read-pkg-up/1.0.1: + dependencies: + find-up: 1.1.2 + read-pkg: 1.1.0 + dev: true + resolution: + integrity: sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + /read-pkg/1.1.0: + dependencies: + load-json-file: 1.1.0 + normalize-package-data: 2.4.0 + path-type: 1.1.0 + dev: true + resolution: + integrity: sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + /readable-stream/2.3.3: + dependencies: + core-util-is: 1.0.2 + inherits: 2.0.3 + isarray: 1.0.0 + process-nextick-args: 1.0.7 + safe-buffer: 5.1.1 + string_decoder: 1.0.3 + util-deprecate: 1.0.2 + dev: true + resolution: + integrity: sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ== + /redent/1.0.0: + dependencies: + indent-string: 2.1.0 + strip-indent: 1.0.1 + dev: true + resolution: + integrity: sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94= + /regenerator-runtime/0.10.5: + dev: true + resolution: + integrity: sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= + /registry-auth-token/3.3.1: + dependencies: + rc: 1.2.1 + safe-buffer: 5.1.1 + dev: true + resolution: + integrity: sha1-+w0yie4Nmtosu1KvXf5mywcNMAY= + /registry-url/3.1.0: + dependencies: + rc: 1.2.1 + dev: true + resolution: + integrity: sha1-PU74cPc93h138M+aOBQyRE4XSUI= + /relative/3.0.2: + dependencies: + isobject: 2.1.0 + dev: true + resolution: + integrity: sha1-Dc2OxUpdNaPBXhBFA9ZTdbWlNn8= + /remi-runner/1.1.3: + dependencies: + babel-runtime: 6.23.0 + is-promise: 2.1.0 + dev: true + resolution: + integrity: sha1-Dh/tS9DxMlwnNeZTHRM5EnM/fmw= + /remi/1.1.1: + dependencies: + babel-runtime: 6.23.0 + magic-hook: 1.0.0 + dev: true + resolution: + integrity: sha1-Rxt5AU16SWvboB0BihJvj3ctiMY= + /remove-trailing-separator/1.0.2: + dev: true + resolution: + integrity: sha1-abBi2XhyetFNxrVrpKt3L9jXBRE= + /repeat-string/1.6.1: + dev: true + resolution: + integrity: sha1-jcrkcOHIirwtYA//Sndihtp15jc= + /repeating/2.0.1: + dependencies: + is-finite: 1.0.2 + dev: true + resolution: + integrity: sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + /require-uncached/1.0.3: + dependencies: + caller-path: 0.1.0 + resolve-from: 1.0.1 + dev: true + resolution: + integrity: sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= + /reserved-words/0.1.1: + dev: true + resolution: + integrity: sha1-b3wV5eVhTFDalhYw2kat3IfAzvI= + /resolve-cwd/1.0.0: + dependencies: + resolve-from: 2.0.0 + dev: true + resolution: + integrity: sha1-Tq7qQe0EDRcCRX32SkKysH0kb58= + /resolve-from/1.0.1: + dev: true + resolution: + integrity: sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= + /resolve-from/2.0.0: + dev: true + resolution: + integrity: sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= + /resolve/1.1.7: + dev: true + resolution: + integrity: sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= + /resumer/0.0.0: + dependencies: + through: 2.3.8 + dev: true + resolution: + integrity: sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= /rimraf-then/1.0.1: dependencies: any-promise: 1.3.0 @@ -287,12 +1604,94 @@ packages: glob: 7.1.2 resolution: integrity: sha1-wjOOxkPfeht/5cVPqG9XQopV8z0= + /rollup-plugin-babel/2.4.0: + dependencies: + babel-core: 6.25.0 + babel-plugin-transform-es2015-classes: 6.24.1 + object-assign: 4.1.1 + rollup-pluginutils: 1.5.2 + dev: true + resolution: + integrity: sha1-gqfhZPopFCq9B7UmucfALV6jO70= + /rollup-plugin-includepaths/0.1.2: + dev: true + resolution: + integrity: sha1-VuhDgwmmK5QYnkIIqA+a/BUf3WA= + /rollup-pluginutils/1.5.2: + dependencies: + estree-walker: 0.2.1 + minimatch: 3.0.4 + dev: true + resolution: + integrity: sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg= + /rollup/0.25.8: + dependencies: + chalk: 1.1.3 + minimist: 1.2.0 + source-map-support: 0.3.3 + dev: true + resolution: + integrity: sha1-v2zoO4dRDRY0Ru6qV37WpvxYNeA= + /safe-buffer/5.1.1: + dev: true + resolution: + integrity: sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg== + /semver-diff/2.1.0: + dependencies: + semver: 5.3.0 + dev: true + resolution: + integrity: sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= /semver/5.3.0: resolution: integrity: sha1-myzl094C0XxgEq0yaqa00M9U+U8= + /shieldman/1.2.0: + dev: true + resolution: + integrity: sha1-XaOXMpG1OSvEginLbXhD73M3+lc= + /signal-exit/3.0.2: + dev: true + resolution: + integrity: sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + /slash/1.0.0: + dev: true + resolution: + integrity: sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= /slide/1.1.6: resolution: integrity: sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + /sort-keys/1.1.2: + dependencies: + is-plain-obj: 1.1.0 + dev: true + resolution: + integrity: sha1-RBttTTRnmPG05J6JIK37oOVD+a0= + /source-map-support/0.3.3: + dependencies: + source-map: 0.1.32 + dev: true + resolution: + integrity: sha1-NJAJd9W6PwfHdX7nLnO7GptTdU8= + /source-map-support/0.4.15: + dependencies: + source-map: 0.5.6 + dev: true + resolution: + integrity: sha1-AyAt9lwG0r2MfsI2KhkwVv7407E= + /source-map/0.1.32: + dependencies: + amdefine: 1.0.1 + dev: true + resolution: + integrity: sha1-yLbBZ3l7pHQKjqMyUhYv8IWRsmY= + /source-map/0.5.3: + dev: true + resolution: + integrity: sha1-gmdLhacbC+dsPnQW0V6fUlLrO+A= + /source-map/0.5.6: + dev: true + resolution: + integrity: sha1-dc449SvwczxafwwRjYEzSiu19BI= /spdx-correct/1.0.2: dependencies: spdx-license-ids: 1.2.2 @@ -307,23 +1706,197 @@ packages: /sprintf-js/1.0.3: resolution: integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + /string-width/1.0.2: + dependencies: + code-point-at: 1.1.0 + is-fullwidth-code-point: 1.0.0 + strip-ansi: 3.0.1 + dev: true + resolution: + integrity: sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + /string.prototype.trim/1.1.2: + dependencies: + define-properties: 1.1.2 + es-abstract: 1.7.0 + function-bind: 1.1.0 + dev: true + resolution: + integrity: sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo= + /string_decoder/1.0.3: + dependencies: + safe-buffer: 5.1.1 + dev: true + resolution: + integrity: sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ== + /stringify-entities/1.3.1: + dependencies: + character-entities-html4: 1.1.1 + character-entities-legacy: 1.1.1 + is-alphanumerical: 1.0.0 + is-hexadecimal: 1.0.0 + dev: true + resolution: + integrity: sha1-sVDsLXKsTBtfMktR+2soyc3/BYw= + /strip-ansi/0.3.0: + dependencies: + ansi-regex: 0.2.1 + dev: true + resolution: + integrity: sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA= + /strip-ansi/3.0.1: + dependencies: + ansi-regex: 2.1.1 + dev: true + resolution: + integrity: sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + /strip-bom/2.0.0: + dependencies: + is-utf8: 0.2.1 + dev: true + resolution: + integrity: sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= /strip-bom/3.0.0: resolution: integrity: sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + /strip-indent/1.0.1: + dependencies: + get-stdin: 4.0.1 + dev: true + resolution: + integrity: sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI= + /strip-json-comments/2.0.1: + dev: true + resolution: + integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo= + /supports-color/0.2.0: + dev: true + resolution: + integrity: sha1-2S3iaU6z9nMjlz1649i1W0wiGQo= + /supports-color/2.0.0: + dev: true + resolution: + integrity: sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= /supports-color/4.2.0: dependencies: has-flag: 2.0.0 resolution: integrity: sha512-Ts0Mu/A1S1aZxEJNG88I4Oc9rcZSBFNac5e27yh4j2mqbhZSSzR1Ah79EYwSn9Zuh7lrlGD2cVGzw1RKGzyLSg== + /tap-parser/1.3.2: + dependencies: + events-to-array: 1.1.2 + inherits: 2.0.3 + js-yaml: 3.9.0 + dev: true + optionalDependencies: + readable-stream: 2.3.3 + resolution: + integrity: sha1-EgxQiciMPIp5PvKIhn3jIeGPjCI= + /tape/4.5.1: + dependencies: + deep-equal: 1.0.1 + defined: 1.0.0 + function-bind: 1.1.0 + glob: 7.0.6 + has: 1.0.1 + inherits: 2.0.3 + minimist: 1.2.0 + object-inspect: 1.1.0 + resolve: 1.1.7 + resumer: 0.0.0 + string.prototype.trim: 1.1.2 + through: 2.3.8 + dev: true + resolution: + integrity: sha1-K7PqGb3J9SJSF7P5fL95hsxMbow= + /the-argv/1.0.0: + dev: true + resolution: + integrity: sha1-AIRwUAVzDdhNt1UlPJMa45jblSI= /thenify/3.3.0: dependencies: any-promise: 1.3.0 resolution: integrity: sha1-5p44obq+lpsBCCB5eLn2K4hgSDk= + /through/2.3.8: + dev: true + resolution: + integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + /through2/2.0.3: + dependencies: + readable-stream: 2.3.3 + xtend: 4.0.1 + dev: true + resolution: + integrity: sha1-AARWmzfHx0ujnEPzzteNGtlBQL4= + /timed-out/3.1.3: + dev: true + resolution: + integrity: sha1-lYYL/MXHbCd/j4Mm/Q9bLiDrohc= + /to-fast-properties/1.0.3: + dev: true + resolution: + integrity: sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + /trim-newlines/1.0.0: + dev: true + resolution: + integrity: sha1-WIeWa7WCpFA6QetST301ARgVphM= + /trim-right/1.0.1: + dev: true + resolution: + integrity: sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + /trim-trailing-lines/1.1.0: + dev: true + resolution: + integrity: sha1-eu+7eAjfnWafbaLkOMrIxGradoQ= + /trim/0.0.1: + dev: true + resolution: + integrity: sha1-WFhUf2spB1fulczMZm+1AITEYN0= /typescript/2.4.1: dev: true resolution: integrity: sha1-w8yxbdqgsjFN4DHn5v7onlujRrw= + /unist-util-remove-position/1.1.1: + dependencies: + unist-util-visit: 1.1.3 + dev: true + resolution: + integrity: sha1-WoXBVV/BugwQG4ZwfRXlD6TIcbs= + /unist-util-visit/1.1.3: + dev: true + resolution: + integrity: sha1-7CaOcxudJ3p5pbWqBkOZDkBdYAs= + /unzip-response/1.0.2: + dev: true + resolution: + integrity: sha1-uYTwh3/AqJwsdzzB73tbIytbBv4= + /update-notifier/0.7.0: + dependencies: + ansi-align: 1.1.0 + boxen: 0.5.1 + chalk: 1.1.3 + configstore: 2.1.0 + is-npm: 1.0.0 + latest-version: 2.0.0 + semver-diff: 2.1.0 + xdg-basedir: 2.0.0 + dev: true + resolution: + integrity: sha1-FDxFMzg9CJCO9wVGIGOV/htauwY= + /url-parse-lax/1.0.0: + dependencies: + prepend-http: 1.0.4 + dev: true + resolution: + integrity: sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= + /util-deprecate/1.0.2: + dev: true + resolution: + integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + /uuid/2.0.3: + dev: true + resolution: + integrity: sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho= /validate-npm-package-license/3.0.1: dependencies: spdx-correct: 1.0.2 @@ -335,9 +1908,29 @@ packages: builtins: 1.0.3 resolution: integrity: sha1-X6kS2B630MdK/BQN5zF/DKffQ34= + /which/1.2.14: + dependencies: + isexe: 2.0.0 + dev: true + resolution: + integrity: sha1-mofEN48D6CfOyvGs31bHNsAcFOU= + /widest-line/1.0.0: + dependencies: + string-width: 1.0.2 + dev: true + resolution: + integrity: sha1-DAnIXCqUaD0Nfq+O4JfVZL8OEFw= /wrappy/1.0.2: resolution: integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + /write-file-atomic/1.3.4: + dependencies: + graceful-fs: 4.1.11 + imurmurhash: 0.1.4 + slide: 1.1.6 + dev: true + resolution: + integrity: sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8= /write-file-atomic/2.1.0: dependencies: graceful-fs: 4.1.11 @@ -345,6 +1938,38 @@ packages: slide: 1.1.6 resolution: integrity: sha512-0TZ20a+xcIl4u0+Mj5xDH2yOWdmQiXlKf9Hm+TgDXjTMsEYb+gDrmb8e8UNAzMCitX8NBqG4Z/FUQIyzv/R1JQ== + /write-json-file/1.2.0: + dependencies: + graceful-fs: 4.1.11 + mkdirp: 0.5.1 + object-assign: 4.1.1 + pify: 2.3.0 + pinkie-promise: 2.0.1 + sort-keys: 1.1.2 + write-file-atomic: 1.3.4 + dev: true + resolution: + integrity: sha1-LV3+lqvDyIkFfJOXGqQAXvtUgTQ= + /write-pkg/1.0.0: + dependencies: + write-json-file: 1.2.0 + dev: true + resolution: + integrity: sha1-rriqnU14jh2JPfsIVJaLVDqRn1c= + /xdg-basedir/2.0.0: + dependencies: + os-homedir: 1.0.2 + dev: true + resolution: + integrity: sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I= + /xtend/4.0.1: + dev: true + resolution: + integrity: sha1-pcbVMr5lbiPbgg77lDofBJmNY68= + /yallist/2.1.2: + dev: true + resolution: + integrity: sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= registry: 'https://registry.npmjs.org/' shrinkwrapVersion: 3 specifiers: @@ -354,6 +1979,8 @@ specifiers: archy: ^1.0.0 chalk: ^2.0.1 dependencies-hierarchy: ^1.0.0 + mos: ^2.0.0-alpha.3 + mos-plugin-readme: ^1.0.4 npm-package-arg: ^5.1.2 p-limit: ^1.1.0 read-package-json: ^2.0.10 diff --git a/src/index.ts b/src/index.ts index 5f6248619e..c1c2879df8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,7 @@ const _readPkg = thenify(readPkgCB) const readPkg = (pkgPath: string) => limitPkgReads(() => _readPkg(pkgPath)) export default async function ( + projectPath: string, args: string[], opts: { depth?: number, @@ -37,23 +38,22 @@ export default async function ( } }) - const cwd = process.cwd() const hopts = { depth: opts.depth || 0, only: opts.only, } const tree = searched.length - ? await dhForPackages(searched, cwd, hopts) - : await dh(cwd, hopts) + ? await dhForPackages(searched, projectPath, hopts) + : await dh(projectPath, hopts) const pkg = await readPkg('package.json') const s = archy({ - label: `${pkg.name}@${pkg.version} ${process.cwd()}`, + label: `${pkg.name}@${pkg.version} ${projectPath}`, nodes: await toArchyTree(tree, { long: Boolean(opts.long), - modules: path.join(process.cwd(), 'node_modules') + modules: path.join(projectPath, 'node_modules') }), })