├── .vscode └── launch.json ├── LICENSE ├── README.md ├── _config.yml ├── build ├── bin │ ├── cache │ │ ├── answer.js │ │ └── staticFile.js │ ├── language │ │ └── lang.js │ ├── log │ │ └── log.js │ ├── option.js │ ├── route │ │ └── route.js │ ├── server.js │ ├── socket │ │ ├── jarvisId.js │ │ ├── jarvisNet.js │ │ ├── jarvisNet.ws.js │ │ └── main.js │ ├── think.js │ ├── thinkInterface.js │ └── tool │ │ ├── contentType.js │ │ ├── copy.js │ │ ├── createfiles.js │ │ ├── form.js │ │ ├── random.js │ │ ├── stak.js │ │ └── tool.js └── option.js ├── docs ├── TestModel.md ├── ruff.md ├── 入门.md ├── 参数.md └── 国际化.md ├── node_modules ├── .bin │ ├── which │ └── which.cmd ├── @types │ └── node │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.d.ts │ │ ├── inspector.d.ts │ │ └── package.json ├── ansi-regex │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── balanced-match │ ├── .npmignore │ ├── LICENSE.md │ ├── README.md │ ├── index.js │ └── package.json ├── brace-expansion │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── camelcase │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── cliui │ ├── CHANGELOG.md │ ├── LICENSE.txt │ ├── README.md │ ├── index.js │ └── package.json ├── code-point-at │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── colors │ ├── LICENSE │ ├── README.md │ ├── examples │ │ ├── normal-usage.js │ │ └── safe-string.js │ ├── index.d.ts │ ├── lib │ │ ├── colors.js │ │ ├── custom │ │ │ ├── trap.js │ │ │ └── zalgo.js │ │ ├── extendStringPrototype.js │ │ ├── index.js │ │ ├── maps │ │ │ ├── america.js │ │ │ ├── rainbow.js │ │ │ ├── random.js │ │ │ └── zebra.js │ │ ├── styles.js │ │ └── system │ │ │ ├── has-flag.js │ │ │ └── supports-colors.js │ ├── package.json │ ├── safe.d.ts │ ├── safe.js │ └── themes │ │ └── generic-logging.js ├── concat-map │ ├── .travis.yml │ ├── LICENSE │ ├── README.markdown │ ├── example │ │ └── map.js │ ├── index.js │ ├── package.json │ └── test │ │ └── map.js ├── cross-spawn │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── enoent.js │ │ ├── parse.js │ │ └── util │ │ │ ├── escapeArgument.js │ │ │ ├── escapeCommand.js │ │ │ ├── hasEmptyArgumentBug.js │ │ │ ├── readShebang.js │ │ │ └── resolveCommand.js │ └── package.json ├── decamelize │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── execa │ ├── index.js │ ├── lib │ │ ├── errname.js │ │ └── stdio.js │ ├── license │ ├── package.json │ └── readme.md ├── find-up │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── fs.realpath │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── old.js │ └── package.json ├── get-caller-file │ ├── README.md │ ├── index.js │ └── package.json ├── get-stream │ ├── buffer-stream.js │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── glob │ ├── LICENSE │ ├── README.md │ ├── changelog.md │ ├── common.js │ ├── glob.js │ ├── package.json │ └── sync.js ├── inflight │ ├── LICENSE │ ├── README.md │ ├── inflight.js │ └── package.json ├── inherits │ ├── LICENSE │ ├── README.md │ ├── inherits.js │ ├── inherits_browser.js │ └── package.json ├── invert-kv │ ├── index.js │ ├── package.json │ └── readme.md ├── is-fullwidth-code-point │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── is-stream │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── isexe │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── mode.js │ ├── package.json │ ├── test │ │ └── basic.js │ └── windows.js ├── lcid │ ├── index.js │ ├── lcid.json │ ├── license │ ├── package.json │ └── readme.md ├── locate-path │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── lru-cache │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── mem │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── mimic-fn │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── minimatch │ ├── LICENSE │ ├── README.md │ ├── minimatch.js │ └── package.json ├── npm-run-path │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── number-is-nan │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── once │ ├── LICENSE │ ├── README.md │ ├── once.js │ └── package.json ├── os-locale │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── p-finally │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── p-limit │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── p-locate │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── p-try │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── path-exists │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── path-is-absolute │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── path-key │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── pseudomap │ ├── LICENSE │ ├── README.md │ ├── map.js │ ├── package.json │ ├── pseudomap.js │ └── test │ │ └── basic.js ├── require-directory │ ├── .jshintrc │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.markdown │ ├── index.js │ └── package.json ├── require-main-filename │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE.txt │ ├── README.md │ ├── index.js │ ├── package.json │ └── test.js ├── set-blocking │ ├── CHANGELOG.md │ ├── LICENSE.txt │ ├── README.md │ ├── index.js │ └── package.json ├── shebang-command │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── shebang-regex │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── signal-exit │ ├── CHANGELOG.md │ ├── LICENSE.txt │ ├── README.md │ ├── index.js │ ├── package.json │ └── signals.js ├── string-width │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── strip-ansi │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── strip-eof │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── which-module │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── which │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── which │ ├── package.json │ └── which.js ├── wrap-ansi │ ├── index.js │ ├── license │ ├── node_modules │ │ ├── ansi-regex │ │ │ ├── index.js │ │ │ ├── license │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── is-fullwidth-code-point │ │ │ ├── index.js │ │ │ ├── license │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── string-width │ │ │ ├── index.js │ │ │ ├── license │ │ │ ├── package.json │ │ │ └── readme.md │ │ └── strip-ansi │ │ │ ├── index.js │ │ │ ├── license │ │ │ ├── package.json │ │ │ └── readme.md │ ├── package.json │ └── readme.md ├── wrappy │ ├── LICENSE │ ├── README.md │ ├── package.json │ └── wrappy.js ├── y18n │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── yallist │ ├── LICENSE │ ├── README.md │ ├── iterator.js │ ├── package.json │ └── yallist.js ├── yargs-parser │ ├── CHANGELOG.md │ ├── LICENSE.txt │ ├── README.md │ ├── index.js │ ├── lib │ │ └── tokenize-arg-string.js │ └── package.json └── yargs │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── completion.sh.hbs │ ├── index.js │ ├── lib │ ├── apply-extends.js │ ├── argsert.js │ ├── command.js │ ├── completion.js │ ├── levenshtein.js │ ├── obj-filter.js │ ├── usage.js │ ├── validation.js │ └── yerror.js │ ├── locales │ ├── be.json │ ├── de.json │ ├── en.json │ ├── es.json │ ├── fr.json │ ├── hi.json │ ├── hu.json │ ├── id.json │ ├── it.json │ ├── ja.json │ ├── ko.json │ ├── nb.json │ ├── nl.json │ ├── nn.json │ ├── pirate.json │ ├── pl.json │ ├── pt.json │ ├── pt_BR.json │ ├── ru.json │ ├── th.json │ ├── tr.json │ ├── zh_CN.json │ └── zh_TW.json │ ├── package.json │ └── yargs.js ├── package-lock.json ├── package.json ├── shell ├── create.js ├── run.js ├── think.js ├── think.json └── uilt │ └── copyFiles.js ├── src ├── bin │ ├── cache │ │ ├── answer.ts │ │ └── staticFile.ts │ ├── console.json │ ├── defaultOption.json │ ├── language │ │ ├── en.json │ │ ├── lang.ts │ │ └── zh.json │ ├── log │ │ ├── log.ts │ │ └── timeZone.json │ ├── option.ts │ ├── route │ │ └── route.ts │ ├── server.ts │ ├── socket │ │ ├── JarvisNet.ts │ │ ├── jarvisId.ts │ │ ├── jarvisNet.ws.ts │ │ └── main.ts │ ├── think.ts │ ├── thinkInterface.ts │ └── tool │ │ ├── contentType.json │ │ ├── contentType.ts │ │ ├── copy.ts │ │ ├── createfiles.ts │ │ ├── form.ts │ │ ├── random.ts │ │ ├── stak.ts │ │ └── tool.ts ├── option.ts └── typings.d.ts ├── tsconfig.json ├── user └── think.js └── www ├── css └── style.css └── index.html /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "run think-node", 11 | "program": "${workspaceFolder}\\bin\\server.js", 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Qu Long Jun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![npm version](https://img.shields.io/npm/v/think-node.svg?style=flat)](https://www.npmjs.com/package/think-node) 2 | [![npm downloads](https://img.shields.io/npm/dt/think-node.svg)](https://www.npmjs.com/package/think-node) 3 | [![npm language](https://img.shields.io/badge/language-nodeJS-red.svg)](https://www.npmjs.com/package/think-node) 4 | 5 | thinkNode是一个免费开源的,快速、简单的面向对象的轻量级Node测试框架 6 | 7 | #### 适用场景 8 | - 如果你需要快速建立一些接口来做测试 9 | - 如果你需要无脑建立一个 http/https 网站 10 | 11 | 12 | #### 如何使用 think-node 13 | [think-node安装入门](https://github.com/mtshen/thinkNode/blob/master/docs/%E5%85%A5%E9%97%A8.md)、 14 | [think-node可配置参数](https://github.com/mtshen/think-node/blob/master/docs/%E5%8F%82%E6%95%B0.md)、 15 | [think-node国际化](https://github.com/mtshen/think-node/blob/master/docs/%E5%9B%BD%E9%99%85%E5%8C%96.md) 16 | [think-node TestModel使用](https://github.com/mtshen/think-node/blob/master/docs/TestModel.md) 17 | [进阶 - think-node硬件开发](https://github.com/mtshen/think-node/blob/master/docs/ruff.md) 18 | ------- 19 | 20 | ### 其他 21 | 22 | **如果你是node小白, 想要学习nodeJS, 你可以试阅读这个项目的代码** 23 | 24 | think-node还提供了更多更强大的功能, **如多核模式、支持https、子域分发、日志系统** 25 | 因此, think-node完全有能力完成中小型网站的建立 26 | 但是我太懒了, 没有写文档, 有人你想尝试这个功能, 可以给我发给信息 mtshen1997@163.com, 我会补齐说明 :-) 27 | 28 | **没错, 皮这一下我很快乐** 29 | 30 | ### think-node 版本更新说明 31 | **自1.1.4版本发布以后, 每个版本迭代都会有更新说明** 32 | 33 | #### 1.1.4 更新说明 34 | - `think create` 命令创建的实例增加了`README.md` 和 `docs/`, 可以更方便的查找使用说明了 35 | - 新增了 `TestModel` 用于快速生成测试数据 36 | - 增加了 `.vscode/` 在 vscode 编辑器下可以直接进行启动服务的操作 37 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-architect -------------------------------------------------------------------------------- /build/bin/cache/staticFile.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | // 启动前先进行cache, 如果是debugger除外 4 | const fs = require("fs"); 5 | const path = require("path"); 6 | const glob_1 = require("glob"); 7 | const think_1 = require("./../think"); 8 | const cluster = require("cluster"); 9 | const CACHE_FILES = {}; 10 | const __ISMASTER = cluster.isMaster; 11 | // 需要的option 12 | const THINK_OPTION = think_1.default.option; 13 | const THINK_OPTION_USER_PATH = THINK_OPTION.path; 14 | const THINK_OPTION_STATIC = THINK_OPTION.staticResource || ['**/*.*']; 15 | const THINK_OPTION_DEBUGGER = THINK_OPTION.debugger; 16 | // 载入用户缓存 17 | if (!THINK_OPTION_DEBUGGER) { 18 | __ISMASTER && console.log(think_1.default.info('loadCache')); 19 | // 取到需要缓存的内容 20 | THINK_OPTION_STATIC.forEach((globPath) => { 21 | glob_1.default(path.join(THINK_OPTION_USER_PATH, globPath), (err, files) => { 22 | // 载入文件 23 | !err && files.forEach((fileName) => { 24 | fs.readFile(fileName, (err, fileData) => { 25 | // 加入缓存: Buffer使用的是内存, 即使大量数据也不会导致node崩溃 26 | !err && (CACHE_FILES[fileName] = new Buffer(fileData)); 27 | }); 28 | }); 29 | }); 30 | }); 31 | } 32 | ; 33 | // 获取缓存内容 34 | think_1.default.getCache = (url, callback) => { 35 | url = path.join(url); 36 | let urlData = CACHE_FILES[url]; 37 | if (urlData !== undefined) { 38 | callback(null, urlData); 39 | } 40 | else { 41 | fs.readFile(url, callback); 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /build/bin/language/lang.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | /** 4 | * 这里是与国际化相关代码, 5 | * 根据用户设置的语言类型, 这里会加载相应的JSON 6 | * 打印信息使用think.info('xxx'); 7 | * 如此可以方便的达到国际化效果 8 | */ 9 | const path = require("path"); 10 | const fs = require("fs"); 11 | const cluster = require("cluster"); 12 | const think_1 = require("./../think"); 13 | const __ISMASTER = cluster.isMaster; 14 | const THINK_LENG_PATH = path.join(__dirname, think_1.default.language + '.json'); 15 | let lengInfo; 16 | if (!fs.existsSync(THINK_LENG_PATH)) { 17 | __ISMASTER && console.log('The loading language failed. The language file did not exist!'.warning); 18 | __ISMASTER && console.log(THINK_LENG_PATH.error); 19 | // 如果没有设置lengPaht或没有找到语言文件, 自动加载zh.json 20 | lengInfo = require(path.join(__dirname, 'zh.json')); 21 | __ISMASTER && console.log(lengInfo['loadLengN'].error); 22 | } 23 | else { 24 | // 如果找到了语言文件, 自动加载 25 | lengInfo = require(THINK_LENG_PATH); 26 | __ISMASTER && console.log(lengInfo['loadLeng']); 27 | __ISMASTER && console.log(' ' + THINK_LENG_PATH.file); 28 | __ISMASTER && console.log(lengInfo['loadLengY']); 29 | } 30 | function info(i) { 31 | let text = lengInfo[i]; 32 | return text || ''; 33 | } 34 | ; 35 | think_1.default.info = info; 36 | exports.default = info; 37 | -------------------------------------------------------------------------------- /build/bin/option.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const path = require("path"); 4 | const think_1 = require("./think"); 5 | // 默认option 6 | think_1.default.option = require(path.join(__dirname, 'defaultOption.json')); 7 | // 引入配置文件 8 | require(path.join(think_1.default.DIR, 'option.js')); 9 | -------------------------------------------------------------------------------- /build/bin/socket/jarvisId.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | /** 4 | * 每次调用获取一个唯一ID 5 | */ 6 | function jarvisId(len, radix) { 7 | const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); 8 | // 默认值 9 | len = len || 8, radix = radix || chars.length; 10 | let uuid = [], index; 11 | for (index = 0; index < len; index++) { 12 | uuid[index] = chars[0 | Math.random() * radix]; 13 | } 14 | return uuid.join(''); 15 | } 16 | exports.default = jarvisId; 17 | -------------------------------------------------------------------------------- /build/bin/thinkInterface.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | ; 4 | -------------------------------------------------------------------------------- /build/bin/tool/contentType.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const CONTENTTYPE = require("./contentType.json"); 4 | /** 5 | * 获取文件对应的contentType值 6 | * @param {string} fileName 文件名或文件路径 7 | */ 8 | exports.contentType = (fileName) => { 9 | for (let key in CONTENTTYPE) 10 | if (fileName.endsWith(key)) 11 | return CONTENTTYPE[key]; 12 | return CONTENTTYPE['+type']; 13 | }; 14 | // 检查文件后缀, 是否该文件应该返回utf-8格式 15 | exports.hasUtf8 = (fileName) => { 16 | return CONTENTTYPE['+utf8'].indexOf(fileName) > -1; 17 | }; 18 | -------------------------------------------------------------------------------- /build/bin/tool/createfiles.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | // 提供了4个API 4 | const fs = require("fs"); 5 | const path = require("path"); 6 | const think_1 = require("./../think"); 7 | // 如果存在则不创建, 如果不存在则创建该文件夹 8 | exports.createFiles = function (url, callback) { 9 | url = path.join(url); 10 | let $url = think_1.default.frontPath(url); 11 | fs.exists($url, function (exis) { 12 | !exis ? 13 | exports.createFiles($url, function () { 14 | fs.exists(url, (ex) => { 15 | !ex && fs.mkdir(url, callback); 16 | }); 17 | }) 18 | : 19 | fs.exists(url, (ex) => { 20 | !ex && fs.mkdir(url, callback); 21 | }); 22 | }); 23 | }; 24 | exports.createFile = function (url, callback) { 25 | url = path.join(url); 26 | let $url = think_1.default.frontPath(url); 27 | exports.createFiles($url, () => { 28 | fs.exists(url, (ex) => { 29 | !ex && fs.writeFile(url, '', callback); 30 | }); 31 | }); 32 | }; 33 | exports.createFilesSync = function (url) { 34 | url = path.join(url); 35 | let $url = think_1.default.frontPath(url); 36 | let exis = fs.existsSync($url); 37 | !exis && exports.createFilesSync($url); 38 | let ex = fs.existsSync(url); 39 | !ex && fs.mkdirSync(url); 40 | }; 41 | exports.createFileSync = function (url) { 42 | url = path.join(url); 43 | let $url = think_1.default.frontPath(url); 44 | this.createFilesSync($url); 45 | let ex = fs.existsSync(url); 46 | !ex && fs.writeFileSync(url, ''); 47 | }; 48 | -------------------------------------------------------------------------------- /build/bin/tool/stak.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | // 任务系统, 通常用于大数据处理 4 | class Stak { 5 | constructor(...staks) { 6 | this.stakList = []; 7 | this.flag = 0; 8 | this.pushStak(...staks); 9 | } 10 | pushStak(...staks) { 11 | staks.forEach(function (stak) { 12 | this.flag < 2 && typeof stak === 'function' && this.stakList.push(stak); 13 | }, this); 14 | } 15 | start() { 16 | this.flag = 1; 17 | this.timer = setInterval(this.timeFn.bind(this), 1); 18 | } 19 | timeFn() { 20 | let stak = this.stakList.shift(); 21 | if (stak) 22 | stak(); 23 | else { 24 | this.timer && clearInterval(this.timer); 25 | this.flag = 2; 26 | this.callback && this.callback(); 27 | } 28 | } 29 | restart() { 30 | this.stakList = []; 31 | this.timer && clearInterval(this.timer); 32 | this.timer = null; 33 | this.flag = 0; 34 | } 35 | } 36 | exports.Stak = Stak; 37 | -------------------------------------------------------------------------------- /docs/ruff.md: -------------------------------------------------------------------------------- 1 | ## think-node 与硬件通信 2 | think-node中包含了一个与ruff/web的socket通信封装, 如果你还不了解什么是ruff, 可以点击[这里](https://ruff.io/zh-cn/)访问ruff官网, 在这里 3 | 4 | ## ruff-server & web-server 5 | 如果你想使用 think-node 快速搭建物联网通信, 你还需要 6 | - 在web端使用 [web-server库]() 来发送/接受socket请求 7 | - 在ruff端使用 [ruff-server库]() 来发送/接受socket请求 8 | 9 | ## 引入 10 | 整个通信全部由`Jarvis`模块完成, 这个模块非常独立, 如果你想单独使用他, 可以直接在项目中拿出来使用 11 | ```js 12 | const { Jarvis } = think; 13 | ``` 14 | 15 | ## 建立web链接 16 | ```js 17 | const jarvis = new Jarvis(8899); // 创建socket, 监听 8899 断开 18 | 19 | // 监听一个socket接口 20 | jarvis.on('getText', function(data) { 21 | // 向发送者响应 'hello world' 22 | return 'hello world'; 23 | }); 24 | 25 | // 发送一个socket信息 26 | jarvis.send('sendText', 'hello world', function(data) { 27 | // 当响应者收到消息之后的响应 28 | console.log(data); 29 | }); 30 | 31 | ``` 32 | 33 | ## 建立ruff链接 34 | ```js 35 | // 创建socket, 监听 8899 断开 36 | // 第二个参数传入true则视为创建ruffsocket 37 | const jarvis = new Jarvis(8899, true); 38 | 39 | // 监听一个socket接口 40 | jarvis.on('getText', function(data) { 41 | // 向发送者响应 'hello world' 42 | return 'hello world'; 43 | }); 44 | 45 | // 发送一个socket信息 46 | jarvis.send('sendText', 'hello world', function(data) { 47 | // 当响应者收到消息之后的响应 48 | console.log(data); 49 | }); 50 | 51 | ``` 52 | 53 | ## think-node 如何做到socket监听通信返回消息的 54 | 协议 55 | 56 | > 标识头(jarvis)*通信ID(ID)*接口(URL)*状态(STATUS):数据集(JSON) 57 | 58 | 正则表达为: 59 | `/^jarvis\*(\w+)\*([\w\\\/\.]+)\*([0-9]{0,3}):(.{0,})$/` 60 | 61 | 62 | **jarvis**: 固定值 `jarvis` 63 | 64 | **ID**: 每次发送随机生成 65 | 66 | **URL**: 传入的url 67 | 68 | **STATUS**: 69 | - 000 发送回应消息 70 | - 001 发送了一个需要回应的请求 71 | - 002 发送了一个不需要回应的请求 72 | 73 | **JSON** 传入的数据 74 | -------------------------------------------------------------------------------- /docs/入门.md: -------------------------------------------------------------------------------- 1 | 在使用think-node前, 你需要安装 `Node` 和 `npm` 2 | 3 | #### 安装 4 | 执行 `npm install think-node -g` 安装think-node 5 | 安装完成后, 执行 `think` 如果打印出版本信息, 则安装成功 6 | 7 | #### 创建 think-node 项目 8 | `think create think-node-demo` 9 | 当看到如下信息, 则安装成功 10 | ``` 11 | $ think create think-node-demo 12 | 13 | +-------+ 14 | | Think | Node | 15 | +------+ 16 | create success! 17 | 18 | Execute a command 19 | cd think-node-demo 20 | npm i 21 | think run 22 | 23 | start ! 24 | ``` 25 | 26 | #### 进入项目 27 | 当安装完成后, 控制台所在目录应该出现了一个think-node-demo的文件夹 28 | 执行`cd think-node-demo`进入文件夹中 29 | 30 | #### 安装依赖 31 | 执行 `npm i` 安装所需依赖 32 | 33 | #### 启动项目 34 | 执行 `think run` 启动项目 -------------------------------------------------------------------------------- /docs/国际化.md: -------------------------------------------------------------------------------- 1 | ## think-node 国际化 2 | 如果你想做一些国际化的操作, 可已在配置文件`/option.js`中进行, 使用`Think.lang(langName)`进行设置 3 | 4 | #### 目前预设了以下语言 5 | 语言名称| 对应的值(langName) 6 | --------|--------- 7 | 中文 | zh 8 | 英文 | en 9 | 10 | 当然, 你可用自己在`./bin/language`中添加新的语言 11 | -------------------------------------------------------------------------------- /node_modules/.bin/which: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") 3 | 4 | case `uname` in 5 | *CYGWIN*) basedir=`cygpath -w "$basedir"`;; 6 | esac 7 | 8 | if [ -x "$basedir/node" ]; then 9 | "$basedir/node" "$basedir/../which/bin/which" "$@" 10 | ret=$? 11 | else 12 | node "$basedir/../which/bin/which" "$@" 13 | ret=$? 14 | fi 15 | exit $ret 16 | -------------------------------------------------------------------------------- /node_modules/.bin/which.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\..\which\bin\which" %* 3 | ) ELSE ( 4 | @SETLOCAL 5 | @SET PATHEXT=%PATHEXT:;.JS;=;% 6 | node "%~dp0\..\which\bin\which" %* 7 | ) -------------------------------------------------------------------------------- /node_modules/@types/node/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /node_modules/@types/node/README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | > `npm install --save @types/node` 3 | 4 | # Summary 5 | This package contains type definitions for Node.js (http://nodejs.org/). 6 | 7 | # Details 8 | Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node 9 | 10 | Additional Details 11 | * Last updated: Wed, 28 Mar 2018 20:38:28 GMT 12 | * Dependencies: none 13 | * Global values: Buffer, NodeJS, SlowBuffer, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, require, setImmediate, setInterval, setTimeout 14 | 15 | # Credits 16 | These definitions were written by Microsoft TypeScript , DefinitelyTyped , Parambir Singh , Christian Vaagland Tellnes , Wilco Bakker , Nicolas Voigt , Chigozirim C. , Flarna , Mariusz Wiktorczyk , wwwy3y3 , Deividas Bakanas , Kelvin Jin , Alvis HT Tang , Oliver Joseph Ash , Sebastian Silbermann , Hannes Magnusson , Alberto Schiabel , Klaus Meinhardt , Huw , Nicolas Even . 17 | -------------------------------------------------------------------------------- /node_modules/ansi-regex/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = () => { 4 | const pattern = [ 5 | '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', 6 | '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' 7 | ].join('|'); 8 | 9 | return new RegExp(pattern, 'g'); 10 | }; 11 | -------------------------------------------------------------------------------- /node_modules/ansi-regex/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /node_modules/balanced-match/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | .gitignore 3 | .travis.yml 4 | Makefile 5 | example.js 6 | -------------------------------------------------------------------------------- /node_modules/balanced-match/LICENSE.md: -------------------------------------------------------------------------------- 1 | (MIT) 2 | 3 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/balanced-match/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = balanced; 3 | function balanced(a, b, str) { 4 | if (a instanceof RegExp) a = maybeMatch(a, str); 5 | if (b instanceof RegExp) b = maybeMatch(b, str); 6 | 7 | var r = range(a, b, str); 8 | 9 | return r && { 10 | start: r[0], 11 | end: r[1], 12 | pre: str.slice(0, r[0]), 13 | body: str.slice(r[0] + a.length, r[1]), 14 | post: str.slice(r[1] + b.length) 15 | }; 16 | } 17 | 18 | function maybeMatch(reg, str) { 19 | var m = str.match(reg); 20 | return m ? m[0] : null; 21 | } 22 | 23 | balanced.range = range; 24 | function range(a, b, str) { 25 | var begs, beg, left, right, result; 26 | var ai = str.indexOf(a); 27 | var bi = str.indexOf(b, ai + 1); 28 | var i = ai; 29 | 30 | if (ai >= 0 && bi > 0) { 31 | begs = []; 32 | left = str.length; 33 | 34 | while (i >= 0 && !result) { 35 | if (i == ai) { 36 | begs.push(i); 37 | ai = str.indexOf(a, i + 1); 38 | } else if (begs.length == 1) { 39 | result = [ begs.pop(), bi ]; 40 | } else { 41 | beg = begs.pop(); 42 | if (beg < left) { 43 | left = beg; 44 | right = bi; 45 | } 46 | 47 | bi = str.indexOf(b, i + 1); 48 | } 49 | 50 | i = ai < bi && ai >= 0 ? ai : bi; 51 | } 52 | 53 | if (begs.length) { 54 | result = [ left, right ]; 55 | } 56 | } 57 | 58 | return result; 59 | } 60 | -------------------------------------------------------------------------------- /node_modules/brace-expansion/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013 Julian Gruber 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/camelcase/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/camelcase/readme.md: -------------------------------------------------------------------------------- 1 | # camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) 2 | 3 | > Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar` 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save camelcase 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const camelCase = require('camelcase'); 17 | 18 | camelCase('foo-bar'); 19 | //=> 'fooBar' 20 | 21 | camelCase('foo_bar'); 22 | //=> 'fooBar' 23 | 24 | camelCase('Foo-Bar'); 25 | //=> 'fooBar' 26 | 27 | camelCase('--foo.bar'); 28 | //=> 'fooBar' 29 | 30 | camelCase('__foo__bar__'); 31 | //=> 'fooBar' 32 | 33 | camelCase('foo bar'); 34 | //=> 'fooBar' 35 | 36 | console.log(process.argv[3]); 37 | //=> '--foo-bar' 38 | camelCase(process.argv[3]); 39 | //=> 'fooBar' 40 | 41 | camelCase('foo', 'bar'); 42 | //=> 'fooBar' 43 | 44 | camelCase('__foo__', '--bar'); 45 | //=> 'fooBar' 46 | ``` 47 | 48 | 49 | ## Related 50 | 51 | - [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module 52 | - [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase 53 | 54 | 55 | ## License 56 | 57 | MIT © [Sindre Sorhus](https://sindresorhus.com) 58 | -------------------------------------------------------------------------------- /node_modules/cliui/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | # [4.0.0](https://github.com/yargs/cliui/compare/v3.2.0...v4.0.0) (2017-12-18) 7 | 8 | 9 | ### Bug Fixes 10 | 11 | * downgrades strip-ansi to version 3.0.1 ([#54](https://github.com/yargs/cliui/issues/54)) ([5764c46](https://github.com/yargs/cliui/commit/5764c46)) 12 | * set env variable FORCE_COLOR. ([#56](https://github.com/yargs/cliui/issues/56)) ([7350e36](https://github.com/yargs/cliui/commit/7350e36)) 13 | 14 | 15 | ### Chores 16 | 17 | * drop support for node < 4 ([#53](https://github.com/yargs/cliui/issues/53)) ([b105376](https://github.com/yargs/cliui/commit/b105376)) 18 | 19 | 20 | ### Features 21 | 22 | * add fallback for window width ([#45](https://github.com/yargs/cliui/issues/45)) ([d064922](https://github.com/yargs/cliui/commit/d064922)) 23 | 24 | 25 | ### BREAKING CHANGES 26 | 27 | * officially drop support for Node < 4 28 | 29 | 30 | 31 | 32 | # [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11) 33 | 34 | 35 | ### Bug Fixes 36 | 37 | * reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33)) 38 | 39 | ### Features 40 | 41 | * adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32)) 42 | -------------------------------------------------------------------------------- /node_modules/cliui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Contributors 2 | 3 | Permission to use, copy, modify, and/or distribute this software 4 | for any purpose with or without fee is hereby granted, provided 5 | that the above copyright notice and this permission notice 6 | appear in all copies. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 10 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 11 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 12 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 13 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 14 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | -------------------------------------------------------------------------------- /node_modules/code-point-at/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable babel/new-cap, xo/throw-new-error */ 2 | 'use strict'; 3 | module.exports = function (str, pos) { 4 | if (str === null || str === undefined) { 5 | throw TypeError(); 6 | } 7 | 8 | str = String(str); 9 | 10 | var size = str.length; 11 | var i = pos ? Number(pos) : 0; 12 | 13 | if (Number.isNaN(i)) { 14 | i = 0; 15 | } 16 | 17 | if (i < 0 || i >= size) { 18 | return undefined; 19 | } 20 | 21 | var first = str.charCodeAt(i); 22 | 23 | if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { 24 | var second = str.charCodeAt(i + 1); 25 | 26 | if (second >= 0xDC00 && second <= 0xDFFF) { 27 | return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000; 28 | } 29 | } 30 | 31 | return first; 32 | }; 33 | -------------------------------------------------------------------------------- /node_modules/code-point-at/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/code-point-at/readme.md: -------------------------------------------------------------------------------- 1 | # code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at) 2 | 3 | > ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) [ponyfill](https://ponyfill.com) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save code-point-at 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var codePointAt = require('code-point-at'); 17 | 18 | codePointAt('🐴'); 19 | //=> 128052 20 | 21 | codePointAt('abc', 2); 22 | //=> 99 23 | ``` 24 | 25 | ## API 26 | 27 | ### codePointAt(input, [position]) 28 | 29 | 30 | ## License 31 | 32 | MIT © [Sindre Sorhus](https://sindresorhus.com) 33 | -------------------------------------------------------------------------------- /node_modules/colors/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Original Library 4 | - Copyright (c) Marak Squires 5 | 6 | Additional Functionality 7 | - Copyright (c) Sindre Sorhus (sindresorhus.com) 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /node_modules/colors/lib/index.js: -------------------------------------------------------------------------------- 1 | var colors = require('./colors'); 2 | module['exports'] = colors; 3 | 4 | // Remark: By default, colors will add style properties to String.prototype 5 | // 6 | // If you don't wish to extend String.prototype you can do this instead and native String will not be touched 7 | // 8 | // var colors = require('colors/safe); 9 | // colors.red("foo") 10 | // 11 | // 12 | require('./extendStringPrototype')(); -------------------------------------------------------------------------------- /node_modules/colors/lib/maps/america.js: -------------------------------------------------------------------------------- 1 | var colors = require('../colors'); 2 | 3 | module['exports'] = (function() { 4 | return function (letter, i, exploded) { 5 | if(letter === " ") return letter; 6 | switch(i%3) { 7 | case 0: return colors.red(letter); 8 | case 1: return colors.white(letter) 9 | case 2: return colors.blue(letter) 10 | } 11 | } 12 | })(); -------------------------------------------------------------------------------- /node_modules/colors/lib/maps/rainbow.js: -------------------------------------------------------------------------------- 1 | var colors = require('../colors'); 2 | 3 | module['exports'] = (function () { 4 | var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV 5 | return function (letter, i, exploded) { 6 | if (letter === " ") { 7 | return letter; 8 | } else { 9 | return colors[rainbowColors[i++ % rainbowColors.length]](letter); 10 | } 11 | }; 12 | })(); 13 | 14 | -------------------------------------------------------------------------------- /node_modules/colors/lib/maps/random.js: -------------------------------------------------------------------------------- 1 | var colors = require('../colors'); 2 | 3 | module['exports'] = (function () { 4 | var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; 5 | return function(letter, i, exploded) { 6 | return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter); 7 | }; 8 | })(); -------------------------------------------------------------------------------- /node_modules/colors/lib/maps/zebra.js: -------------------------------------------------------------------------------- 1 | var colors = require('../colors'); 2 | 3 | module['exports'] = function (letter, i, exploded) { 4 | return i % 2 === 0 ? letter : colors.inverse(letter); 5 | }; -------------------------------------------------------------------------------- /node_modules/colors/lib/system/has-flag.js: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) Sindre Sorhus (sindresorhus.com) 5 | 6 | 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: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | 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. 11 | */ 12 | 13 | 'use strict'; 14 | 15 | module.exports = function (flag, argv) { 16 | argv = argv || process.argv; 17 | 18 | var terminatorPos = argv.indexOf('--'); 19 | var prefix = /^-{1,2}/.test(flag) ? '' : '--'; 20 | var pos = argv.indexOf(prefix + flag); 21 | 22 | return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); 23 | }; 24 | -------------------------------------------------------------------------------- /node_modules/colors/safe.js: -------------------------------------------------------------------------------- 1 | // 2 | // Remark: Requiring this file will use the "safe" colors API which will not touch String.prototype 3 | // 4 | // var colors = require('colors/safe'); 5 | // colors.red("foo") 6 | // 7 | // 8 | var colors = require('./lib/colors'); 9 | module['exports'] = colors; 10 | -------------------------------------------------------------------------------- /node_modules/colors/themes/generic-logging.js: -------------------------------------------------------------------------------- 1 | module['exports'] = { 2 | silly: 'rainbow', 3 | input: 'grey', 4 | verbose: 'cyan', 5 | prompt: 'grey', 6 | info: 'green', 7 | data: 'grey', 8 | help: 'cyan', 9 | warn: 'yellow', 10 | debug: 'blue', 11 | error: 'red' 12 | }; -------------------------------------------------------------------------------- /node_modules/concat-map/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /node_modules/concat-map/LICENSE: -------------------------------------------------------------------------------- 1 | This software is released under the MIT license: 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /node_modules/concat-map/README.markdown: -------------------------------------------------------------------------------- 1 | concat-map 2 | ========== 3 | 4 | Concatenative mapdashery. 5 | 6 | [![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) 7 | 8 | [![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) 9 | 10 | example 11 | ======= 12 | 13 | ``` js 14 | var concatMap = require('concat-map'); 15 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 16 | var ys = concatMap(xs, function (x) { 17 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 18 | }); 19 | console.dir(ys); 20 | ``` 21 | 22 | *** 23 | 24 | ``` 25 | [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] 26 | ``` 27 | 28 | methods 29 | ======= 30 | 31 | ``` js 32 | var concatMap = require('concat-map') 33 | ``` 34 | 35 | concatMap(xs, fn) 36 | ----------------- 37 | 38 | Return an array of concatenated elements by calling `fn(x, i)` for each element 39 | `x` and each index `i` in the array `xs`. 40 | 41 | When `fn(x, i)` returns an array, its result will be concatenated with the 42 | result array. If `fn(x, i)` returns anything else, that value will be pushed 43 | onto the end of the result array. 44 | 45 | install 46 | ======= 47 | 48 | With [npm](http://npmjs.org) do: 49 | 50 | ``` 51 | npm install concat-map 52 | ``` 53 | 54 | license 55 | ======= 56 | 57 | MIT 58 | 59 | notes 60 | ===== 61 | 62 | This module was written while sitting high above the ground in a tree. 63 | -------------------------------------------------------------------------------- /node_modules/concat-map/example/map.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('../'); 2 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 3 | var ys = concatMap(xs, function (x) { 4 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 5 | }); 6 | console.dir(ys); 7 | -------------------------------------------------------------------------------- /node_modules/concat-map/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (xs, fn) { 2 | var res = []; 3 | for (var i = 0; i < xs.length; i++) { 4 | var x = fn(xs[i], i); 5 | if (isArray(x)) res.push.apply(res, x); 6 | else res.push(x); 7 | } 8 | return res; 9 | }; 10 | 11 | var isArray = Array.isArray || function (xs) { 12 | return Object.prototype.toString.call(xs) === '[object Array]'; 13 | }; 14 | -------------------------------------------------------------------------------- /node_modules/concat-map/test/map.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('../'); 2 | var test = require('tape'); 3 | 4 | test('empty or not', function (t) { 5 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 6 | var ixes = []; 7 | var ys = concatMap(xs, function (x, ix) { 8 | ixes.push(ix); 9 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 10 | }); 11 | t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); 12 | t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); 13 | t.end(); 14 | }); 15 | 16 | test('always something', function (t) { 17 | var xs = [ 'a', 'b', 'c', 'd' ]; 18 | var ys = concatMap(xs, function (x) { 19 | return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; 20 | }); 21 | t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); 22 | t.end(); 23 | }); 24 | 25 | test('scalars', function (t) { 26 | var xs = [ 'a', 'b', 'c', 'd' ]; 27 | var ys = concatMap(xs, function (x) { 28 | return x === 'b' ? [ 'B', 'B', 'B' ] : x; 29 | }); 30 | t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); 31 | t.end(); 32 | }); 33 | 34 | test('undefs', function (t) { 35 | var xs = [ 'a', 'b', 'c', 'd' ]; 36 | var ys = concatMap(xs, function () {}); 37 | t.same(ys, [ undefined, undefined, undefined, undefined ]); 38 | t.end(); 39 | }); 40 | -------------------------------------------------------------------------------- /node_modules/cross-spawn/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 5.0.0 - 2016-10-30 2 | 3 | - Add support for `options.shell` 4 | - Improve parsing of shebangs by using [`shebang-command`](https://github.com/kevva/shebang-command) module 5 | - Refactor some code to make it more clear 6 | - Update README caveats 7 | -------------------------------------------------------------------------------- /node_modules/cross-spawn/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 IndigoUnited 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /node_modules/cross-spawn/lib/util/escapeArgument.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function escapeArgument(arg, quote) { 4 | // Convert to string 5 | arg = '' + arg; 6 | 7 | // If we are not going to quote the argument, 8 | // escape shell metacharacters, including double and single quotes: 9 | if (!quote) { 10 | arg = arg.replace(/([()%!^<>&|;,"'\s])/g, '^$1'); 11 | } else { 12 | // Sequence of backslashes followed by a double quote: 13 | // double up all the backslashes and escape the double quote 14 | arg = arg.replace(/(\\*)"/g, '$1$1\\"'); 15 | 16 | // Sequence of backslashes followed by the end of the string 17 | // (which will become a double quote later): 18 | // double up all the backslashes 19 | arg = arg.replace(/(\\*)$/, '$1$1'); 20 | 21 | // All other backslashes occur literally 22 | 23 | // Quote the whole thing: 24 | arg = '"' + arg + '"'; 25 | } 26 | 27 | return arg; 28 | } 29 | 30 | module.exports = escapeArgument; 31 | -------------------------------------------------------------------------------- /node_modules/cross-spawn/lib/util/escapeCommand.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var escapeArgument = require('./escapeArgument'); 4 | 5 | function escapeCommand(command) { 6 | // Do not escape if this command is not dangerous.. 7 | // We do this so that commands like "echo" or "ifconfig" work 8 | // Quoting them, will make them unaccessible 9 | return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true); 10 | } 11 | 12 | module.exports = escapeCommand; 13 | -------------------------------------------------------------------------------- /node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // See: https://github.com/IndigoUnited/node-cross-spawn/pull/34#issuecomment-221623455 4 | function hasEmptyArgumentBug() { 5 | var nodeVer; 6 | 7 | if (process.platform !== 'win32') { 8 | return false; 9 | } 10 | 11 | nodeVer = process.version.substr(1).split('.').map(function (num) { 12 | return parseInt(num, 10); 13 | }); 14 | 15 | return (nodeVer[0] === 0 && nodeVer[1] < 12); 16 | } 17 | 18 | module.exports = hasEmptyArgumentBug(); 19 | -------------------------------------------------------------------------------- /node_modules/cross-spawn/lib/util/readShebang.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var fs = require('fs'); 4 | var LRU = require('lru-cache'); 5 | var shebangCommand = require('shebang-command'); 6 | 7 | var shebangCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec 8 | 9 | function readShebang(command) { 10 | var buffer; 11 | var fd; 12 | var shebang; 13 | 14 | // Check if it is in the cache first 15 | if (shebangCache.has(command)) { 16 | return shebangCache.get(command); 17 | } 18 | 19 | // Read the first 150 bytes from the file 20 | buffer = new Buffer(150); 21 | 22 | try { 23 | fd = fs.openSync(command, 'r'); 24 | fs.readSync(fd, buffer, 0, 150, 0); 25 | fs.closeSync(fd); 26 | } catch (e) { /* empty */ } 27 | 28 | // Attempt to extract shebang (null is returned if not a shebang) 29 | shebang = shebangCommand(buffer.toString()); 30 | 31 | // Store the shebang in the cache 32 | shebangCache.set(command, shebang); 33 | 34 | return shebang; 35 | } 36 | 37 | module.exports = readShebang; 38 | -------------------------------------------------------------------------------- /node_modules/cross-spawn/lib/util/resolveCommand.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'); 4 | var which = require('which'); 5 | var LRU = require('lru-cache'); 6 | 7 | var commandCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec 8 | 9 | function resolveCommand(command, noExtension) { 10 | var resolved; 11 | 12 | noExtension = !!noExtension; 13 | resolved = commandCache.get(command + '!' + noExtension); 14 | 15 | // Check if its resolved in the cache 16 | if (commandCache.has(command)) { 17 | return commandCache.get(command); 18 | } 19 | 20 | try { 21 | resolved = !noExtension ? 22 | which.sync(command) : 23 | which.sync(command, { pathExt: path.delimiter + (process.env.PATHEXT || '') }); 24 | } catch (e) { /* empty */ } 25 | 26 | commandCache.set(command + '!' + noExtension, resolved); 27 | 28 | return resolved; 29 | } 30 | 31 | module.exports = resolveCommand; 32 | -------------------------------------------------------------------------------- /node_modules/decamelize/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = function (str, sep) { 3 | if (typeof str !== 'string') { 4 | throw new TypeError('Expected a string'); 5 | } 6 | 7 | sep = typeof sep === 'undefined' ? '_' : sep; 8 | 9 | return str 10 | .replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2') 11 | .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2') 12 | .toLowerCase(); 13 | }; 14 | -------------------------------------------------------------------------------- /node_modules/decamelize/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/decamelize/readme.md: -------------------------------------------------------------------------------- 1 | # decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize) 2 | 3 | > Convert a camelized string into a lowercased one with a custom separator
4 | > Example: `unicornRainbow` → `unicorn_rainbow` 5 | 6 | 7 | ## Install 8 | 9 | ``` 10 | $ npm install --save decamelize 11 | ``` 12 | 13 | 14 | ## Usage 15 | 16 | ```js 17 | const decamelize = require('decamelize'); 18 | 19 | decamelize('unicornRainbow'); 20 | //=> 'unicorn_rainbow' 21 | 22 | decamelize('unicornRainbow', '-'); 23 | //=> 'unicorn-rainbow' 24 | ``` 25 | 26 | 27 | ## API 28 | 29 | ### decamelize(input, [separator]) 30 | 31 | #### input 32 | 33 | Type: `string` 34 | 35 | #### separator 36 | 37 | Type: `string`
38 | Default: `_` 39 | 40 | 41 | ## Related 42 | 43 | See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse. 44 | 45 | 46 | ## License 47 | 48 | MIT © [Sindre Sorhus](https://sindresorhus.com) 49 | -------------------------------------------------------------------------------- /node_modules/execa/lib/errname.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | // The Node team wants to deprecate `process.bind(...)`. 3 | // https://github.com/nodejs/node/pull/2768 4 | // 5 | // However, we need the 'uv' binding for errname support. 6 | // This is a defensive wrapper around it so `execa` will not fail entirely if it stops working someday. 7 | // 8 | // If this ever stops working. See: https://github.com/sindresorhus/execa/issues/31#issuecomment-215939939 for another possible solution. 9 | let uv; 10 | 11 | try { 12 | uv = process.binding('uv'); 13 | 14 | if (typeof uv.errname !== 'function') { 15 | throw new TypeError('uv.errname is not a function'); 16 | } 17 | } catch (err) { 18 | console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); 19 | uv = null; 20 | } 21 | 22 | function errname(uv, code) { 23 | if (uv) { 24 | return uv.errname(code); 25 | } 26 | 27 | if (!(code < 0)) { 28 | throw new Error('err >= 0'); 29 | } 30 | 31 | return `Unknown system error ${code}`; 32 | } 33 | 34 | module.exports = code => errname(uv, code); 35 | 36 | // Used for testing the fallback behavior 37 | module.exports.__test__ = errname; 38 | -------------------------------------------------------------------------------- /node_modules/execa/lib/stdio.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const alias = ['stdin', 'stdout', 'stderr']; 3 | 4 | const hasAlias = opts => alias.some(x => Boolean(opts[x])); 5 | 6 | module.exports = opts => { 7 | if (!opts) { 8 | return null; 9 | } 10 | 11 | if (opts.stdio && hasAlias(opts)) { 12 | throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); 13 | } 14 | 15 | if (typeof opts.stdio === 'string') { 16 | return opts.stdio; 17 | } 18 | 19 | const stdio = opts.stdio || []; 20 | 21 | if (!Array.isArray(stdio)) { 22 | throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); 23 | } 24 | 25 | const result = []; 26 | const len = Math.max(stdio.length, alias.length); 27 | 28 | for (let i = 0; i < len; i++) { 29 | let value = null; 30 | 31 | if (stdio[i] !== undefined) { 32 | value = stdio[i]; 33 | } else if (opts[alias[i]] !== undefined) { 34 | value = opts[alias[i]]; 35 | } 36 | 37 | result[i] = value; 38 | } 39 | 40 | return result; 41 | }; 42 | -------------------------------------------------------------------------------- /node_modules/execa/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /node_modules/find-up/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const path = require('path'); 3 | const locatePath = require('locate-path'); 4 | 5 | module.exports = (filename, opts) => { 6 | opts = opts || {}; 7 | 8 | const startDir = path.resolve(opts.cwd || ''); 9 | const root = path.parse(startDir).root; 10 | 11 | const filenames = [].concat(filename); 12 | 13 | return new Promise(resolve => { 14 | (function find(dir) { 15 | locatePath(filenames, {cwd: dir}).then(file => { 16 | if (file) { 17 | resolve(path.join(dir, file)); 18 | } else if (dir === root) { 19 | resolve(null); 20 | } else { 21 | find(path.dirname(dir)); 22 | } 23 | }); 24 | })(startDir); 25 | }); 26 | }; 27 | 28 | module.exports.sync = (filename, opts) => { 29 | opts = opts || {}; 30 | 31 | let dir = path.resolve(opts.cwd || ''); 32 | const root = path.parse(dir).root; 33 | 34 | const filenames = [].concat(filename); 35 | 36 | // eslint-disable-next-line no-constant-condition 37 | while (true) { 38 | const file = locatePath.sync(filenames, {cwd: dir}); 39 | 40 | if (file) { 41 | return path.join(dir, file); 42 | } else if (dir === root) { 43 | return null; 44 | } 45 | 46 | dir = path.dirname(dir); 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /node_modules/find-up/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/README.md: -------------------------------------------------------------------------------- 1 | # fs.realpath 2 | 3 | A backwards-compatible fs.realpath for Node v6 and above 4 | 5 | In Node v6, the JavaScript implementation of fs.realpath was replaced 6 | with a faster (but less resilient) native implementation. That raises 7 | new and platform-specific errors and cannot handle long or excessively 8 | symlink-looping paths. 9 | 10 | This module handles those cases by detecting the new errors and 11 | falling back to the JavaScript implementation. On versions of Node 12 | prior to v6, it has no effect. 13 | 14 | ## USAGE 15 | 16 | ```js 17 | var rp = require('fs.realpath') 18 | 19 | // async version 20 | rp.realpath(someLongAndLoopingPath, function (er, real) { 21 | // the ELOOP was handled, but it was a bit slower 22 | }) 23 | 24 | // sync version 25 | var real = rp.realpathSync(someLongAndLoopingPath) 26 | 27 | // monkeypatch at your own risk! 28 | // This replaces the fs.realpath/fs.realpathSync builtins 29 | rp.monkeypatch() 30 | 31 | // un-do the monkeypatching 32 | rp.unmonkeypatch() 33 | ``` 34 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/index.js: -------------------------------------------------------------------------------- 1 | module.exports = realpath 2 | realpath.realpath = realpath 3 | realpath.sync = realpathSync 4 | realpath.realpathSync = realpathSync 5 | realpath.monkeypatch = monkeypatch 6 | realpath.unmonkeypatch = unmonkeypatch 7 | 8 | var fs = require('fs') 9 | var origRealpath = fs.realpath 10 | var origRealpathSync = fs.realpathSync 11 | 12 | var version = process.version 13 | var ok = /^v[0-5]\./.test(version) 14 | var old = require('./old.js') 15 | 16 | function newError (er) { 17 | return er && er.syscall === 'realpath' && ( 18 | er.code === 'ELOOP' || 19 | er.code === 'ENOMEM' || 20 | er.code === 'ENAMETOOLONG' 21 | ) 22 | } 23 | 24 | function realpath (p, cache, cb) { 25 | if (ok) { 26 | return origRealpath(p, cache, cb) 27 | } 28 | 29 | if (typeof cache === 'function') { 30 | cb = cache 31 | cache = null 32 | } 33 | origRealpath(p, cache, function (er, result) { 34 | if (newError(er)) { 35 | old.realpath(p, cache, cb) 36 | } else { 37 | cb(er, result) 38 | } 39 | }) 40 | } 41 | 42 | function realpathSync (p, cache) { 43 | if (ok) { 44 | return origRealpathSync(p, cache) 45 | } 46 | 47 | try { 48 | return origRealpathSync(p, cache) 49 | } catch (er) { 50 | if (newError(er)) { 51 | return old.realpathSync(p, cache) 52 | } else { 53 | throw er 54 | } 55 | } 56 | } 57 | 58 | function monkeypatch () { 59 | fs.realpath = realpath 60 | fs.realpathSync = realpathSync 61 | } 62 | 63 | function unmonkeypatch () { 64 | fs.realpath = origRealpath 65 | fs.realpathSync = origRealpathSync 66 | } 67 | -------------------------------------------------------------------------------- /node_modules/get-caller-file/README.md: -------------------------------------------------------------------------------- 1 | # get-caller-file 2 | 3 | [![Build Status](https://travis-ci.org/ember-cli/ember-cli.svg?branch=master)](https://travis-ci.org/ember-cli/ember-cli) 4 | [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master) 5 | -------------------------------------------------------------------------------- /node_modules/get-caller-file/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Call this function in a another function to find out the file from 4 | // which that function was called from. (Inspects the v8 stack trace) 5 | // 6 | // Inspired by http://stackoverflow.com/questions/13227489 7 | 8 | module.exports = function getCallerFile(_position) { 9 | var oldPrepareStackTrace = Error.prepareStackTrace; 10 | Error.prepareStackTrace = function(err, stack) { return stack; }; 11 | var stack = new Error().stack; 12 | Error.prepareStackTrace = oldPrepareStackTrace; 13 | 14 | var position = _position ? _position : 2; 15 | 16 | // stack[0] holds this file 17 | // stack[1] holds where this function was called 18 | // stack[2] holds the file we're interested in 19 | return stack[position] ? stack[position].getFileName() : undefined; 20 | }; 21 | -------------------------------------------------------------------------------- /node_modules/get-stream/buffer-stream.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const PassThrough = require('stream').PassThrough; 3 | 4 | module.exports = opts => { 5 | opts = Object.assign({}, opts); 6 | 7 | const array = opts.array; 8 | let encoding = opts.encoding; 9 | const buffer = encoding === 'buffer'; 10 | let objectMode = false; 11 | 12 | if (array) { 13 | objectMode = !(encoding || buffer); 14 | } else { 15 | encoding = encoding || 'utf8'; 16 | } 17 | 18 | if (buffer) { 19 | encoding = null; 20 | } 21 | 22 | let len = 0; 23 | const ret = []; 24 | const stream = new PassThrough({objectMode}); 25 | 26 | if (encoding) { 27 | stream.setEncoding(encoding); 28 | } 29 | 30 | stream.on('data', chunk => { 31 | ret.push(chunk); 32 | 33 | if (objectMode) { 34 | len = ret.length; 35 | } else { 36 | len += chunk.length; 37 | } 38 | }); 39 | 40 | stream.getBufferedValue = () => { 41 | if (array) { 42 | return ret; 43 | } 44 | 45 | return buffer ? Buffer.concat(ret, len) : ret.join(''); 46 | }; 47 | 48 | stream.getBufferedLength = () => len; 49 | 50 | return stream; 51 | }; 52 | -------------------------------------------------------------------------------- /node_modules/get-stream/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const bufferStream = require('./buffer-stream'); 3 | 4 | function getStream(inputStream, opts) { 5 | if (!inputStream) { 6 | return Promise.reject(new Error('Expected a stream')); 7 | } 8 | 9 | opts = Object.assign({maxBuffer: Infinity}, opts); 10 | 11 | const maxBuffer = opts.maxBuffer; 12 | let stream; 13 | let clean; 14 | 15 | const p = new Promise((resolve, reject) => { 16 | const error = err => { 17 | if (err) { // null check 18 | err.bufferedData = stream.getBufferedValue(); 19 | } 20 | 21 | reject(err); 22 | }; 23 | 24 | stream = bufferStream(opts); 25 | inputStream.once('error', error); 26 | inputStream.pipe(stream); 27 | 28 | stream.on('data', () => { 29 | if (stream.getBufferedLength() > maxBuffer) { 30 | reject(new Error('maxBuffer exceeded')); 31 | } 32 | }); 33 | stream.once('error', error); 34 | stream.on('end', resolve); 35 | 36 | clean = () => { 37 | // some streams doesn't implement the `stream.Readable` interface correctly 38 | if (inputStream.unpipe) { 39 | inputStream.unpipe(stream); 40 | } 41 | }; 42 | }); 43 | 44 | p.then(clean, clean); 45 | 46 | return p.then(() => stream.getBufferedValue()); 47 | } 48 | 49 | module.exports = getStream; 50 | module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); 51 | module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); 52 | -------------------------------------------------------------------------------- /node_modules/get-stream/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/glob/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/inflight/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/inflight/README.md: -------------------------------------------------------------------------------- 1 | # inflight 2 | 3 | Add callbacks to requests in flight to avoid async duplication 4 | 5 | ## USAGE 6 | 7 | ```javascript 8 | var inflight = require('inflight') 9 | 10 | // some request that does some stuff 11 | function req(key, callback) { 12 | // key is any random string. like a url or filename or whatever. 13 | // 14 | // will return either a falsey value, indicating that the 15 | // request for this key is already in flight, or a new callback 16 | // which when called will call all callbacks passed to inflightk 17 | // with the same key 18 | callback = inflight(key, callback) 19 | 20 | // If we got a falsey value back, then there's already a req going 21 | if (!callback) return 22 | 23 | // this is where you'd fetch the url or whatever 24 | // callback is also once()-ified, so it can safely be assigned 25 | // to multiple events etc. First call wins. 26 | setTimeout(function() { 27 | callback(null, key) 28 | }, 100) 29 | } 30 | 31 | // only assigns a single setTimeout 32 | // when it dings, all cbs get called 33 | req('foo', cb1) 34 | req('foo', cb2) 35 | req('foo', cb3) 36 | req('foo', cb4) 37 | ``` 38 | -------------------------------------------------------------------------------- /node_modules/inflight/inflight.js: -------------------------------------------------------------------------------- 1 | var wrappy = require('wrappy') 2 | var reqs = Object.create(null) 3 | var once = require('once') 4 | 5 | module.exports = wrappy(inflight) 6 | 7 | function inflight (key, cb) { 8 | if (reqs[key]) { 9 | reqs[key].push(cb) 10 | return null 11 | } else { 12 | reqs[key] = [cb] 13 | return makeres(key) 14 | } 15 | } 16 | 17 | function makeres (key) { 18 | return once(function RES () { 19 | var cbs = reqs[key] 20 | var len = cbs.length 21 | var args = slice(arguments) 22 | 23 | // XXX It's somewhat ambiguous whether a new callback added in this 24 | // pass should be queued for later execution if something in the 25 | // list of callbacks throws, or if it should just be discarded. 26 | // However, it's such an edge case that it hardly matters, and either 27 | // choice is likely as surprising as the other. 28 | // As it happens, we do go ahead and schedule it for later execution. 29 | try { 30 | for (var i = 0; i < len; i++) { 31 | cbs[i].apply(null, args) 32 | } 33 | } finally { 34 | if (cbs.length > len) { 35 | // added more in the interim. 36 | // de-zalgo, just in case, but don't call again. 37 | cbs.splice(0, len) 38 | process.nextTick(function () { 39 | RES.apply(null, args) 40 | }) 41 | } else { 42 | delete reqs[key] 43 | } 44 | } 45 | }) 46 | } 47 | 48 | function slice (args) { 49 | var length = args.length 50 | var array = [] 51 | 52 | for (var i = 0; i < length; i++) array[i] = args[i] 53 | return array 54 | } 55 | -------------------------------------------------------------------------------- /node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | try { 2 | var util = require('util'); 3 | if (typeof util.inherits !== 'function') throw ''; 4 | module.exports = util.inherits; 5 | } catch (e) { 6 | module.exports = require('./inherits_browser.js'); 7 | } 8 | -------------------------------------------------------------------------------- /node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | ctor.super_ = superCtor 5 | ctor.prototype = Object.create(superCtor.prototype, { 6 | constructor: { 7 | value: ctor, 8 | enumerable: false, 9 | writable: true, 10 | configurable: true 11 | } 12 | }); 13 | }; 14 | } else { 15 | // old school shim for old browsers 16 | module.exports = function inherits(ctor, superCtor) { 17 | ctor.super_ = superCtor 18 | var TempCtor = function () {} 19 | TempCtor.prototype = superCtor.prototype 20 | ctor.prototype = new TempCtor() 21 | ctor.prototype.constructor = ctor 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/invert-kv/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = function (obj) { 3 | if (typeof obj !== 'object') { 4 | throw new TypeError('Expected an object'); 5 | } 6 | 7 | var ret = {}; 8 | 9 | for (var key in obj) { 10 | var val = obj[key]; 11 | ret[val] = key; 12 | } 13 | 14 | return ret; 15 | }; 16 | -------------------------------------------------------------------------------- /node_modules/invert-kv/readme.md: -------------------------------------------------------------------------------- 1 | # invert-kv [![Build Status](https://travis-ci.org/sindresorhus/invert-kv.svg?branch=master)](https://travis-ci.org/sindresorhus/invert-kv) 2 | 3 | > Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}` 4 | 5 | 6 | ## Install 7 | 8 | ```sh 9 | $ npm install --save invert-kv 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var invertKv = require('invert-kv'); 17 | 18 | invertKv({foo: 'bar', unicorn: 'rainbow'}); 19 | //=> {bar: 'foo', rainbow: 'unicorn'} 20 | ``` 21 | 22 | 23 | ## License 24 | 25 | MIT © [Sindre Sorhus](http://sindresorhus.com) 26 | -------------------------------------------------------------------------------- /node_modules/is-fullwidth-code-point/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /* eslint-disable yoda */ 3 | module.exports = x => { 4 | if (Number.isNaN(x)) { 5 | return false; 6 | } 7 | 8 | // code points are derived from: 9 | // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt 10 | if ( 11 | x >= 0x1100 && ( 12 | x <= 0x115f || // Hangul Jamo 13 | x === 0x2329 || // LEFT-POINTING ANGLE BRACKET 14 | x === 0x232a || // RIGHT-POINTING ANGLE BRACKET 15 | // CJK Radicals Supplement .. Enclosed CJK Letters and Months 16 | (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || 17 | // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A 18 | (0x3250 <= x && x <= 0x4dbf) || 19 | // CJK Unified Ideographs .. Yi Radicals 20 | (0x4e00 <= x && x <= 0xa4c6) || 21 | // Hangul Jamo Extended-A 22 | (0xa960 <= x && x <= 0xa97c) || 23 | // Hangul Syllables 24 | (0xac00 <= x && x <= 0xd7a3) || 25 | // CJK Compatibility Ideographs 26 | (0xf900 <= x && x <= 0xfaff) || 27 | // Vertical Forms 28 | (0xfe10 <= x && x <= 0xfe19) || 29 | // CJK Compatibility Forms .. Small Form Variants 30 | (0xfe30 <= x && x <= 0xfe6b) || 31 | // Halfwidth and Fullwidth Forms 32 | (0xff01 <= x && x <= 0xff60) || 33 | (0xffe0 <= x && x <= 0xffe6) || 34 | // Kana Supplement 35 | (0x1b000 <= x && x <= 0x1b001) || 36 | // Enclosed Ideographic Supplement 37 | (0x1f200 <= x && x <= 0x1f251) || 38 | // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane 39 | (0x20000 <= x && x <= 0x3fffd) 40 | ) 41 | ) { 42 | return true; 43 | } 44 | 45 | return false; 46 | }; 47 | -------------------------------------------------------------------------------- /node_modules/is-fullwidth-code-point/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/is-fullwidth-code-point/readme.md: -------------------------------------------------------------------------------- 1 | # is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) 2 | 3 | > Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save is-fullwidth-code-point 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const isFullwidthCodePoint = require('is-fullwidth-code-point'); 17 | 18 | isFullwidthCodePoint('谢'.codePointAt()); 19 | //=> true 20 | 21 | isFullwidthCodePoint('a'.codePointAt()); 22 | //=> false 23 | ``` 24 | 25 | 26 | ## API 27 | 28 | ### isFullwidthCodePoint(input) 29 | 30 | #### input 31 | 32 | Type: `number` 33 | 34 | [Code point](https://en.wikipedia.org/wiki/Code_point) of a character. 35 | 36 | 37 | ## License 38 | 39 | MIT © [Sindre Sorhus](https://sindresorhus.com) 40 | -------------------------------------------------------------------------------- /node_modules/is-stream/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var isStream = module.exports = function (stream) { 4 | return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; 5 | }; 6 | 7 | isStream.writable = function (stream) { 8 | return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; 9 | }; 10 | 11 | isStream.readable = function (stream) { 12 | return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; 13 | }; 14 | 15 | isStream.duplex = function (stream) { 16 | return isStream.writable(stream) && isStream.readable(stream); 17 | }; 18 | 19 | isStream.transform = function (stream) { 20 | return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; 21 | }; 22 | -------------------------------------------------------------------------------- /node_modules/is-stream/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/is-stream/readme.md: -------------------------------------------------------------------------------- 1 | # is-stream [![Build Status](https://travis-ci.org/sindresorhus/is-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/is-stream) 2 | 3 | > Check if something is a [Node.js stream](https://nodejs.org/api/stream.html) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save is-stream 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const fs = require('fs'); 17 | const isStream = require('is-stream'); 18 | 19 | isStream(fs.createReadStream('unicorn.png')); 20 | //=> true 21 | 22 | isStream({}); 23 | //=> false 24 | ``` 25 | 26 | 27 | ## API 28 | 29 | ### isStream(stream) 30 | 31 | #### isStream.writable(stream) 32 | 33 | #### isStream.readable(stream) 34 | 35 | #### isStream.duplex(stream) 36 | 37 | #### isStream.transform(stream) 38 | 39 | 40 | ## License 41 | 42 | MIT © [Sindre Sorhus](https://sindresorhus.com) 43 | -------------------------------------------------------------------------------- /node_modules/isexe/.npmignore: -------------------------------------------------------------------------------- 1 | .nyc_output/ 2 | coverage/ 3 | -------------------------------------------------------------------------------- /node_modules/isexe/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/isexe/README.md: -------------------------------------------------------------------------------- 1 | # isexe 2 | 3 | Minimal module to check if a file is executable, and a normal file. 4 | 5 | Uses `fs.stat` and tests against the `PATHEXT` environment variable on 6 | Windows. 7 | 8 | ## USAGE 9 | 10 | ```javascript 11 | var isexe = require('isexe') 12 | isexe('some-file-name', function (err, isExe) { 13 | if (err) { 14 | console.error('probably file does not exist or something', err) 15 | } else if (isExe) { 16 | console.error('this thing can be run') 17 | } else { 18 | console.error('cannot be run') 19 | } 20 | }) 21 | 22 | // same thing but synchronous, throws errors 23 | var isExe = isexe.sync('some-file-name') 24 | 25 | // treat errors as just "not executable" 26 | isexe('maybe-missing-file', { ignoreErrors: true }, callback) 27 | var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) 28 | ``` 29 | 30 | ## API 31 | 32 | ### `isexe(path, [options], [callback])` 33 | 34 | Check if the path is executable. If no callback provided, and a 35 | global `Promise` object is available, then a Promise will be returned. 36 | 37 | Will raise whatever errors may be raised by `fs.stat`, unless 38 | `options.ignoreErrors` is set to true. 39 | 40 | ### `isexe.sync(path, [options])` 41 | 42 | Same as `isexe` but returns the value and throws any errors raised. 43 | 44 | ### Options 45 | 46 | * `ignoreErrors` Treat all errors as "no, this is not executable", but 47 | don't raise them. 48 | * `uid` Number to use as the user id 49 | * `gid` Number to use as the group id 50 | * `pathExt` List of path extensions to use instead of `PATHEXT` 51 | environment variable on Windows. 52 | -------------------------------------------------------------------------------- /node_modules/isexe/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs') 2 | var core 3 | if (process.platform === 'win32' || global.TESTING_WINDOWS) { 4 | core = require('./windows.js') 5 | } else { 6 | core = require('./mode.js') 7 | } 8 | 9 | module.exports = isexe 10 | isexe.sync = sync 11 | 12 | function isexe (path, options, cb) { 13 | if (typeof options === 'function') { 14 | cb = options 15 | options = {} 16 | } 17 | 18 | if (!cb) { 19 | if (typeof Promise !== 'function') { 20 | throw new TypeError('callback not provided') 21 | } 22 | 23 | return new Promise(function (resolve, reject) { 24 | isexe(path, options || {}, function (er, is) { 25 | if (er) { 26 | reject(er) 27 | } else { 28 | resolve(is) 29 | } 30 | }) 31 | }) 32 | } 33 | 34 | core(path, options || {}, function (er, is) { 35 | // ignore EACCES because that just means we aren't allowed to run it 36 | if (er) { 37 | if (er.code === 'EACCES' || options && options.ignoreErrors) { 38 | er = null 39 | is = false 40 | } 41 | } 42 | cb(er, is) 43 | }) 44 | } 45 | 46 | function sync (path, options) { 47 | // my kingdom for a filtered catch 48 | try { 49 | return core.sync(path, options || {}) 50 | } catch (er) { 51 | if (options && options.ignoreErrors || er.code === 'EACCES') { 52 | return false 53 | } else { 54 | throw er 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /node_modules/isexe/mode.js: -------------------------------------------------------------------------------- 1 | module.exports = isexe 2 | isexe.sync = sync 3 | 4 | var fs = require('fs') 5 | 6 | function isexe (path, options, cb) { 7 | fs.stat(path, function (er, stat) { 8 | cb(er, er ? false : checkStat(stat, options)) 9 | }) 10 | } 11 | 12 | function sync (path, options) { 13 | return checkStat(fs.statSync(path), options) 14 | } 15 | 16 | function checkStat (stat, options) { 17 | return stat.isFile() && checkMode(stat, options) 18 | } 19 | 20 | function checkMode (stat, options) { 21 | var mod = stat.mode 22 | var uid = stat.uid 23 | var gid = stat.gid 24 | 25 | var myUid = options.uid !== undefined ? 26 | options.uid : process.getuid && process.getuid() 27 | var myGid = options.gid !== undefined ? 28 | options.gid : process.getgid && process.getgid() 29 | 30 | var u = parseInt('100', 8) 31 | var g = parseInt('010', 8) 32 | var o = parseInt('001', 8) 33 | var ug = u | g 34 | 35 | var ret = (mod & o) || 36 | (mod & g) && gid === myGid || 37 | (mod & u) && uid === myUid || 38 | (mod & ug) && myUid === 0 39 | 40 | return ret 41 | } 42 | -------------------------------------------------------------------------------- /node_modules/isexe/windows.js: -------------------------------------------------------------------------------- 1 | module.exports = isexe 2 | isexe.sync = sync 3 | 4 | var fs = require('fs') 5 | 6 | function checkPathExt (path, options) { 7 | var pathext = options.pathExt !== undefined ? 8 | options.pathExt : process.env.PATHEXT 9 | 10 | if (!pathext) { 11 | return true 12 | } 13 | 14 | pathext = pathext.split(';') 15 | if (pathext.indexOf('') !== -1) { 16 | return true 17 | } 18 | for (var i = 0; i < pathext.length; i++) { 19 | var p = pathext[i].toLowerCase() 20 | if (p && path.substr(-p.length).toLowerCase() === p) { 21 | return true 22 | } 23 | } 24 | return false 25 | } 26 | 27 | function checkStat (stat, path, options) { 28 | if (!stat.isSymbolicLink() && !stat.isFile()) { 29 | return false 30 | } 31 | return checkPathExt(path, options) 32 | } 33 | 34 | function isexe (path, options, cb) { 35 | fs.stat(path, function (er, stat) { 36 | cb(er, er ? false : checkStat(stat, path, options)) 37 | }) 38 | } 39 | 40 | function sync (path, options) { 41 | return checkStat(fs.statSync(path), path, options) 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/lcid/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var invertKv = require('invert-kv'); 3 | var all = require('./lcid.json'); 4 | var inverted = invertKv(all); 5 | 6 | exports.from = function (lcidCode) { 7 | if (typeof lcidCode !== 'number') { 8 | throw new TypeError('Expected a number'); 9 | } 10 | 11 | return inverted[lcidCode]; 12 | }; 13 | 14 | exports.to = function (localeId) { 15 | if (typeof localeId !== 'string') { 16 | throw new TypeError('Expected a string'); 17 | } 18 | 19 | return all[localeId]; 20 | }; 21 | 22 | exports.all = all; 23 | -------------------------------------------------------------------------------- /node_modules/lcid/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/lcid/readme.md: -------------------------------------------------------------------------------- 1 | # lcid [![Build Status](https://travis-ci.org/sindresorhus/lcid.svg?branch=master)](https://travis-ci.org/sindresorhus/lcid) 2 | 3 | > Mapping between [standard locale identifiers](http://en.wikipedia.org/wiki/Locale) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) 4 | 5 | Based on the [mapping](https://github.com/python/cpython/blob/be2a1a76fa43bb1ea1b3577bb5bdd506a2e90e37/Lib/locale.py#L1395-L1604) used in the Python standard library. 6 | 7 | The mapping itself is just a [JSON file](lcid.json) and can be used wherever. 8 | 9 | 10 | ## Install 11 | 12 | ``` 13 | $ npm install --save lcid 14 | ``` 15 | 16 | 17 | ## Usage 18 | 19 | ```js 20 | var lcid = require('lcid'); 21 | 22 | lcid.from(1044); 23 | //=> 'nb_NO' 24 | 25 | lcid.to('nb_NO'); 26 | //=> 1044 27 | 28 | lcid.all; 29 | //=> {'af_ZA': 1078, ...} 30 | ``` 31 | 32 | 33 | ## License 34 | 35 | MIT © [Sindre Sorhus](http://sindresorhus.com) 36 | -------------------------------------------------------------------------------- /node_modules/locate-path/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const path = require('path'); 3 | const pathExists = require('path-exists'); 4 | const pLocate = require('p-locate'); 5 | 6 | module.exports = (iterable, opts) => { 7 | opts = Object.assign({ 8 | cwd: process.cwd() 9 | }, opts); 10 | 11 | return pLocate(iterable, el => pathExists(path.resolve(opts.cwd, el)), opts); 12 | }; 13 | 14 | module.exports.sync = (iterable, opts) => { 15 | opts = Object.assign({ 16 | cwd: process.cwd() 17 | }, opts); 18 | 19 | for (const el of iterable) { 20 | if (pathExists.sync(path.resolve(opts.cwd, el))) { 21 | return el; 22 | } 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /node_modules/locate-path/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/lru-cache/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/mem/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const mimicFn = require('mimic-fn'); 3 | 4 | const cacheStore = new WeakMap(); 5 | 6 | const defaultCacheKey = function (x) { 7 | if (arguments.length === 1 && (x === null || x === undefined || (typeof x !== 'function' && typeof x !== 'object'))) { 8 | return x; 9 | } 10 | 11 | return JSON.stringify(arguments); 12 | }; 13 | 14 | module.exports = (fn, opts) => { 15 | opts = Object.assign({ 16 | cacheKey: defaultCacheKey, 17 | cache: new Map() 18 | }, opts); 19 | 20 | const memoized = function () { 21 | const cache = cacheStore.get(memoized); 22 | const key = opts.cacheKey.apply(null, arguments); 23 | 24 | if (cache.has(key)) { 25 | const c = cache.get(key); 26 | 27 | if (typeof opts.maxAge !== 'number' || Date.now() < c.maxAge) { 28 | return c.data; 29 | } 30 | } 31 | 32 | const ret = fn.apply(null, arguments); 33 | 34 | cache.set(key, { 35 | data: ret, 36 | maxAge: Date.now() + (opts.maxAge || 0) 37 | }); 38 | 39 | return ret; 40 | }; 41 | 42 | mimicFn(memoized, fn); 43 | 44 | cacheStore.set(memoized, opts.cache); 45 | 46 | return memoized; 47 | }; 48 | 49 | module.exports.clear = fn => { 50 | const cache = cacheStore.get(fn); 51 | 52 | if (cache && typeof cache.clear === 'function') { 53 | cache.clear(); 54 | } 55 | }; 56 | -------------------------------------------------------------------------------- /node_modules/mem/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/mimic-fn/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = (to, from) => { 3 | // TODO: use `Reflect.ownKeys()` when targeting Node.js 6 4 | for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) { 5 | Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); 6 | } 7 | 8 | return to; 9 | }; 10 | -------------------------------------------------------------------------------- /node_modules/mimic-fn/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /node_modules/mimic-fn/readme.md: -------------------------------------------------------------------------------- 1 | # mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn) 2 | 3 | > Make a function mimic another one 4 | 5 | Useful when you wrap a function in another function and like to preserve the original name and other properties. 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install mimic-fn 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | const mimicFn = require('mimic-fn'); 19 | 20 | function foo() {} 21 | foo.unicorn = '🦄'; 22 | 23 | function wrapper() { 24 | return foo() {}; 25 | } 26 | 27 | console.log(wrapper.name); 28 | //=> 'wrapper' 29 | 30 | mimicFn(wrapper, foo); 31 | 32 | console.log(wrapper.name); 33 | //=> 'foo' 34 | 35 | console.log(wrapper.unicorn); 36 | //=> '🦄' 37 | ``` 38 | 39 | 40 | ## API 41 | 42 | It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set. 43 | 44 | ### mimicFn(to, from) 45 | 46 | It will modify `to` and return it. 47 | 48 | #### to 49 | 50 | Type: `Function` 51 | 52 | Mimicking function. 53 | 54 | #### from 55 | 56 | Type: `Function` 57 | 58 | Function to mimic. 59 | 60 | 61 | ## Related 62 | 63 | - [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function 64 | 65 | 66 | ## License 67 | 68 | MIT © [Sindre Sorhus](https://sindresorhus.com) 69 | -------------------------------------------------------------------------------- /node_modules/minimatch/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/npm-run-path/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const path = require('path'); 3 | const pathKey = require('path-key'); 4 | 5 | module.exports = opts => { 6 | opts = Object.assign({ 7 | cwd: process.cwd(), 8 | path: process.env[pathKey()] 9 | }, opts); 10 | 11 | let prev; 12 | let pth = path.resolve(opts.cwd); 13 | const ret = []; 14 | 15 | while (prev !== pth) { 16 | ret.push(path.join(pth, 'node_modules/.bin')); 17 | prev = pth; 18 | pth = path.resolve(pth, '..'); 19 | } 20 | 21 | // ensure the running `node` binary is used 22 | ret.push(path.dirname(process.execPath)); 23 | 24 | return ret.concat(opts.path).join(path.delimiter); 25 | }; 26 | 27 | module.exports.env = opts => { 28 | opts = Object.assign({ 29 | env: process.env 30 | }, opts); 31 | 32 | const env = Object.assign({}, opts.env); 33 | const path = pathKey({env}); 34 | 35 | opts.path = env[path]; 36 | env[path] = module.exports(opts); 37 | 38 | return env; 39 | }; 40 | -------------------------------------------------------------------------------- /node_modules/npm-run-path/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/number-is-nan/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = Number.isNaN || function (x) { 3 | return x !== x; 4 | }; 5 | -------------------------------------------------------------------------------- /node_modules/number-is-nan/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/number-is-nan/readme.md: -------------------------------------------------------------------------------- 1 | # number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) 2 | 3 | > ES2015 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) [ponyfill](https://ponyfill.com) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save number-is-nan 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var numberIsNan = require('number-is-nan'); 17 | 18 | numberIsNan(NaN); 19 | //=> true 20 | 21 | numberIsNan('unicorn'); 22 | //=> false 23 | ``` 24 | 25 | 26 | ## License 27 | 28 | MIT © [Sindre Sorhus](http://sindresorhus.com) 29 | -------------------------------------------------------------------------------- /node_modules/once/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/once/once.js: -------------------------------------------------------------------------------- 1 | var wrappy = require('wrappy') 2 | module.exports = wrappy(once) 3 | module.exports.strict = wrappy(onceStrict) 4 | 5 | once.proto = once(function () { 6 | Object.defineProperty(Function.prototype, 'once', { 7 | value: function () { 8 | return once(this) 9 | }, 10 | configurable: true 11 | }) 12 | 13 | Object.defineProperty(Function.prototype, 'onceStrict', { 14 | value: function () { 15 | return onceStrict(this) 16 | }, 17 | configurable: true 18 | }) 19 | }) 20 | 21 | function once (fn) { 22 | var f = function () { 23 | if (f.called) return f.value 24 | f.called = true 25 | return f.value = fn.apply(this, arguments) 26 | } 27 | f.called = false 28 | return f 29 | } 30 | 31 | function onceStrict (fn) { 32 | var f = function () { 33 | if (f.called) 34 | throw new Error(f.onceError) 35 | f.called = true 36 | return f.value = fn.apply(this, arguments) 37 | } 38 | var name = fn.name || 'Function wrapped with `once`' 39 | f.onceError = name + " shouldn't be called more than once" 40 | f.called = false 41 | return f 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/os-locale/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/os-locale/readme.md: -------------------------------------------------------------------------------- 1 | # os-locale [![Build Status](https://travis-ci.org/sindresorhus/os-locale.svg?branch=master)](https://travis-ci.org/sindresorhus/os-locale) 2 | 3 | > Get the system [locale](https://en.wikipedia.org/wiki/Locale_(computer_software)) 4 | 5 | Useful for localizing your module or app. 6 | 7 | POSIX systems: The returned locale refers to the [`LC_MESSAGE`](http://www.gnu.org/software/libc/manual/html_node/Locale-Categories.html#Locale-Categories) category, suitable for selecting the language used in the user interface for message translation. 8 | 9 | 10 | ## Install 11 | 12 | ``` 13 | $ npm install --save os-locale 14 | ``` 15 | 16 | 17 | ## Usage 18 | 19 | ```js 20 | const osLocale = require('os-locale'); 21 | 22 | osLocale().then(locale => { 23 | console.log(locale); 24 | //=> 'en_US' 25 | }); 26 | ``` 27 | 28 | 29 | ## API 30 | 31 | ### osLocale([options]) 32 | 33 | Returns a `Promise` for the locale. 34 | 35 | ### osLocale.sync([options]) 36 | 37 | Returns the locale. 38 | 39 | #### options 40 | 41 | Type: `Object` 42 | 43 | ##### spawn 44 | 45 | Type: `boolean`
46 | Default: `true` 47 | 48 | Set to `false` to avoid spawning subprocesses and instead only resolve the locale from environment variables. 49 | 50 | 51 | ## License 52 | 53 | MIT © [Sindre Sorhus](https://sindresorhus.com) 54 | -------------------------------------------------------------------------------- /node_modules/p-finally/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = (promise, onFinally) => { 3 | onFinally = onFinally || (() => {}); 4 | 5 | return promise.then( 6 | val => new Promise(resolve => { 7 | resolve(onFinally()); 8 | }).then(() => val), 9 | err => new Promise(resolve => { 10 | resolve(onFinally()); 11 | }).then(() => { 12 | throw err; 13 | }) 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /node_modules/p-finally/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/p-finally/readme.md: -------------------------------------------------------------------------------- 1 | # p-finally [![Build Status](https://travis-ci.org/sindresorhus/p-finally.svg?branch=master)](https://travis-ci.org/sindresorhus/p-finally) 2 | 3 | > [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome 4 | 5 | Useful for cleanup. 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install --save p-finally 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | const pFinally = require('p-finally'); 19 | 20 | const dir = createTempDir(); 21 | 22 | pFinally(write(dir), () => cleanup(dir)); 23 | ``` 24 | 25 | 26 | ## API 27 | 28 | ### pFinally(promise, [onFinally]) 29 | 30 | Returns a `Promise`. 31 | 32 | #### onFinally 33 | 34 | Type: `Function` 35 | 36 | Note: Throwing or returning a rejected promise will reject `promise` with the rejection reason. 37 | 38 | 39 | ## Related 40 | 41 | - [p-try](https://github.com/sindresorhus/p-try) - `Promise#try()` ponyfill - Starts a promise chain 42 | - [More…](https://github.com/sindresorhus/promise-fun) 43 | 44 | 45 | ## License 46 | 47 | MIT © [Sindre Sorhus](https://sindresorhus.com) 48 | -------------------------------------------------------------------------------- /node_modules/p-limit/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const pTry = require('p-try'); 3 | 4 | module.exports = concurrency => { 5 | if (concurrency < 1) { 6 | throw new TypeError('Expected `concurrency` to be a number from 1 and up'); 7 | } 8 | 9 | const queue = []; 10 | let activeCount = 0; 11 | 12 | const next = () => { 13 | activeCount--; 14 | 15 | if (queue.length > 0) { 16 | queue.shift()(); 17 | } 18 | }; 19 | 20 | return fn => new Promise((resolve, reject) => { 21 | const run = () => { 22 | activeCount++; 23 | 24 | pTry(() => fn()).then( 25 | val => { 26 | resolve(val); 27 | next(); 28 | }, 29 | err => { 30 | reject(err); 31 | next(); 32 | } 33 | ); 34 | }; 35 | 36 | if (activeCount < concurrency) { 37 | run(); 38 | } else { 39 | queue.push(run); 40 | } 41 | }); 42 | }; 43 | -------------------------------------------------------------------------------- /node_modules/p-limit/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /node_modules/p-locate/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const pLimit = require('p-limit'); 3 | 4 | class EndError extends Error { 5 | constructor(value) { 6 | super(); 7 | this.value = value; 8 | } 9 | } 10 | 11 | // the input can also be a promise, so we `Promise.all()` them both 12 | const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0]))); 13 | 14 | module.exports = (iterable, tester, opts) => { 15 | opts = Object.assign({ 16 | concurrency: Infinity, 17 | preserveOrder: true 18 | }, opts); 19 | 20 | const limit = pLimit(opts.concurrency); 21 | 22 | // start all the promises concurrently with optional limit 23 | const items = Array.from(iterable).map(el => [el, limit(() => Promise.resolve(el).then(tester))]); 24 | 25 | // check the promises either serially or concurrently 26 | const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity); 27 | 28 | return Promise.all(items.map(el => checkLimit(() => finder(el)))) 29 | .then(() => {}) 30 | .catch(err => err instanceof EndError ? err.value : Promise.reject(err)); 31 | }; 32 | -------------------------------------------------------------------------------- /node_modules/p-locate/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/p-try/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = cb => new Promise(resolve => { 3 | resolve(cb()); 4 | }); 5 | -------------------------------------------------------------------------------- /node_modules/p-try/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/p-try/readme.md: -------------------------------------------------------------------------------- 1 | # p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) 2 | 3 | > [`Promise#try()`](https://github.com/ljharb/proposal-promise-try) [ponyfill](https://ponyfill.com) - Starts a promise chain 4 | 5 | [How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install --save p-try 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | const pTry = require('p-try'); 19 | 20 | pTry(() => { 21 | return synchronousFunctionThatMightThrow(); 22 | }).then(value => { 23 | console.log(value); 24 | }).catch(error => { 25 | console.error(error); 26 | }); 27 | ``` 28 | 29 | 30 | ## Related 31 | 32 | - [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome 33 | - [More…](https://github.com/sindresorhus/promise-fun) 34 | 35 | 36 | ## License 37 | 38 | MIT © [Sindre Sorhus](https://sindresorhus.com) 39 | -------------------------------------------------------------------------------- /node_modules/path-exists/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const fs = require('fs'); 3 | 4 | module.exports = fp => new Promise(resolve => { 5 | fs.access(fp, err => { 6 | resolve(!err); 7 | }); 8 | }); 9 | 10 | module.exports.sync = fp => { 11 | try { 12 | fs.accessSync(fp); 13 | return true; 14 | } catch (err) { 15 | return false; 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /node_modules/path-exists/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/path-exists/readme.md: -------------------------------------------------------------------------------- 1 | # path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) 2 | 3 | > Check if a path exists 4 | 5 | Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. 6 | 7 | Never use this before handling a file though: 8 | 9 | > In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. 10 | 11 | 12 | ## Install 13 | 14 | ``` 15 | $ npm install --save path-exists 16 | ``` 17 | 18 | 19 | ## Usage 20 | 21 | ```js 22 | // foo.js 23 | const pathExists = require('path-exists'); 24 | 25 | pathExists('foo.js').then(exists => { 26 | console.log(exists); 27 | //=> true 28 | }); 29 | ``` 30 | 31 | 32 | ## API 33 | 34 | ### pathExists(path) 35 | 36 | Returns a promise for a boolean of whether the path exists. 37 | 38 | ### pathExists.sync(path) 39 | 40 | Returns a boolean of whether the path exists. 41 | 42 | 43 | ## Related 44 | 45 | - [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module 46 | 47 | 48 | ## License 49 | 50 | MIT © [Sindre Sorhus](https://sindresorhus.com) 51 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function posix(path) { 4 | return path.charAt(0) === '/'; 5 | } 6 | 7 | function win32(path) { 8 | // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 9 | var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; 10 | var result = splitDeviceRe.exec(path); 11 | var device = result[1] || ''; 12 | var isUnc = Boolean(device && device.charAt(1) !== ':'); 13 | 14 | // UNC paths are always absolute 15 | return Boolean(result[2] || isUnc); 16 | } 17 | 18 | module.exports = process.platform === 'win32' ? win32 : posix; 19 | module.exports.posix = posix; 20 | module.exports.win32 = win32; 21 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/readme.md: -------------------------------------------------------------------------------- 1 | # path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) 2 | 3 | > Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save path-is-absolute 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const pathIsAbsolute = require('path-is-absolute'); 17 | 18 | // Running on Linux 19 | pathIsAbsolute('/home/foo'); 20 | //=> true 21 | pathIsAbsolute('C:/Users/foo'); 22 | //=> false 23 | 24 | // Running on Windows 25 | pathIsAbsolute('C:/Users/foo'); 26 | //=> true 27 | pathIsAbsolute('/home/foo'); 28 | //=> false 29 | 30 | // Running on any OS 31 | pathIsAbsolute.posix('/home/foo'); 32 | //=> true 33 | pathIsAbsolute.posix('C:/Users/foo'); 34 | //=> false 35 | pathIsAbsolute.win32('C:/Users/foo'); 36 | //=> true 37 | pathIsAbsolute.win32('/home/foo'); 38 | //=> false 39 | ``` 40 | 41 | 42 | ## API 43 | 44 | See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). 45 | 46 | ### pathIsAbsolute(path) 47 | 48 | ### pathIsAbsolute.posix(path) 49 | 50 | POSIX specific version. 51 | 52 | ### pathIsAbsolute.win32(path) 53 | 54 | Windows specific version. 55 | 56 | 57 | ## License 58 | 59 | MIT © [Sindre Sorhus](https://sindresorhus.com) 60 | -------------------------------------------------------------------------------- /node_modules/path-key/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = opts => { 3 | opts = opts || {}; 4 | 5 | const env = opts.env || process.env; 6 | const platform = opts.platform || process.platform; 7 | 8 | if (platform !== 'win32') { 9 | return 'PATH'; 10 | } 11 | 12 | return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; 13 | }; 14 | -------------------------------------------------------------------------------- /node_modules/path-key/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/path-key/readme.md: -------------------------------------------------------------------------------- 1 | # path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) 2 | 3 | > Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform 4 | 5 | It's usually `PATH`, but on Windows it can be any casing like `Path`... 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install --save path-key 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | const pathKey = require('path-key'); 19 | 20 | const key = pathKey(); 21 | //=> 'PATH' 22 | 23 | const PATH = process.env[key]; 24 | //=> '/usr/local/bin:/usr/bin:/bin' 25 | ``` 26 | 27 | 28 | ## API 29 | 30 | ### pathKey([options]) 31 | 32 | #### options 33 | 34 | ##### env 35 | 36 | Type: `Object`
37 | Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) 38 | 39 | Use a custom environment variables object. 40 | 41 | #### platform 42 | 43 | Type: `string`
44 | Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) 45 | 46 | Get the PATH key for a specific platform. 47 | 48 | 49 | ## License 50 | 51 | MIT © [Sindre Sorhus](https://sindresorhus.com) 52 | -------------------------------------------------------------------------------- /node_modules/pseudomap/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/pseudomap/map.js: -------------------------------------------------------------------------------- 1 | if (process.env.npm_package_name === 'pseudomap' && 2 | process.env.npm_lifecycle_script === 'test') 3 | process.env.TEST_PSEUDOMAP = 'true' 4 | 5 | if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { 6 | module.exports = Map 7 | } else { 8 | module.exports = require('./pseudomap') 9 | } 10 | -------------------------------------------------------------------------------- /node_modules/require-directory/.npmignore: -------------------------------------------------------------------------------- 1 | test/** 2 | -------------------------------------------------------------------------------- /node_modules/require-directory/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.10 4 | -------------------------------------------------------------------------------- /node_modules/require-directory/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011 Troy Goode 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/require-main-filename/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .nyc_output 4 | -------------------------------------------------------------------------------- /node_modules/require-main-filename/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | os: 3 | - linux 4 | node_js: 5 | - "0.10" 6 | - "0.12" 7 | - "4.1" 8 | - "node" 9 | -------------------------------------------------------------------------------- /node_modules/require-main-filename/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Contributors 2 | 3 | Permission to use, copy, modify, and/or distribute this software 4 | for any purpose with or without fee is hereby granted, provided 5 | that the above copyright notice and this permission notice 6 | appear in all copies. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 10 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 11 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 12 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 13 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 14 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | -------------------------------------------------------------------------------- /node_modules/require-main-filename/README.md: -------------------------------------------------------------------------------- 1 | # require-main-filename 2 | 3 | [![Build Status](https://travis-ci.org/yargs/require-main-filename.png)](https://travis-ci.org/yargs/require-main-filename) 4 | [![Coverage Status](https://coveralls.io/repos/yargs/require-main-filename/badge.svg?branch=master)](https://coveralls.io/r/yargs/require-main-filename?branch=master) 5 | [![NPM version](https://img.shields.io/npm/v/require-main-filename.svg)](https://www.npmjs.com/package/require-main-filename) 6 | 7 | `require.main.filename` is great for figuring out the entry 8 | point for the current application. This can be combined with a module like 9 | [pkg-conf](https://www.npmjs.com/package/pkg-conf) to, _as if by magic_, load 10 | top-level configuration. 11 | 12 | Unfortunately, `require.main.filename` sometimes fails when an application is 13 | executed with an alternative process manager, e.g., [iisnode](https://github.com/tjanczuk/iisnode). 14 | 15 | `require-main-filename` is a shim that addresses this problem. 16 | 17 | ## Usage 18 | 19 | ```js 20 | var main = require('require-main-filename')() 21 | // use main as an alternative to require.main.filename. 22 | ``` 23 | 24 | ## License 25 | 26 | ISC 27 | -------------------------------------------------------------------------------- /node_modules/require-main-filename/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (_require) { 2 | _require = _require || require 3 | var main = _require.main 4 | if (main && isIISNode(main)) return handleIISNode(main) 5 | else return main ? main.filename : process.cwd() 6 | } 7 | 8 | function isIISNode (main) { 9 | return /\\iisnode\\/.test(main.filename) 10 | } 11 | 12 | function handleIISNode (main) { 13 | if (!main.children.length) { 14 | return main.filename 15 | } else { 16 | return main.children[0].filename 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /node_modules/require-main-filename/test.js: -------------------------------------------------------------------------------- 1 | /* global describe, it */ 2 | 3 | var requireMainFilename = require('./') 4 | 5 | require('tap').mochaGlobals() 6 | require('chai').should() 7 | 8 | describe('require-main-filename', function () { 9 | it('returns require.main.filename in normal circumstances', function () { 10 | requireMainFilename().should.match(/test\.js/) 11 | }) 12 | 13 | it('should use children[0].filename when running on iisnode', function () { 14 | var main = { 15 | filename: 'D:\\Program Files (x86)\\iisnode\\interceptor.js', 16 | children: [ {filename: 'D:\\home\\site\\wwwroot\\server.js'} ] 17 | } 18 | requireMainFilename({ 19 | main: main 20 | }).should.match(/server\.js/) 21 | }) 22 | 23 | it('should not use children[0] if no children exist', function () { 24 | var main = { 25 | filename: 'D:\\Program Files (x86)\\iisnode\\interceptor.js', 26 | children: [] 27 | } 28 | requireMainFilename({ 29 | main: main 30 | }).should.match(/interceptor\.js/) 31 | }) 32 | 33 | it('should default to process.cwd() if require.main is undefined', function () { 34 | requireMainFilename({}).should.match(/require-main-filename/) 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /node_modules/set-blocking/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | # [2.0.0](https://github.com/yargs/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17) 7 | 8 | 9 | ### Features 10 | 11 | * add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277)) 12 | 13 | 14 | ### BREAKING CHANGES 15 | 16 | * stdio/stderr will not be set to blocking if isTTY === false 17 | 18 | 19 | 20 | 21 | # 1.0.0 (2016-05-14) 22 | 23 | 24 | ### Features 25 | 26 | * implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0)) 27 | -------------------------------------------------------------------------------- /node_modules/set-blocking/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Contributors 2 | 3 | Permission to use, copy, modify, and/or distribute this software 4 | for any purpose with or without fee is hereby granted, provided 5 | that the above copyright notice and this permission notice 6 | appear in all copies. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 10 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 11 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 12 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 13 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 14 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | -------------------------------------------------------------------------------- /node_modules/set-blocking/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (blocking) { 2 | [process.stdout, process.stderr].forEach(function (stream) { 3 | if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { 4 | stream._handle.setBlocking(blocking) 5 | } 6 | }) 7 | } 8 | -------------------------------------------------------------------------------- /node_modules/shebang-command/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var shebangRegex = require('shebang-regex'); 3 | 4 | module.exports = function (str) { 5 | var match = str.match(shebangRegex); 6 | 7 | if (!match) { 8 | return null; 9 | } 10 | 11 | var arr = match[0].replace(/#! ?/, '').split(' '); 12 | var bin = arr[0].split('/').pop(); 13 | var arg = arr[1]; 14 | 15 | return (bin === 'env' ? 16 | arg : 17 | bin + (arg ? ' ' + arg : '') 18 | ); 19 | }; 20 | -------------------------------------------------------------------------------- /node_modules/shebang-command/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Kevin Martensson (github.com/kevva) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/shebang-command/readme.md: -------------------------------------------------------------------------------- 1 | # shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command) 2 | 3 | > Get the command from a shebang 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save shebang-command 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const shebangCommand = require('shebang-command'); 17 | 18 | shebangCommand('#!/usr/bin/env node'); 19 | //=> 'node' 20 | 21 | shebangCommand('#!/bin/bash'); 22 | //=> 'bash' 23 | ``` 24 | 25 | 26 | ## API 27 | 28 | ### shebangCommand(string) 29 | 30 | #### string 31 | 32 | Type: `string` 33 | 34 | String containing a shebang. 35 | 36 | 37 | ## License 38 | 39 | MIT © [Kevin Martensson](http://github.com/kevva) 40 | -------------------------------------------------------------------------------- /node_modules/shebang-regex/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = /^#!.*/; 3 | -------------------------------------------------------------------------------- /node_modules/shebang-regex/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/shebang-regex/readme.md: -------------------------------------------------------------------------------- 1 | # shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) 2 | 3 | > Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save shebang-regex 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var shebangRegex = require('shebang-regex'); 17 | var str = '#!/usr/bin/env node\nconsole.log("unicorns");'; 18 | 19 | shebangRegex.test(str); 20 | //=> true 21 | 22 | shebangRegex.exec(str)[0]; 23 | //=> '#!/usr/bin/env node' 24 | ``` 25 | 26 | 27 | ## License 28 | 29 | MIT © [Sindre Sorhus](http://sindresorhus.com) 30 | -------------------------------------------------------------------------------- /node_modules/signal-exit/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | ## [3.0.1](https://github.com/tapjs/signal-exit/compare/v3.0.0...v3.0.1) (2016-09-08) 7 | 8 | 9 | ### Bug Fixes 10 | 11 | * do not listen on SIGBUS, SIGFPE, SIGSEGV and SIGILL ([#40](https://github.com/tapjs/signal-exit/issues/40)) ([5b105fb](https://github.com/tapjs/signal-exit/commit/5b105fb)) 12 | 13 | 14 | 15 | 16 | # [3.0.0](https://github.com/tapjs/signal-exit/compare/v2.1.2...v3.0.0) (2016-06-13) 17 | 18 | 19 | ### Bug Fixes 20 | 21 | * get our test suite running on Windows ([#23](https://github.com/tapjs/signal-exit/issues/23)) ([6f3eda8](https://github.com/tapjs/signal-exit/commit/6f3eda8)) 22 | * hooking SIGPROF was interfering with profilers see [#21](https://github.com/tapjs/signal-exit/issues/21) ([#24](https://github.com/tapjs/signal-exit/issues/24)) ([1248a4c](https://github.com/tapjs/signal-exit/commit/1248a4c)) 23 | 24 | 25 | ### BREAKING CHANGES 26 | 27 | * signal-exit no longer wires into SIGPROF 28 | -------------------------------------------------------------------------------- /node_modules/signal-exit/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) 2015, Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software 6 | for any purpose with or without fee is hereby granted, provided 7 | that the above copyright notice and this permission notice 8 | appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 12 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 13 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 14 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 15 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 16 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | -------------------------------------------------------------------------------- /node_modules/signal-exit/signals.js: -------------------------------------------------------------------------------- 1 | // This is not the set of all possible signals. 2 | // 3 | // It IS, however, the set of all signals that trigger 4 | // an exit on either Linux or BSD systems. Linux is a 5 | // superset of the signal names supported on BSD, and 6 | // the unknown signals just fail to register, so we can 7 | // catch that easily enough. 8 | // 9 | // Don't bother with SIGKILL. It's uncatchable, which 10 | // means that we can't fire any callbacks anyway. 11 | // 12 | // If a user does happen to register a handler on a non- 13 | // fatal signal like SIGWINCH or something, and then 14 | // exit, it'll end up firing `process.emit('exit')`, so 15 | // the handler will be fired anyway. 16 | // 17 | // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised 18 | // artificially, inherently leave the process in a 19 | // state from which it is not safe to try and enter JS 20 | // listeners. 21 | module.exports = [ 22 | 'SIGABRT', 23 | 'SIGALRM', 24 | 'SIGHUP', 25 | 'SIGINT', 26 | 'SIGTERM' 27 | ] 28 | 29 | if (process.platform !== 'win32') { 30 | module.exports.push( 31 | 'SIGVTALRM', 32 | 'SIGXCPU', 33 | 'SIGXFSZ', 34 | 'SIGUSR2', 35 | 'SIGTRAP', 36 | 'SIGSYS', 37 | 'SIGQUIT', 38 | 'SIGIOT' 39 | // should detect profiler and enable/disable accordingly. 40 | // see #21 41 | // 'SIGPROF' 42 | ) 43 | } 44 | 45 | if (process.platform === 'linux') { 46 | module.exports.push( 47 | 'SIGIO', 48 | 'SIGPOLL', 49 | 'SIGPWR', 50 | 'SIGSTKFLT', 51 | 'SIGUNUSED' 52 | ) 53 | } 54 | -------------------------------------------------------------------------------- /node_modules/string-width/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const stripAnsi = require('strip-ansi'); 3 | const isFullwidthCodePoint = require('is-fullwidth-code-point'); 4 | 5 | module.exports = str => { 6 | if (typeof str !== 'string' || str.length === 0) { 7 | return 0; 8 | } 9 | 10 | str = stripAnsi(str); 11 | 12 | let width = 0; 13 | 14 | for (let i = 0; i < str.length; i++) { 15 | const code = str.codePointAt(i); 16 | 17 | // Ignore control characters 18 | if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { 19 | continue; 20 | } 21 | 22 | // Ignore combining characters 23 | if (code >= 0x300 && code <= 0x36F) { 24 | continue; 25 | } 26 | 27 | // Surrogates 28 | if (code > 0xFFFF) { 29 | i++; 30 | } 31 | 32 | width += isFullwidthCodePoint(code) ? 2 : 1; 33 | } 34 | 35 | return width; 36 | }; 37 | -------------------------------------------------------------------------------- /node_modules/string-width/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /node_modules/string-width/readme.md: -------------------------------------------------------------------------------- 1 | # string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) 2 | 3 | > Get the visual width of a string - the number of columns required to display it 4 | 5 | Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. 6 | 7 | Useful to be able to measure the actual width of command-line output. 8 | 9 | 10 | ## Install 11 | 12 | ``` 13 | $ npm install string-width 14 | ``` 15 | 16 | 17 | ## Usage 18 | 19 | ```js 20 | const stringWidth = require('string-width'); 21 | 22 | stringWidth('古'); 23 | //=> 2 24 | 25 | stringWidth('\u001b[1m古\u001b[22m'); 26 | //=> 2 27 | 28 | stringWidth('a'); 29 | //=> 1 30 | ``` 31 | 32 | 33 | ## Related 34 | 35 | - [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module 36 | - [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string 37 | - [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string 38 | 39 | 40 | ## License 41 | 42 | MIT © [Sindre Sorhus](https://sindresorhus.com) 43 | -------------------------------------------------------------------------------- /node_modules/strip-ansi/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const ansiRegex = require('ansi-regex'); 3 | 4 | module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; 5 | -------------------------------------------------------------------------------- /node_modules/strip-ansi/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /node_modules/strip-ansi/readme.md: -------------------------------------------------------------------------------- 1 | # strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) 2 | 3 | > Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install strip-ansi 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const stripAnsi = require('strip-ansi'); 17 | 18 | stripAnsi('\u001B[4mUnicorn\u001B[0m'); 19 | //=> 'Unicorn' 20 | ``` 21 | 22 | 23 | ## Related 24 | 25 | - [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module 26 | - [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes 27 | - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes 28 | - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right 29 | 30 | 31 | ## Maintainers 32 | 33 | - [Sindre Sorhus](https://github.com/sindresorhus) 34 | - [Josh Junon](https://github.com/qix-) 35 | 36 | 37 | ## License 38 | 39 | MIT 40 | -------------------------------------------------------------------------------- /node_modules/strip-eof/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = function (x) { 3 | var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); 4 | var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); 5 | 6 | if (x[x.length - 1] === lf) { 7 | x = x.slice(0, x.length - 1); 8 | } 9 | 10 | if (x[x.length - 1] === cr) { 11 | x = x.slice(0, x.length - 1); 12 | } 13 | 14 | return x; 15 | }; 16 | -------------------------------------------------------------------------------- /node_modules/strip-eof/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/strip-eof/readme.md: -------------------------------------------------------------------------------- 1 | # strip-eof [![Build Status](https://travis-ci.org/sindresorhus/strip-eof.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-eof) 2 | 3 | > Strip the [End-Of-File](https://en.wikipedia.org/wiki/End-of-file) (EOF) character from a string/buffer 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save strip-eof 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const stripEof = require('strip-eof'); 17 | 18 | stripEof('foo\nbar\n\n'); 19 | //=> 'foo\nbar\n' 20 | 21 | stripEof(new Buffer('foo\nbar\n\n')).toString(); 22 | //=> 'foo\nbar\n' 23 | ``` 24 | 25 | 26 | ## License 27 | 28 | MIT © [Sindre Sorhus](http://sindresorhus.com) 29 | -------------------------------------------------------------------------------- /node_modules/which-module/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | # [2.0.0](https://github.com/nexdrew/which-module/compare/v1.0.0...v2.0.0) (2017-05-01) 7 | 8 | 9 | ### Features 10 | 11 | * remove Node < 4 from official testing/support ([#22](https://github.com/nexdrew/which-module/issues/22)) ([ee7aff4](https://github.com/nexdrew/which-module/commit/ee7aff4)) 12 | 13 | 14 | ### BREAKING CHANGES 15 | 16 | * Node 0.10 or 0.12 no longer supported, please update to Node 4+ or use which-module@1.0.0 17 | 18 | 19 | 20 | 21 | # 1.0.0 (2016-06-06) 22 | 23 | 24 | ### Features 25 | 26 | * initial code ([08074cd](https://github.com/nexdrew/which-module/commit/08074cd)) 27 | -------------------------------------------------------------------------------- /node_modules/which-module/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Contributors 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /node_modules/which-module/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = function whichModule (exported) { 4 | for (var i = 0, files = Object.keys(require.cache), mod; i < files.length; i++) { 5 | mod = require.cache[files[i]] 6 | if (mod.exports === exported) return mod 7 | } 8 | return null 9 | } 10 | -------------------------------------------------------------------------------- /node_modules/which/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/which/README.md: -------------------------------------------------------------------------------- 1 | # which 2 | 3 | Like the unix `which` utility. 4 | 5 | Finds the first instance of a specified executable in the PATH 6 | environment variable. Does not cache the results, so `hash -r` is not 7 | needed when the PATH changes. 8 | 9 | ## USAGE 10 | 11 | ```javascript 12 | var which = require('which') 13 | 14 | // async usage 15 | which('node', function (er, resolvedPath) { 16 | // er is returned if no "node" is found on the PATH 17 | // if it is found, then the absolute path to the exec is returned 18 | }) 19 | 20 | // sync usage 21 | // throws if not found 22 | var resolved = which.sync('node') 23 | 24 | // if nothrow option is used, returns null if not found 25 | resolved = which.sync('node', {nothrow: true}) 26 | 27 | // Pass options to override the PATH and PATHEXT environment vars. 28 | which('node', { path: someOtherPath }, function (er, resolved) { 29 | if (er) 30 | throw er 31 | console.log('found at %j', resolved) 32 | }) 33 | ``` 34 | 35 | ## CLI USAGE 36 | 37 | Same as the BSD `which(1)` binary. 38 | 39 | ``` 40 | usage: which [-as] program ... 41 | ``` 42 | 43 | ## OPTIONS 44 | 45 | You may pass an options object as the second argument. 46 | 47 | - `path`: Use instead of the `PATH` environment variable. 48 | - `pathExt`: Use instead of the `PATHEXT` environment variable. 49 | - `all`: Return all matches, instead of just the first one. Note that 50 | this means the function returns an array of strings instead of a 51 | single string. 52 | -------------------------------------------------------------------------------- /node_modules/which/bin/which: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var which = require("../") 3 | if (process.argv.length < 3) 4 | usage() 5 | 6 | function usage () { 7 | console.error('usage: which [-as] program ...') 8 | process.exit(1) 9 | } 10 | 11 | var all = false 12 | var silent = false 13 | var dashdash = false 14 | var args = process.argv.slice(2).filter(function (arg) { 15 | if (dashdash || !/^-/.test(arg)) 16 | return true 17 | 18 | if (arg === '--') { 19 | dashdash = true 20 | return false 21 | } 22 | 23 | var flags = arg.substr(1).split('') 24 | for (var f = 0; f < flags.length; f++) { 25 | var flag = flags[f] 26 | switch (flag) { 27 | case 's': 28 | silent = true 29 | break 30 | case 'a': 31 | all = true 32 | break 33 | default: 34 | console.error('which: illegal option -- ' + flag) 35 | usage() 36 | } 37 | } 38 | return false 39 | }) 40 | 41 | process.exit(args.reduce(function (pv, current) { 42 | try { 43 | var f = which.sync(current, { all: all }) 44 | if (all) 45 | f = f.join('\n') 46 | if (!silent) 47 | console.log(f) 48 | return pv; 49 | } catch (e) { 50 | return 1; 51 | } 52 | }, 0)) 53 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/ansi-regex/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = function () { 3 | return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; 4 | }; 5 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/ansi-regex/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md: -------------------------------------------------------------------------------- 1 | # is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) 2 | 3 | > Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save is-fullwidth-code-point 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var isFullwidthCodePoint = require('is-fullwidth-code-point'); 17 | 18 | isFullwidthCodePoint('谢'.codePointAt()); 19 | //=> true 20 | 21 | isFullwidthCodePoint('a'.codePointAt()); 22 | //=> false 23 | ``` 24 | 25 | 26 | ## API 27 | 28 | ### isFullwidthCodePoint(input) 29 | 30 | #### input 31 | 32 | Type: `number` 33 | 34 | [Code point](https://en.wikipedia.org/wiki/Code_point) of a character. 35 | 36 | 37 | ## License 38 | 39 | MIT © [Sindre Sorhus](http://sindresorhus.com) 40 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/string-width/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var stripAnsi = require('strip-ansi'); 3 | var codePointAt = require('code-point-at'); 4 | var isFullwidthCodePoint = require('is-fullwidth-code-point'); 5 | 6 | // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 7 | module.exports = function (str) { 8 | if (typeof str !== 'string' || str.length === 0) { 9 | return 0; 10 | } 11 | 12 | var width = 0; 13 | 14 | str = stripAnsi(str); 15 | 16 | for (var i = 0; i < str.length; i++) { 17 | var code = codePointAt(str, i); 18 | 19 | // ignore control characters 20 | if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { 21 | continue; 22 | } 23 | 24 | // surrogates 25 | if (code >= 0x10000) { 26 | i++; 27 | } 28 | 29 | if (isFullwidthCodePoint(code)) { 30 | width += 2; 31 | } else { 32 | width++; 33 | } 34 | } 35 | 36 | return width; 37 | }; 38 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/string-width/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/string-width/readme.md: -------------------------------------------------------------------------------- 1 | # string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) 2 | 3 | > Get the visual width of a string - the number of columns required to display it 4 | 5 | Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. 6 | 7 | Useful to be able to measure the actual width of command-line output. 8 | 9 | 10 | ## Install 11 | 12 | ``` 13 | $ npm install --save string-width 14 | ``` 15 | 16 | 17 | ## Usage 18 | 19 | ```js 20 | const stringWidth = require('string-width'); 21 | 22 | stringWidth('古'); 23 | //=> 2 24 | 25 | stringWidth('\u001b[1m古\u001b[22m'); 26 | //=> 2 27 | 28 | stringWidth('a'); 29 | //=> 1 30 | ``` 31 | 32 | 33 | ## Related 34 | 35 | - [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module 36 | - [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string 37 | - [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string 38 | 39 | 40 | ## License 41 | 42 | MIT © [Sindre Sorhus](https://sindresorhus.com) 43 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/strip-ansi/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var ansiRegex = require('ansi-regex')(); 3 | 4 | module.exports = function (str) { 5 | return typeof str === 'string' ? str.replace(ansiRegex, '') : str; 6 | }; 7 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/strip-ansi/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/wrap-ansi/node_modules/strip-ansi/readme.md: -------------------------------------------------------------------------------- 1 | # strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) 2 | 3 | > Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save strip-ansi 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | var stripAnsi = require('strip-ansi'); 17 | 18 | stripAnsi('\u001b[4mcake\u001b[0m'); 19 | //=> 'cake' 20 | ``` 21 | 22 | 23 | ## Related 24 | 25 | - [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module 26 | - [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes 27 | - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes 28 | - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right 29 | 30 | 31 | ## License 32 | 33 | MIT © [Sindre Sorhus](http://sindresorhus.com) 34 | -------------------------------------------------------------------------------- /node_modules/wrappy/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/wrappy/README.md: -------------------------------------------------------------------------------- 1 | # wrappy 2 | 3 | Callback wrapping utility 4 | 5 | ## USAGE 6 | 7 | ```javascript 8 | var wrappy = require("wrappy") 9 | 10 | // var wrapper = wrappy(wrapperFunction) 11 | 12 | // make sure a cb is called only once 13 | // See also: http://npm.im/once for this specific use case 14 | var once = wrappy(function (cb) { 15 | var called = false 16 | return function () { 17 | if (called) return 18 | called = true 19 | return cb.apply(this, arguments) 20 | } 21 | }) 22 | 23 | function printBoo () { 24 | console.log('boo') 25 | } 26 | // has some rando property 27 | printBoo.iAmBooPrinter = true 28 | 29 | var onlyPrintOnce = once(printBoo) 30 | 31 | onlyPrintOnce() // prints 'boo' 32 | onlyPrintOnce() // does nothing 33 | 34 | // random property is retained! 35 | assert.equal(onlyPrintOnce.iAmBooPrinter, true) 36 | ``` 37 | -------------------------------------------------------------------------------- /node_modules/wrappy/wrappy.js: -------------------------------------------------------------------------------- 1 | // Returns a wrapper function that returns a wrapped callback 2 | // The wrapper function should do some stuff, and return a 3 | // presumably different callback function. 4 | // This makes sure that own properties are retained, so that 5 | // decorations and such are not lost along the way. 6 | module.exports = wrappy 7 | function wrappy (fn, cb) { 8 | if (fn && cb) return wrappy(fn)(cb) 9 | 10 | if (typeof fn !== 'function') 11 | throw new TypeError('need wrapper function') 12 | 13 | Object.keys(fn).forEach(function (k) { 14 | wrapper[k] = fn[k] 15 | }) 16 | 17 | return wrapper 18 | 19 | function wrapper() { 20 | var args = new Array(arguments.length) 21 | for (var i = 0; i < args.length; i++) { 22 | args[i] = arguments[i] 23 | } 24 | var ret = fn.apply(this, args) 25 | var cb = args[args.length-1] 26 | if (typeof ret === 'function' && ret !== cb) { 27 | Object.keys(cb).forEach(function (k) { 28 | ret[k] = cb[k] 29 | }) 30 | } 31 | return ret 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/y18n/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Contributors 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /node_modules/yallist/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/yallist/iterator.js: -------------------------------------------------------------------------------- 1 | var Yallist = require('./yallist.js') 2 | 3 | Yallist.prototype[Symbol.iterator] = function* () { 4 | for (let walker = this.head; walker; walker = walker.next) { 5 | yield walker.value 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /node_modules/yargs-parser/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Contributors 2 | 3 | Permission to use, copy, modify, and/or distribute this software 4 | for any purpose with or without fee is hereby granted, provided 5 | that the above copyright notice and this permission notice 6 | appear in all copies. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 10 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 11 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 12 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 13 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 14 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | -------------------------------------------------------------------------------- /node_modules/yargs-parser/lib/tokenize-arg-string.js: -------------------------------------------------------------------------------- 1 | // take an un-split argv string and tokenize it. 2 | module.exports = function (argString) { 3 | if (Array.isArray(argString)) return argString 4 | 5 | argString = argString.trim() 6 | 7 | var i = 0 8 | var prevC = null 9 | var c = null 10 | var opening = null 11 | var args = [] 12 | 13 | for (var ii = 0; ii < argString.length; ii++) { 14 | prevC = c 15 | c = argString.charAt(ii) 16 | 17 | // split on spaces unless we're in quotes. 18 | if (c === ' ' && !opening) { 19 | if (!(prevC === ' ')) { 20 | i++ 21 | } 22 | continue 23 | } 24 | 25 | // don't split the string if we're in matching 26 | // opening or closing single and double quotes. 27 | if (c === opening) { 28 | opening = null 29 | continue 30 | } else if ((c === "'" || c === '"') && !opening) { 31 | opening = c 32 | continue 33 | } 34 | 35 | if (!args[i]) args[i] = '' 36 | args[i] += c 37 | } 38 | 39 | return args 40 | } 41 | -------------------------------------------------------------------------------- /node_modules/yargs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 James Halliday (mail@substack.net) 2 | Modified work Copyright 2014 Contributors (ben@npmjs.com) 3 | 4 | This project is free software released under the MIT/X11 license: 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/yargs/completion.sh.hbs: -------------------------------------------------------------------------------- 1 | ###-begin-{{app_name}}-completions-### 2 | # 3 | # yargs command completion script 4 | # 5 | # Installation: {{app_path}} {{completion_command}} >> ~/.bashrc 6 | # or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. 7 | # 8 | _yargs_completions() 9 | { 10 | local cur_word args type_list 11 | 12 | cur_word="${COMP_WORDS[COMP_CWORD]}" 13 | args=("${COMP_WORDS[@]}") 14 | 15 | # ask yargs to generate completions. 16 | type_list=$({{app_path}} --get-yargs-completions "${args[@]}") 17 | 18 | COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) ) 19 | 20 | # if no match was found, fall back to filename completion 21 | if [ ${#COMPREPLY[@]} -eq 0 ]; then 22 | COMPREPLY=( $(compgen -f -- "${cur_word}" ) ) 23 | fi 24 | 25 | return 0 26 | } 27 | complete -F _yargs_completions {{app_name}} 28 | ###-end-{{app_name}}-completions-### 29 | -------------------------------------------------------------------------------- /node_modules/yargs/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // classic singleton yargs API, to use yargs 3 | // without running as a singleton do: 4 | // require('yargs/yargs')(process.argv.slice(2)) 5 | const yargs = require('./yargs') 6 | 7 | Argv(process.argv.slice(2)) 8 | 9 | module.exports = Argv 10 | 11 | function Argv (processArgs, cwd) { 12 | const argv = yargs(processArgs, cwd, require) 13 | singletonify(argv) 14 | return argv 15 | } 16 | 17 | /* Hack an instance of Argv with process.argv into Argv 18 | so people can do 19 | require('yargs')(['--beeble=1','-z','zizzle']).argv 20 | to parse a list of args and 21 | require('yargs').argv 22 | to get a parsed version of process.argv. 23 | */ 24 | function singletonify (inst) { 25 | Object.keys(inst).forEach((key) => { 26 | if (key === 'argv') { 27 | Argv.__defineGetter__(key, inst.__lookupGetter__(key)) 28 | } else { 29 | Argv[key] = typeof inst[key] === 'function' ? inst[key].bind(inst) : inst[key] 30 | } 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /node_modules/yargs/lib/obj-filter.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = function objFilter (original, filter) { 3 | const obj = {} 4 | filter = filter || ((k, v) => true) 5 | Object.keys(original || {}).forEach((key) => { 6 | if (filter(key, original[key])) { 7 | obj[key] = original[key] 8 | } 9 | }) 10 | return obj 11 | } 12 | -------------------------------------------------------------------------------- /node_modules/yargs/lib/yerror.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | function YError (msg) { 3 | this.name = 'YError' 4 | this.message = msg || 'yargs error' 5 | Error.captureStackTrace(this, YError) 6 | } 7 | 8 | YError.prototype = Object.create(Error.prototype) 9 | YError.prototype.constructor = YError 10 | 11 | module.exports = YError 12 | -------------------------------------------------------------------------------- /node_modules/yargs/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Commands:": "Commandes:", 3 | "Options:": "Options:", 4 | "Examples:": "Exemples:", 5 | "boolean": "booléen", 6 | "count": "comptage", 7 | "string": "chaine de caractère", 8 | "number": "nombre", 9 | "array": "tableau", 10 | "required": "requis", 11 | "default:": "défaut:", 12 | "choices:": "choix:", 13 | "generated-value": "valeur générée", 14 | "Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s", 15 | "Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s", 16 | "Missing argument value: %s": { 17 | "one": "Argument manquant: %s", 18 | "other": "Arguments manquants: %s" 19 | }, 20 | "Missing required argument: %s": { 21 | "one": "Argument requis manquant: %s", 22 | "other": "Arguments requis manquants: %s" 23 | }, 24 | "Unknown argument: %s": { 25 | "one": "Argument inconnu: %s", 26 | "other": "Arguments inconnus: %s" 27 | }, 28 | "Invalid values:": "Valeurs invalides:", 29 | "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s", 30 | "Argument check failed: %s": "Echec de la vérification de l'argument: %s", 31 | "Implications failed:": "Implications échouées:", 32 | "Not enough arguments following: %s": "Pas assez d'arguments suivant: %s", 33 | "Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s", 34 | "Path to JSON config file": "Chemin du fichier de configuration JSON", 35 | "Show help": "Affiche de l'aide", 36 | "Show version number": "Affiche le numéro de version" 37 | } 38 | -------------------------------------------------------------------------------- /node_modules/yargs/locales/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "Commands:": "コマンド:", 3 | "Options:": "オプション:", 4 | "Examples:": "例:", 5 | "boolean": "真偽", 6 | "count": "カウント", 7 | "string": "文字列", 8 | "number": "数値", 9 | "array": "配列", 10 | "required": "必須", 11 | "default:": "デフォルト:", 12 | "choices:": "選択してください:", 13 | "aliases:": "エイリアス:", 14 | "generated-value": "生成された値", 15 | "Not enough non-option arguments: got %s, need at least %s": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:", 16 | "Too many non-option arguments: got %s, maximum of %s": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:", 17 | "Missing argument value: %s": { 18 | "one": "引数が見つかりません: %s", 19 | "other": "引数が見つかりません: %s" 20 | }, 21 | "Missing required argument: %s": { 22 | "one": "必須の引数が見つかりません: %s", 23 | "other": "必須の引数が見つかりません: %s" 24 | }, 25 | "Unknown argument: %s": { 26 | "one": "未知の引数です: %s", 27 | "other": "未知の引数です: %s" 28 | }, 29 | "Invalid values:": "不正な値です:", 30 | "Argument: %s, Given: %s, Choices: %s": "引数は %s です。指定できるのは %s つです。選択してください: %s", 31 | "Argument check failed: %s": "引数のチェックに失敗しました: %s", 32 | "Implications failed:": "オプションの組み合わせで不正が生じました:", 33 | "Not enough arguments following: %s": "次の引数が不足しています。: %s", 34 | "Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s", 35 | "Path to JSON config file": "JSONの設定ファイルまでのpath", 36 | "Show help": "ヘルプを表示", 37 | "Show version number": "バージョンを表示", 38 | "Did you mean %s?": "もしかして %s?", 39 | "Arguments %s and %s are mutually exclusive" : "引数 %s と %s は同時に指定できません", 40 | "Positionals:": "位置:", 41 | "command": "コマンド" 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/yargs/locales/ko.json: -------------------------------------------------------------------------------- 1 | { 2 | "Commands:": "명령:", 3 | "Options:": "옵션:", 4 | "Examples:": "예시:", 5 | "boolean": "여부", 6 | "count": "개수", 7 | "string": "문자열", 8 | "number": "숫자", 9 | "array": "배열", 10 | "required": "필수", 11 | "default:": "기본:", 12 | "choices:": "선택:", 13 | "aliases:": "별칭:", 14 | "generated-value": "생성된 값", 15 | "Not enough non-option arguments: got %s, need at least %s": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다", 16 | "Too many non-option arguments: got %s, maximum of %s": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다", 17 | "Missing argument value: %s": { 18 | "one": "인자값을 받지 못했습니다: %s", 19 | "other": "인자값들을 받지 못했습니다: %s" 20 | }, 21 | "Missing required argument: %s": { 22 | "one": "필수 인자를 받지 못했습니다: %s", 23 | "other": "필수 인자들을 받지 못했습니다: %s" 24 | }, 25 | "Unknown argument: %s": { 26 | "one": "알 수 없는 인자입니다: %s", 27 | "other": "알 수 없는 인자들입니다: %s" 28 | }, 29 | "Invalid values:": "잘못된 값입니다:", 30 | "Argument: %s, Given: %s, Choices: %s": "인자: %s, 입력받은 값: %s, 선택지: %s", 31 | "Argument check failed: %s": "유효하지 않은 인자입니다: %s", 32 | "Implications failed:": "옵션의 조합이 잘못되었습니다:", 33 | "Not enough arguments following: %s": "인자가 충분하게 주어지지 않았습니다: %s", 34 | "Invalid JSON config file: %s": "유효하지 않은 JSON 설정파일입니다: %s", 35 | "Path to JSON config file": "JSON 설정파일 경로", 36 | "Show help": "도움말을 보여줍니다", 37 | "Show version number": "버전 넘버를 보여줍니다", 38 | "Did you mean %s?": "찾고계신게 %s입니까?", 39 | "Arguments %s and %s are mutually exclusive" : "%s와 %s 인자는 같이 사용될 수 없습니다", 40 | "Positionals:": "위치:", 41 | "command": "명령" 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/yargs/locales/nb.json: -------------------------------------------------------------------------------- 1 | { 2 | "Commands:": "Kommandoer:", 3 | "Options:": "Alternativer:", 4 | "Examples:": "Eksempler:", 5 | "boolean": "boolsk", 6 | "count": "antall", 7 | "string": "streng", 8 | "number": "nummer", 9 | "array": "matrise", 10 | "required": "obligatorisk", 11 | "default:": "standard:", 12 | "choices:": "valg:", 13 | "generated-value": "generert-verdi", 14 | "Not enough non-option arguments: got %s, need at least %s": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s", 15 | "Too many non-option arguments: got %s, maximum of %s": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s", 16 | "Missing argument value: %s": { 17 | "one": "Mangler argument verdi: %s", 18 | "other": "Mangler argument verdier: %s" 19 | }, 20 | "Missing required argument: %s": { 21 | "one": "Mangler obligatorisk argument: %s", 22 | "other": "Mangler obligatoriske argumenter: %s" 23 | }, 24 | "Unknown argument: %s": { 25 | "one": "Ukjent argument: %s", 26 | "other": "Ukjente argumenter: %s" 27 | }, 28 | "Invalid values:": "Ugyldige verdier:", 29 | "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s", 30 | "Argument check failed: %s": "Argument sjekk mislyktes: %s", 31 | "Implications failed:": "Konsekvensene mislyktes:", 32 | "Not enough arguments following: %s": "Ikke nok følgende argumenter: %s", 33 | "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", 34 | "Path to JSON config file": "Bane til JSON konfigurasjonsfil", 35 | "Show help": "Vis hjelp", 36 | "Show version number": "Vis versjonsnummer" 37 | } 38 | -------------------------------------------------------------------------------- /node_modules/yargs/locales/nn.json: -------------------------------------------------------------------------------- 1 | { 2 | "Commands:": "Kommandoar:", 3 | "Options:": "Alternativ:", 4 | "Examples:": "Døme:", 5 | "boolean": "boolsk", 6 | "count": "mengd", 7 | "string": "streng", 8 | "number": "nummer", 9 | "array": "matrise", 10 | "required": "obligatorisk", 11 | "default:": "standard:", 12 | "choices:": "val:", 13 | "generated-value": "generert-verdi", 14 | "Not enough non-option arguments: got %s, need at least %s": 15 | "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s", 16 | "Too many non-option arguments: got %s, maximum of %s": 17 | "For mange ikkje-alternativ argument: fekk %s, maksimum %s", 18 | "Missing argument value: %s": { 19 | "one": "Manglar argumentverdi: %s", 20 | "other": "Manglar argumentverdiar: %s" 21 | }, 22 | "Missing required argument: %s": { 23 | "one": "Manglar obligatorisk argument: %s", 24 | "other": "Manglar obligatoriske argument: %s" 25 | }, 26 | "Unknown argument: %s": { 27 | "one": "Ukjent argument: %s", 28 | "other": "Ukjende argument: %s" 29 | }, 30 | "Invalid values:": "Ugyldige verdiar:", 31 | "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gjeve: %s, Val: %s", 32 | "Argument check failed: %s": "Argument sjekk mislukkast: %s", 33 | "Implications failed:": "Konsekvensane mislukkast:", 34 | "Not enough arguments following: %s": "Ikkje nok fylgande argument: %s", 35 | "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", 36 | "Path to JSON config file": "Bane til JSON konfigurasjonsfil", 37 | "Show help": "Vis hjelp", 38 | "Show version number": "Vis versjonsnummer" 39 | } 40 | -------------------------------------------------------------------------------- /node_modules/yargs/locales/pirate.json: -------------------------------------------------------------------------------- 1 | { 2 | "Commands:": "Choose yer command:", 3 | "Options:": "Options for me hearties!", 4 | "Examples:": "Ex. marks the spot:", 5 | "required": "requi-yar-ed", 6 | "Missing required argument: %s": { 7 | "one": "Ye be havin' to set the followin' argument land lubber: %s", 8 | "other": "Ye be havin' to set the followin' arguments land lubber: %s" 9 | }, 10 | "Show help": "Parlay this here code of conduct", 11 | "Show version number": "'Tis the version ye be askin' fer" 12 | } 13 | -------------------------------------------------------------------------------- /node_modules/yargs/locales/zh_CN.json: -------------------------------------------------------------------------------- 1 | { 2 | "Commands:": "命令:", 3 | "Options:": "选项:", 4 | "Examples:": "示例:", 5 | "boolean": "布尔", 6 | "count": "计数", 7 | "string": "字符串", 8 | "number": "数字", 9 | "array": "数组", 10 | "required": "必需", 11 | "default:": "默认值:", 12 | "choices:": "可选值:", 13 | "generated-value": "生成的值", 14 | "Not enough non-option arguments: got %s, need at least %s": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个", 15 | "Too many non-option arguments: got %s, maximum of %s": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个", 16 | "Missing argument value: %s": { 17 | "one": "没有给此选项指定值:%s", 18 | "other": "没有给这些选项指定值:%s" 19 | }, 20 | "Missing required argument: %s": { 21 | "one": "缺少必须的选项:%s", 22 | "other": "缺少这些必须的选项:%s" 23 | }, 24 | "Unknown argument: %s": { 25 | "one": "无法识别的选项:%s", 26 | "other": "无法识别这些选项:%s" 27 | }, 28 | "Invalid values:": "无效的选项值:", 29 | "Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s", 30 | "Argument check failed: %s": "选项值验证失败:%s", 31 | "Implications failed:": "缺少依赖的选项:", 32 | "Not enough arguments following: %s": "没有提供足够的值给此选项:%s", 33 | "Invalid JSON config file: %s": "无效的 JSON 配置文件:%s", 34 | "Path to JSON config file": "JSON 配置文件的路径", 35 | "Show help": "显示帮助信息", 36 | "Show version number": "显示版本号", 37 | "Did you mean %s?": "是指 %s?", 38 | "Arguments %s and %s are mutually exclusive" : "选项 %s 和 %s 是互斥的", 39 | "Positionals:": "位置:", 40 | "command": "命令" 41 | } 42 | -------------------------------------------------------------------------------- /node_modules/yargs/locales/zh_TW.json: -------------------------------------------------------------------------------- 1 | { 2 | "Commands:": "命令:", 3 | "Options:": "選項:", 4 | "Examples:": "例:", 5 | "boolean": "布林", 6 | "count": "次數", 7 | "string": "字串", 8 | "number": "數字", 9 | "array": "陣列", 10 | "required": "必須", 11 | "default:": "預設值:", 12 | "choices:": "可選值:", 13 | "aliases:": "別名:", 14 | "generated-value": "生成的值", 15 | "Not enough non-option arguments: got %s, need at least %s": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個", 16 | "Too many non-option arguments: got %s, maximum of %s": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個", 17 | "Missing argument value: %s": { 18 | "one": "此引數無指定值:%s", 19 | "other": "這些引數無指定值:%s" 20 | }, 21 | "Missing required argument: %s": { 22 | "one": "缺少必須的引數:%s", 23 | "other": "缺少這些必須的引數:%s" 24 | }, 25 | "Unknown argument: %s": { 26 | "one": "未知的引數:%s", 27 | "other": "未知的這些引數:%s" 28 | }, 29 | "Invalid values:": "無效的選項值:", 30 | "Argument: %s, Given: %s, Choices: %s": "引數名稱: %s, 傳入的值: %s, 可選的值:%s", 31 | "Argument check failed: %s": "引數驗證失敗:%s", 32 | "Implications failed:": "缺少依賴的選項:", 33 | "Not enough arguments following: %s": "沒有提供足夠的值給此引數:%s", 34 | "Invalid JSON config file: %s": "無效的 JSON 設置文件:%s", 35 | "Path to JSON config file": "JSON 設置文件的路徑", 36 | "Show help": "顯示說明", 37 | "Show version number": "顯示版本", 38 | "Did you mean %s?": "是指 %s?", 39 | "Arguments %s and %s are mutually exclusive" : "引數 %s 和 %s 是互斥的" 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "think-node", 3 | "version": "1.1.4", 4 | "description": "thinkNode是一个免费开源的,快速、简单的面向对象的轻量级Node开发框架", 5 | "main": "bin/server.js", 6 | "bugs": { 7 | "url": "https://github.com/mtshen/thinkNode", 8 | "email": "mtshen1997@163.com" 9 | }, 10 | "keywords": [ 11 | "thinkNode" 12 | ], 13 | "bin": { 14 | "think": "shell/think.js" 15 | }, 16 | "author": "mtshen", 17 | "devDependencies": { 18 | "@types/node": "^9.6.1", 19 | "colors": "^1.1.2", 20 | "glob": "^7.1.1", 21 | "minimatch": "^3.0.4" 22 | }, 23 | "dependencies": { 24 | "yargs": "^11.0.0" 25 | }, 26 | "bundledDependencies": [ 27 | "yargs", 28 | "minimatch", 29 | "glob", 30 | "colors", 31 | "@types/node" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /shell/run.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const spawn = require('child_process').spawn; 4 | 5 | module.exports = { 6 | name: 'run', 7 | description: 'run thinkNode', 8 | callback: function (yargs) { 9 | // 检查代码完整性 bin/think.js, bin/server.js 10 | let thatUrl = process.cwd(); 11 | let thinkExists = fs.existsSync(path.join(thatUrl, 'bin/think.js')); 12 | let serverExists = fs.existsSync(path.join(thatUrl, 'bin/server.js')); 13 | let nodeModule = fs.existsSync(path.join(thatUrl, 'node_modules')); 14 | if (thinkExists && serverExists) { 15 | runShell('node', [`${thatUrl.replace(/\\/g, '/')}/bin/server`]); 16 | } else { 17 | console.log('Please make sure that you are in the folder created by think'.red); 18 | } 19 | } 20 | }; 21 | 22 | function runShell(shell, parameter) { 23 | free = spawn(shell, parameter || []); 24 | 25 | // 捕获标准输出并将其打印到控制台 26 | free.stdout.on('data', function (data) { 27 | console.log(data.toString()); 28 | }); 29 | 30 | // 捕获标准错误输出并将其打印到控制台 31 | free.stderr.on('data', function (data) { 32 | console.log('error output:\n' + data.toString()); 33 | }); 34 | 35 | // 注册子进程关闭事件 36 | free.on('exit', function (code, signal) { 37 | console.log('\r\nexit;'); 38 | }); 39 | }; -------------------------------------------------------------------------------- /shell/think.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const yargs = require('yargs'); 3 | const thinkOption = require('./../package.json'); 4 | const version = thinkOption.version; 5 | const colors = require("colors"); 6 | 7 | // 指令 8 | const create = require('./create'); 9 | const run = require('./run'); 10 | 11 | // 创建命令 12 | yargs.command(create.name, create.description, create.callback); 13 | yargs.command(run.name, run.description, run.callback); 14 | 15 | // 执行yargs 16 | yargs.argv; 17 | 18 | 19 | const say = 20 | ` 21 | +-------+ 22 | | Think | Node | 23 | +------+ 24 | version: ${version.yellow} 25 | 26 | commonly used commands: 27 | help: ${'think --help'.yellow} 28 | create: ${'think create demo'.yellow} 29 | run: ${'think run'.yellow} 30 | 31 | quick start: 32 | ${'think create demo'.yellow} 33 | ${'think run'.yellow}` 34 | 35 | // 如果没有写任何参数, 呼出信息 36 | if (!yargs.argv._.length) { 37 | console.log(say); 38 | } -------------------------------------------------------------------------------- /shell/think.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /shell/uilt/copyFiles.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const fs = require('fs'); 3 | const stat = fs.stat; 4 | 5 | let copy = function (src, dst) { 6 | //读取目录 7 | fs.readdir(src, function (err, paths) { 8 | if (err) return console.log(err); 9 | paths.forEach(function (path) { 10 | let _src = path.join(src, path); 11 | let _dst = path.join(dst, path); 12 | let readable, writable; 13 | stat(_src, function (err, st) { 14 | if (err) throw err; 15 | if (st.isFile()) { 16 | readable = fs.createReadStream(_src);//创建读取流 17 | writable = fs.createWriteStream(_dst);//创建写入流 18 | readable.pipe(writable); 19 | } else if (st.isDirectory()) { 20 | exists(_src, _dst, copy); 21 | } 22 | }); 23 | }); 24 | }); 25 | } 26 | 27 | let exists = function (src, dst, callback) { 28 | 29 | //测试某个路径下文件是否存在 30 | fs.exists(dst, function (exists) { 31 | if (exists) { 32 | callback(src, dst); 33 | } else { 34 | fs.mkdir(dst, function () {//创建目录 35 | callback(src, dst) 36 | }) 37 | } 38 | }) 39 | } 40 | 41 | exists.copy = copy; 42 | 43 | module.exports = exists; -------------------------------------------------------------------------------- /src/bin/cache/staticFile.ts: -------------------------------------------------------------------------------- 1 | // 启动前先进行cache, 如果是debugger除外 2 | import * as fs from 'fs'; 3 | import * as path from 'path'; 4 | import glob from 'glob'; 5 | import think from './../think'; 6 | import * as cluster from 'cluster'; 7 | 8 | const CACHE_FILES = {}; 9 | const __ISMASTER: boolean = cluster.isMaster; 10 | 11 | // 需要的option 12 | const THINK_OPTION = think.option; 13 | const THINK_OPTION_USER_PATH: string = THINK_OPTION.path; 14 | const THINK_OPTION_STATIC: string[] = THINK_OPTION.staticResource || ['**/*.*']; 15 | const THINK_OPTION_DEBUGGER: boolean = THINK_OPTION.debugger; 16 | 17 | // 载入用户缓存 18 | if (!THINK_OPTION_DEBUGGER) { 19 | __ISMASTER && console.log(think.info('loadCache')); 20 | 21 | // 取到需要缓存的内容 22 | THINK_OPTION_STATIC.forEach((globPath: string) => { 23 | glob(path.join(THINK_OPTION_USER_PATH, globPath), (err, files) => { 24 | 25 | // 载入文件 26 | !err && files.forEach((fileName: string) => { 27 | fs.readFile(fileName, (err, fileData) => { 28 | // 加入缓存: Buffer使用的是内存, 即使大量数据也不会导致node崩溃 29 | !err && (CACHE_FILES[fileName] = new Buffer(fileData)); 30 | }); 31 | }); 32 | }) 33 | }); 34 | }; 35 | 36 | // 获取缓存内容 37 | think.getCache = (url: string, callback) => { 38 | url = path.join(url); 39 | let urlData = CACHE_FILES[url]; 40 | if (urlData !== undefined) { 41 | callback(null, urlData); 42 | } else { 43 | fs.readFile(url, callback); 44 | } 45 | }; -------------------------------------------------------------------------------- /src/bin/console.json: -------------------------------------------------------------------------------- 1 | { 2 | "color": { 3 | "file": "grey", 4 | "error": "red", 5 | "true": "green", 6 | "data": "blue", 7 | "inter": "cyan", 8 | "warn": "yellow", 9 | "start": "magenta" 10 | } 11 | } -------------------------------------------------------------------------------- /src/bin/defaultOption.json: -------------------------------------------------------------------------------- 1 | { 2 | "port": 8888, 3 | "ip": "0.0.0.0", 4 | "path": "/www", 5 | "default": ["index.html"], 6 | "staticresource": ["**/*.*"], 7 | "log": { 8 | "path": "/log", 9 | "switch": true 10 | }, 11 | "https": { 12 | "switch": false, 13 | "port": 443, 14 | "key": null, 15 | "cert": null 16 | }, 17 | "user": { 18 | "path": "/user" 19 | }, 20 | "debugger": true, 21 | "offsprdomain": false, 22 | "host": "www", 23 | "super": false 24 | } -------------------------------------------------------------------------------- /src/bin/language/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "loadY": "load complete", 3 | "loadN": "load failure", 4 | 5 | "loadTool": "load required plug-ins", 6 | 7 | "loadOption": "load configure file", 8 | "loadOptionY": "load configure file > complete", 9 | "loadOptionN": "load configure file > failure", 10 | 11 | "loadLeng": "load language file", 12 | "loadLengY": "load language file > complete", 13 | "loadLengN": "load language file > failure", 14 | 15 | "loadUser": "load user code", 16 | "loadUserN": "load user code > complete", 17 | "loadUserY": "load user code > failure", 18 | 19 | "loadCache": "load user cache", 20 | "loadCacheY": "load user cache > complete", 21 | "loadCacheN": "load user cache > failure", 22 | 23 | "loadAnswer": "load user interface data", 24 | "InterError": "Interface internal error!", 25 | "loadFileError": "node file loading failed!", 26 | "loadNodeFiles": "Failed to load node file directory!", 27 | "indexError1s": "request", 28 | "indexError1n": "fail!", 29 | "writerError": "log write failed", 30 | "logInfo": "error info", 31 | "Y": "complete", 32 | "N": "failure" 33 | } -------------------------------------------------------------------------------- /src/bin/language/lang.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 这里是与国际化相关代码, 3 | * 根据用户设置的语言类型, 这里会加载相应的JSON 4 | * 打印信息使用think.info('xxx'); 5 | * 如此可以方便的达到国际化效果 6 | */ 7 | import * as path from 'path'; 8 | import * as fs from 'fs'; 9 | import * as cluster from 'cluster'; 10 | import think from './../think'; 11 | 12 | const __ISMASTER: boolean = cluster.isMaster; 13 | 14 | const THINK_LENG_PATH: string = path.join(__dirname, think.language + '.json'); 15 | 16 | let lengInfo; 17 | if (! fs.existsSync(THINK_LENG_PATH)){ 18 | __ISMASTER && console.log(('The loading language failed. The language file did not exist!' as any).warning); 19 | __ISMASTER && console.log((THINK_LENG_PATH as any).error); 20 | 21 | // 如果没有设置lengPaht或没有找到语言文件, 自动加载zh.json 22 | lengInfo = require(path.join(__dirname, 'zh.json')); 23 | __ISMASTER && console.log(lengInfo['loadLengN'].error); 24 | } else { 25 | // 如果找到了语言文件, 自动加载 26 | lengInfo = require(THINK_LENG_PATH); 27 | __ISMASTER && console.log(lengInfo['loadLeng']); 28 | __ISMASTER && console.log(' ' + (THINK_LENG_PATH as any).file); 29 | __ISMASTER && console.log(lengInfo['loadLengY']); 30 | } 31 | 32 | function info(i: string): string { 33 | let text: string = lengInfo[i]; 34 | return text || ''; 35 | }; 36 | 37 | think.info = info; 38 | export default info; -------------------------------------------------------------------------------- /src/bin/language/zh.json: -------------------------------------------------------------------------------- 1 | { 2 | "loadY": "载入完成", 3 | "loadN": "载入失败", 4 | 5 | "loadTool": "载入所需插件", 6 | 7 | "loadOption": "载入配置文件", 8 | "loadOptionY": "载入配置文件完成", 9 | "loadOptionN": "载入配置文件失败", 10 | 11 | "loadLeng": "载入语言文件", 12 | "loadLengY": "载入语言文件完成", 13 | "loadLengN": "载入语言文件失败", 14 | 15 | "loadUser": "载入用户代码", 16 | "loadUserN": "载入用户代码失败", 17 | "loadUserY": "载入用户代码完成", 18 | 19 | "loadCache": "载入用户缓存", 20 | "loadCacheY": "载入用户缓存完成", 21 | "loadCacheN": "载入用户缓存失败", 22 | 23 | "loadAnswer": "加载用户接口数据", 24 | "InterError": "接口内部错误!", 25 | "loadFileError": "node文件载入失败!", 26 | "loadNodeFiles": "加载node文件失败!", 27 | "indexError1s": "请求首页文件", 28 | "indexError1n": "失败!", 29 | "writerError": "日志写入失败", 30 | "logInfo": "错误信息", 31 | "Y": "完成", 32 | "N": "失败" 33 | } -------------------------------------------------------------------------------- /src/bin/option.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import * as fs from 'fs'; 3 | import think from './think'; 4 | 5 | // 默认option 6 | think.option = require(path.join(__dirname, 'defaultOption.json')); 7 | 8 | // 引入配置文件 9 | require(path.join(think.DIR, 'option.js')); 10 | -------------------------------------------------------------------------------- /src/bin/socket/jarvisId.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 每次调用获取一个唯一ID 3 | */ 4 | export default function jarvisId(len?: number, radix?: number): string { 5 | const chars: Array = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); 6 | 7 | // 默认值 8 | len = len || 8, radix = radix || chars.length; 9 | 10 | let uuid: Array = [], 11 | index: number; 12 | 13 | for (index = 0; index < len; index ++) { 14 | uuid[index] = chars[0 | Math.random() * radix]; 15 | } 16 | 17 | return uuid.join(''); 18 | } -------------------------------------------------------------------------------- /src/bin/thinkInterface.ts: -------------------------------------------------------------------------------- 1 | export default interface thinkInterFace { 2 | // 常量 3 | END: Symbol; 4 | NODATA: Symbol; 5 | DIR: string; 6 | Jarvis: any; 7 | 8 | // 变量 9 | headerInfo: any; 10 | timeInfo: string; 11 | option: any; 12 | tool: any; 13 | language: string; 14 | debugger: boolean; 15 | $$NODE_CACHE_MAP: any; 16 | answer: Map; 17 | 18 | // 方法 19 | frontPath: Function; 20 | header: Function; 21 | timeZone: Function; 22 | opt: Function; 23 | define: Function; 24 | lang: Function; 25 | load: Function; 26 | onload: Function; 27 | log: Function; 28 | info: Function; 29 | voidCallback: Function; 30 | getCache: Function; 31 | getAnswer: Function; 32 | }; -------------------------------------------------------------------------------- /src/bin/tool/contentType.ts: -------------------------------------------------------------------------------- 1 | import * as CONTENTTYPE from './contentType.json'; 2 | 3 | /** 4 | * 获取文件对应的contentType值 5 | * @param {string} fileName 文件名或文件路径 6 | */ 7 | export let contentType = (fileName: string): string => { 8 | for (let key in CONTENTTYPE) 9 | if (fileName.endsWith(key)) 10 | return CONTENTTYPE[key]; 11 | return CONTENTTYPE['+type']; 12 | }; 13 | 14 | // 检查文件后缀, 是否该文件应该返回utf-8格式 15 | export let hasUtf8 = (fileName: string): boolean => { 16 | return CONTENTTYPE['+utf8'].indexOf(fileName) > -1; 17 | }; -------------------------------------------------------------------------------- /src/bin/tool/copy.ts: -------------------------------------------------------------------------------- 1 | /* 2 | copy 一个对象, 深度的拷贝需要谨慎 3 | 依赖于Think.tool.is函数 4 | */ 5 | export let copy = function(copyObject) { 6 | switch (typeof copyObject) { 7 | case 'object': 8 | switch (is(copyObject)) { 9 | case 'null': 10 | return copyObject; 11 | case 'array': 12 | return copyObject.map(function(values) { 13 | return copy(values); 14 | }); 15 | case 'likeArray': 16 | case 'object': 17 | let copyobj = {}; 18 | for (let key in copyObject) 19 | copyobj[key] = copy(copyObject[key]); 20 | return copyobj; 21 | } 22 | default: 23 | return copyObject; 24 | } 25 | }; 26 | 27 | /** 28 | * 判断一个变量的类型,大多数类型都能判断 29 | * 返回的数据类型都是小写单词 30 | * 如果无法确认类型则返回字符串 'unknown' 31 | */ 32 | export let is = (content: any): string => { 33 | if (typeof content !== 'object') 34 | return typeof content; 35 | if (content === null) 36 | return 'null'; 37 | if (content.nodeType) 38 | return 'element'; 39 | if (typeof content === 'object' && Object.prototype.toString.call(content) === '[object Array]') 40 | return 'array'; 41 | if (content.length && typeof content.length === 'number' && content.length > -1) 42 | return 'likeArray'; 43 | if (typeof content === 'object') 44 | return Object.prototype.toString.call(content) 45 | .replace(/\[object (\w+)\]/, '$1').toLowerCase(); 46 | 47 | return 'unknown'; 48 | }; -------------------------------------------------------------------------------- /src/bin/tool/createfiles.ts: -------------------------------------------------------------------------------- 1 | // 提供了4个API 2 | import * as fs from 'fs'; 3 | import * as path from 'path'; 4 | import think from './../think'; 5 | // 如果存在则不创建, 如果不存在则创建该文件夹 6 | export let createFiles = function(url: string, callback: any) { 7 | url = path.join(url); 8 | let $url: string = think.frontPath(url); 9 | fs.exists($url, function(exis: boolean) { 10 | !exis ? 11 | createFiles($url, function() { 12 | fs.exists(url, (ex) => { 13 | !ex && fs.mkdir(url, callback); 14 | }); 15 | }) 16 | : 17 | fs.exists(url, (ex) => { 18 | !ex && fs.mkdir(url, callback); 19 | }); 20 | }); 21 | } 22 | 23 | export let createFile = function(url: string, callback) { 24 | url = path.join(url); 25 | let $url: string = think.frontPath(url); 26 | createFiles($url, () => { 27 | fs.exists(url, (ex) => { 28 | !ex && fs.writeFile(url, '', callback); 29 | }); 30 | }); 31 | } 32 | 33 | export let createFilesSync = function(url) { 34 | url = path.join(url); 35 | let $url: string = think.frontPath(url); 36 | let exis: boolean = fs.existsSync($url); 37 | !exis && createFilesSync($url); 38 | let ex: boolean = fs.existsSync(url); 39 | !ex && fs.mkdirSync(url); 40 | } 41 | 42 | export let createFileSync = function(url) { 43 | url = path.join(url); 44 | let $url: string = think.frontPath(url); 45 | this.createFilesSync($url); 46 | let ex: boolean = fs.existsSync(url); 47 | !ex && fs.writeFileSync(url, ''); 48 | } 49 | -------------------------------------------------------------------------------- /src/bin/tool/stak.ts: -------------------------------------------------------------------------------- 1 | // 任务系统, 通常用于大数据处理 2 | export class Stak { 3 | timer: number; 4 | callback: Function; 5 | stakList: any[]; 6 | flag: number; 7 | 8 | constructor (...staks) { 9 | this.stakList = []; 10 | this.flag = 0; 11 | this.pushStak(...staks); 12 | } 13 | 14 | pushStak(...staks) { 15 | staks.forEach(function(stak) { 16 | this.flag < 2 && typeof stak === 'function' && this.stakList.push(stak); 17 | }, this); 18 | } 19 | 20 | start() { 21 | this.flag = 1; 22 | this.timer = setInterval(this.timeFn.bind(this), 1); 23 | } 24 | 25 | timeFn() { 26 | let stak = this.stakList.shift(); 27 | if (stak) 28 | stak() 29 | else { 30 | this.timer && clearInterval(this.timer); 31 | this.flag = 2; 32 | this.callback && this.callback(); 33 | } 34 | } 35 | 36 | restart() { 37 | this.stakList = []; 38 | this.timer && clearInterval(this.timer); 39 | this.timer = null; 40 | this.flag = 0; 41 | } 42 | } -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare let __ISMASTER: boolean; 2 | declare module "*.json" { 3 | const value: any; 4 | export default value; 5 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", //指定生成哪个模块系统代码 4 | "target": "es6", //目标代码类型 5 | "noImplicitAny": false, //在表达式和声明上有隐含的'any'类型时报错。 6 | "sourceMap": false, //用于debug 7 | "rootDir":"./src", //仅用来控制输出的目录结构--outDir。 8 | "outDir":"./build", //重定向输出目录。 9 | "watch":false //在监视模式下运行编译器。会监视输出文件,在它们改变时重新编译。 10 | }, 11 | "include":[ 12 | "./src/**/*" 13 | ], 14 | "exclude":[ 15 | "views", 16 | "static" 17 | ] 18 | } -------------------------------------------------------------------------------- /user/think.js: -------------------------------------------------------------------------------- 1 | const { TestModel } = think.tool; 2 | 3 | // 设置测试数据及随机种子 4 | var textModel = new TestModel( 5 | {text: 'think-node'}, 6 | {text: ['think-node', 'hello world']}, 7 | ); 8 | 9 | // 创建一个接口 '/think' 10 | think.answer({ 11 | url: '/think', 12 | callback: () => textModel.random(), 13 | }); -------------------------------------------------------------------------------- /www/css/style.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | height: 0; 3 | position: relative; 4 | top: -1000px; 5 | text-align: center; 6 | font-size: 42px; 7 | font-weight: 900; 8 | color: #fff; 9 | letter-spacing: 10px; 10 | animation: h1first 3s infinite alternate; 11 | cursor: context-menu; 12 | font-family: 微软雅黑; 13 | } 14 | 15 | @keyframes h1first { 16 | from { 17 | text-shadow: 0 1040px 10px #000; 18 | } 19 | to { 20 | text-shadow: 0 1040px 1px #000; 21 | } 22 | } -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | thinkNode 6 | 7 | 8 | 9 | 10 |

11 | 12 | 13 | 14 | 22 | 23 | --------------------------------------------------------------------------------