├── .editorconfig ├── .eslintignore ├── .gitattributes ├── .gitignore ├── .travis.yml ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── app ├── index.js └── templates │ ├── .babelrc │ ├── dist │ ├── io.js │ └── util.js │ ├── index.js │ ├── lib │ ├── io.js │ └── util.js │ ├── package.json │ └── readme.md ├── package-lock.json └── package.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | coverage 2 | **/templates 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - v10 4 | - v8 5 | - v6 6 | - v4 7 | after_script: cat ./coverage/lcov.info | coveralls 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 yepu 2 | All rights reserved. 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # generator-coding 2 | generator-coding javascript 练习算法的脚手架 3 | 4 | #### 使用方式 5 | 6 | ------ 7 | 8 | `` npm install -g yo generator-coding `` 9 | 10 | `` yo coding `` 11 | 12 | * PS: 如果下载 ``generator-coding`` 很慢的同学可以直接 git 拉代码下来切换至 app/template/ 目录中,该目录即 ``coding`` 脚手架。 13 | 14 | * 初始化后脚手架,进入创建好的目录下依次执行 `` npm install `` `` npm run start `` 15 | * 完成后在目录下的 index.js 下开始你的 js 算法编程之旅 16 | * 脚手架目录参考本项目 app/templates/ 17 | * 欢迎提 issue 18 | 19 | * __支付宝招前端 or 安卓,校招 or 社招。社招 P6 起,欢迎简历来砸。__ 20 | -------------------------------------------------------------------------------- /app/index.js: -------------------------------------------------------------------------------- 1 | var generators = require('yeoman-generator'); 2 | var yosay = require('yosay'); 3 | var chalk = require('chalk'); 4 | 5 | module.exports = generators.Base.extend({ 6 | 7 | constructor: function() { 8 | generators.Base.apply(this, arguments); 9 | }, 10 | 11 | initializing: function() { 12 | var message = chalk.bgBlack.bold('\nWelcome to nowcoder & acmcode javascript coding\n') + chalk.underline('github.com/bohexigua\n'); 13 | this.log(yosay(message)); 14 | }, 15 | 16 | prompting: function() { 17 | var done = this.async(); 18 | return this.prompt([{ 19 | type : 'input', 20 | name : 'name', 21 | message : 'Your dir name', 22 | default : 'algorithm-problem', 23 | validate: function(input) { 24 | if (this.existedFile && this.existedFile.indexOf(input) > 25 | -1) { 26 | this.log('目录已存在,请更换一个目录名称!'); 27 | return false; 28 | } else { 29 | return true; 30 | } 31 | }.bind(this) 32 | }]).then(function (answers) { 33 | this.log('dir name', answers.name); 34 | this.dirname = answers.name; 35 | done(); 36 | }.bind(this)); 37 | }, 38 | 39 | configuring: function() { 40 | }, 41 | 42 | selfFunction: function () { 43 | }, 44 | 45 | writing: function() { 46 | const copyPaths = ['', '.babelrc']; 47 | copyPaths.map((path, index) => { 48 | this.fs.copyTpl( 49 | this.templatePath(`./${ path }`), 50 | this.destinationPath(`./${ this.dirname }/${ path }`) 51 | ); 52 | }); 53 | }, 54 | 55 | end: function() { 56 | this.log('项目创建完成,开始你的JS编程之旅吧!'); 57 | } 58 | }); 59 | -------------------------------------------------------------------------------- /app/templates/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env"] 3 | } -------------------------------------------------------------------------------- /app/templates/dist/io.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.print = exports.read = undefined; 7 | 8 | var _readline = require('readline'); 9 | 10 | var _readline2 = _interopRequireDefault(_readline); 11 | 12 | var _util = require('../dist/util'); 13 | 14 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 15 | 16 | function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } 17 | 18 | var options = { 19 | ioFlag: true // 此处 hack 掉循环时关闭流之后的输入数据提示 20 | }; 21 | var rl = _readline2.default.createInterface({ 22 | input: process.stdin, 23 | output: process.stdout 24 | }); 25 | 26 | var readWrap = function readWrap() { 27 | return new Promise(function (resolve, reject) { 28 | rl.on('line', function (input) { 29 | resolve(input); 30 | }); 31 | }); 32 | }; 33 | 34 | var read = exports.read = function () { 35 | var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { 36 | return regeneratorRuntime.wrap(function _callee$(_context) { 37 | while (1) { 38 | switch (_context.prev = _context.next) { 39 | case 0: 40 | if (options.ioFlag) { 41 | _context.next = 2; 42 | break; 43 | } 44 | 45 | return _context.abrupt('return'); 46 | 47 | case 2: 48 | _util.hint.warn('请输入数据: '); 49 | _context.next = 5; 50 | return readWrap(); 51 | 52 | case 5: 53 | return _context.abrupt('return', _context.sent); 54 | 55 | case 6: 56 | case 'end': 57 | return _context.stop(); 58 | } 59 | } 60 | }, _callee, undefined); 61 | })); 62 | 63 | return function read() { 64 | return _ref.apply(this, arguments); 65 | }; 66 | }(); 67 | 68 | var print = exports.print = function print(msg) { 69 | _util.hint.success('运行结果: ', msg); 70 | rl.close(); 71 | options.ioFlag = false; 72 | }; -------------------------------------------------------------------------------- /app/templates/dist/util.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.hint = undefined; 7 | 8 | var _chalk = require('chalk'); 9 | 10 | var _chalk2 = _interopRequireDefault(_chalk); 11 | 12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 13 | 14 | var hint = exports.hint = {}; 15 | 16 | hint.success = function () { 17 | var tips = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 18 | var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 19 | 20 | console.log(_chalk2.default.green(tips) + ' ' + str); 21 | }; 22 | 23 | hint.warn = function () { 24 | var tips = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 25 | var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 26 | 27 | console.log(_chalk2.default.yellow(tips) + ' ' + str); 28 | }; -------------------------------------------------------------------------------- /app/templates/index.js: -------------------------------------------------------------------------------- 1 | import { read as readline, print } from './dist/io'; 2 | let line; 3 | 4 | /** 5 | * 适用于牛客网,赛码网编程题目 6 | * 代码运行环境请选择: javascript(V8) 7 | * 8 | * TODO: 下面是一个 a + b Problem 的样例 9 | * 在网站提交代码时请注释掉 1, 2 行,不然会编译错误,此 API 仅供本地调试 10 | */ 11 | 12 | (async function main() { 13 | // 你的代码 14 | 15 | while( line = await readline() ){ 16 | var lines = line.split(' '); 17 | var a = parseInt(lines[0]); 18 | var b = parseInt(lines[1]); 19 | print( a + b ); 20 | } 21 | })(); 22 | 23 | 24 | // ------- 以下是算法题目常用到的 util 函数,可以在 main 中直接使用 ---------> 25 | 26 | /** 27 | * 请注意: upperBound 接受一个升序的数组 28 | * @method upperBound 29 | * @param {Array} arr 要进行查找的数组 30 | * @param {Number} left 要查找区间的起始位置 31 | * @param {Number} right 要查找区间的结束位置 32 | * @param {Number, String} key 给定用来查找的值 33 | * @param {Function} cmp 扩展函数,可通过 cmp 函数实现对复杂数据结构的二分查找 34 | * @returns {Number} 数组的索引 35 | * @desc 可参考 C++ STL upperBound, 查找有序区间中第一个小于或等于某给定值的元素的位置, 时间复杂度 O(logN) 36 | */ 37 | function upperBound(arr, left, right, key, cmp = param => param) { 38 | let mid; 39 | while(right > left) { 40 | mid = Math.floor( (left + right) / 2 ); 41 | if (cmp(arr[mid]) >= key) { 42 | right = mid - 1; 43 | } else { 44 | left = mid + 1; 45 | } 46 | } 47 | return cmp(arr[left]) > key ? left - 1 : left; 48 | } 49 | 50 | /** 51 | * 请注意: lowerBound 接受一个升序的数组 52 | * @method lowerBound 53 | * @param {Array} arr 要进行查找的数组 54 | * @param {Number} left 要查找区间的起始位置 55 | * @param {Number} right 要查找区间的结束位置 56 | * @param {Number, String} key 给定用来查找的值 57 | * @param {Function} cmp 扩展函数,可通过 cmp 函数实现对复杂数据结构的二分查找 58 | * @returns {Number} 数组的索引 59 | * @desc 可参考 C++ STL lower_bound, 查找有序区间中第一个大于或等于某给定值的元素的位置, 时间复杂度 O(logN) 60 | */ 61 | function lowerBound(arr, left, right, key, cmp = param => param) { 62 | let mid; 63 | while(right > left) { 64 | mid = Math.floor( (left + right) / 2 ); 65 | if (cmp(arr[mid]) > key) { 66 | right = mid - 1; 67 | } else { 68 | left = mid + 1; 69 | } 70 | } 71 | if (left === right && cmp(arr[mid]) === key) right -= 1; 72 | return cmp(arr[right]) < key ? right + 1 : right; 73 | } 74 | -------------------------------------------------------------------------------- /app/templates/lib/io.js: -------------------------------------------------------------------------------- 1 | import readline from 'readline'; 2 | import { hint } from '../dist/util'; 3 | 4 | const options = { 5 | ioFlag: true // 此处 hack 掉循环时关闭流之后的输入数据提示 6 | } 7 | const rl = readline.createInterface({ 8 | input: process.stdin, 9 | output: process.stdout 10 | }); 11 | 12 | const readWrap = () => { 13 | return new Promise((resolve, reject) => { 14 | rl.on('line', (input) => { 15 | resolve(input); 16 | }); 17 | }) 18 | } 19 | 20 | export const read = async () => { 21 | if (!options.ioFlag) return ; 22 | hint.warn('请输入数据: ') 23 | return await readWrap(); 24 | } 25 | 26 | export const print = (msg) => { 27 | hint.success('运行结果: ', msg) 28 | rl.close(); 29 | options.ioFlag = false; 30 | } 31 | -------------------------------------------------------------------------------- /app/templates/lib/util.js: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk' 2 | 3 | export const hint = {}; 4 | 5 | hint.success = (tips = '', str = '') => { 6 | console.log(`${ chalk.green(tips) } ${str}`) 7 | } 8 | 9 | hint.warn = (tips = '', str = '') => { 10 | console.log(`${ chalk.yellow(tips) } ${str}`) 11 | } -------------------------------------------------------------------------------- /app/templates/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nowcoder-acmcoder-coding", 3 | "version": "1.0.0", 4 | "description": "nowcoder/acmcoder javascript I/O", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "babel lib --out-dir dist && babel-node index.js" 8 | }, 9 | "keywords": [ 10 | "javascript", 11 | "nowcoder", 12 | "I/O", 13 | "acmcoder", 14 | "coding" 15 | ], 16 | "author": "lxp.healy", 17 | "license": "ISC", 18 | "devDependencies": { 19 | "babel-cli": "^6.26.0", 20 | "babel-preset-env": "^1.7.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/templates/readme.md: -------------------------------------------------------------------------------- 1 | #### 使用手册 2 | 3 | ------ 4 | 5 | - 入口文件: index.js 6 | - 在 index.js 文件中实现你的代码,提交代码时请注释掉前两行,不然会编译报错。 7 | - 启动方式: 8 | - `` npm install `` 9 | - `` npm run start `` 10 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator-coding", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "del": { 8 | "version": "3.0.0", 9 | "resolved": "http://registry.npm.alibaba-inc.com/del/download/del-3.0.0.tgz", 10 | "dev": true, 11 | "dependencies": { 12 | "globby": { 13 | "version": "http://registry.npm.alibaba-inc.com/globby/download/globby-6.1.0.tgz", 14 | "bundled": true 15 | }, 16 | "is-path-cwd": { 17 | "version": "http://registry.npm.alibaba-inc.com/is-path-cwd/download/is-path-cwd-1.0.0.tgz", 18 | "bundled": true 19 | }, 20 | "is-path-in-cwd": { 21 | "version": "http://registry.npm.alibaba-inc.com/is-path-in-cwd/download/is-path-in-cwd-1.0.1.tgz", 22 | "bundled": true 23 | }, 24 | "p-map": { 25 | "version": "http://registry.npm.alibaba-inc.com/p-map/download/p-map-1.2.0.tgz", 26 | "bundled": true 27 | }, 28 | "pify": { 29 | "version": "http://registry.npm.alibaba-inc.com/pify/download/pify-3.0.0.tgz", 30 | "bundled": true 31 | }, 32 | "rimraf": { 33 | "version": "http://registry.npm.alibaba-inc.com/rimraf/download/rimraf-2.6.2.tgz", 34 | "bundled": true, 35 | "dependencies": { 36 | "glob": { 37 | "version": "http://registry.npm.alibaba-inc.com/glob/download/glob-7.1.2.tgz", 38 | "dependencies": { 39 | "fs.realpath": { 40 | "version": "http://registry.npm.alibaba-inc.com/fs.realpath/download/fs.realpath-1.0.0.tgz", 41 | "bundled": true 42 | }, 43 | "inflight": { 44 | "version": "http://registry.npm.alibaba-inc.com/inflight/download/inflight-1.0.6.tgz", 45 | "bundled": true 46 | }, 47 | "inherits": { 48 | "version": "http://registry.npm.alibaba-inc.com/inherits/download/inherits-2.0.3.tgz", 49 | "bundled": true 50 | }, 51 | "minimatch": { 52 | "version": "http://registry.npm.alibaba-inc.com/minimatch/download/minimatch-3.0.4.tgz", 53 | "bundled": true 54 | }, 55 | "once": { 56 | "version": "http://registry.npm.alibaba-inc.com/once/download/once-1.4.0.tgz", 57 | "bundled": true, 58 | "dependencies": { 59 | "wrappy": { 60 | "version": "http://registry.npm.alibaba-inc.com/wrappy/download/wrappy-1.0.2.tgz" 61 | } 62 | } 63 | }, 64 | "path-is-absolute": { 65 | "version": "http://registry.npm.alibaba-inc.com/path-is-absolute/download/path-is-absolute-1.0.1.tgz", 66 | "bundled": true 67 | } 68 | } 69 | } 70 | } 71 | } 72 | } 73 | }, 74 | "yeoman-generator": { 75 | "version": "3.1.1", 76 | "resolved": "http://registry.npm.alibaba-inc.com/yeoman-generator/download/yeoman-generator-3.1.1.tgz", 77 | "dev": true, 78 | "dependencies": { 79 | "async": { 80 | "version": "http://registry.npm.alibaba-inc.com/async/download/async-2.6.1.tgz", 81 | "bundled": true 82 | }, 83 | "chalk": { 84 | "version": "http://registry.npm.alibaba-inc.com/chalk/download/chalk-2.4.1.tgz", 85 | "bundled": true 86 | }, 87 | "cli-table": { 88 | "version": "http://registry.npm.alibaba-inc.com/cli-table/download/cli-table-0.3.1.tgz", 89 | "bundled": true 90 | }, 91 | "cross-spawn": { 92 | "version": "http://registry.npm.alibaba-inc.com/cross-spawn/download/cross-spawn-6.0.5.tgz", 93 | "bundled": true, 94 | "dependencies": { 95 | "nice-try": { 96 | "version": "http://registry.npm.alibaba-inc.com/nice-try/download/nice-try-1.0.4.tgz", 97 | "bundled": true 98 | }, 99 | "path-key": { 100 | "version": "http://registry.npm.alibaba-inc.com/path-key/download/path-key-2.0.1.tgz", 101 | "bundled": true 102 | }, 103 | "semver": { 104 | "version": "http://registry.npm.alibaba-inc.com/semver/download/semver-5.5.0.tgz", 105 | "bundled": true 106 | }, 107 | "shebang-command": { 108 | "version": "http://registry.npm.alibaba-inc.com/shebang-command/download/shebang-command-1.2.0.tgz", 109 | "bundled": true 110 | }, 111 | "which": { 112 | "version": "http://registry.npm.alibaba-inc.com/which/download/which-1.3.1.tgz", 113 | "bundled": true 114 | } 115 | } 116 | }, 117 | "dargs": { 118 | "version": "http://registry.npm.alibaba-inc.com/dargs/download/dargs-6.0.0.tgz", 119 | "bundled": true 120 | }, 121 | "dateformat": { 122 | "version": "http://registry.npm.alibaba-inc.com/dateformat/download/dateformat-3.0.3.tgz", 123 | "bundled": true 124 | }, 125 | "debug": { 126 | "version": "http://registry.npm.alibaba-inc.com/debug/download/debug-3.1.0.tgz", 127 | "bundled": true, 128 | "dependencies": { 129 | "ms": { 130 | "version": "http://registry.npm.alibaba-inc.com/ms/download/ms-2.0.0.tgz", 131 | "bundled": true 132 | } 133 | } 134 | }, 135 | "detect-conflict": { 136 | "version": "http://registry.npm.alibaba-inc.com/detect-conflict/download/detect-conflict-1.0.1.tgz", 137 | "bundled": true 138 | }, 139 | "error": { 140 | "version": "http://registry.npm.alibaba-inc.com/error/download/error-7.0.2.tgz", 141 | "bundled": true 142 | }, 143 | "find-up": { 144 | "version": "http://registry.npm.alibaba-inc.com/find-up/download/find-up-3.0.0.tgz", 145 | "bundled": true, 146 | "dependencies": { 147 | "locate-path": { 148 | "version": "http://registry.npm.alibaba-inc.com/locate-path/download/locate-path-3.0.0.tgz", 149 | "bundled": true 150 | } 151 | } 152 | }, 153 | "github-username": { 154 | "version": "http://registry.npm.alibaba-inc.com/github-username/download/github-username-4.1.0.tgz", 155 | "bundled": true 156 | }, 157 | "istextorbinary": { 158 | "version": "http://registry.npm.alibaba-inc.com/istextorbinary/download/istextorbinary-2.2.1.tgz", 159 | "bundled": true 160 | }, 161 | "lodash": { 162 | "version": "http://registry.npm.alibaba-inc.com/lodash/download/lodash-4.17.10.tgz", 163 | "bundled": true 164 | }, 165 | "make-dir": { 166 | "version": "http://registry.npm.alibaba-inc.com/make-dir/download/make-dir-1.3.0.tgz", 167 | "bundled": true 168 | }, 169 | "mem-fs-editor": { 170 | "version": "http://registry.npm.alibaba-inc.com/mem-fs-editor/download/mem-fs-editor-5.1.0.tgz", 171 | "bundled": true, 172 | "dependencies": { 173 | "commondir": { 174 | "version": "http://registry.npm.alibaba-inc.com/commondir/download/commondir-1.0.1.tgz" 175 | }, 176 | "deep-extend": { 177 | "version": "http://registry.npm.alibaba-inc.com/deep-extend/download/deep-extend-0.6.0.tgz" 178 | }, 179 | "ejs": { 180 | "version": "http://registry.npm.alibaba-inc.com/ejs/download/ejs-2.6.1.tgz" 181 | }, 182 | "glob": { 183 | "version": "http://registry.npm.alibaba-inc.com/glob/download/glob-7.1.2.tgz", 184 | "dependencies": { 185 | "fs.realpath": { 186 | "version": "http://registry.npm.alibaba-inc.com/fs.realpath/download/fs.realpath-1.0.0.tgz", 187 | "bundled": true 188 | }, 189 | "inflight": { 190 | "version": "http://registry.npm.alibaba-inc.com/inflight/download/inflight-1.0.6.tgz", 191 | "bundled": true 192 | }, 193 | "inherits": { 194 | "version": "http://registry.npm.alibaba-inc.com/inherits/download/inherits-2.0.3.tgz", 195 | "bundled": true 196 | }, 197 | "minimatch": { 198 | "version": "http://registry.npm.alibaba-inc.com/minimatch/download/minimatch-3.0.4.tgz", 199 | "bundled": true 200 | }, 201 | "once": { 202 | "version": "http://registry.npm.alibaba-inc.com/once/download/once-1.4.0.tgz", 203 | "bundled": true, 204 | "dependencies": {} 205 | }, 206 | "path-is-absolute": { 207 | "version": "http://registry.npm.alibaba-inc.com/path-is-absolute/download/path-is-absolute-1.0.1.tgz", 208 | "bundled": true 209 | } 210 | } 211 | }, 212 | "globby": { 213 | "version": "http://registry.npm.alibaba-inc.com/globby/download/globby-8.0.1.tgz", 214 | "dependencies": { 215 | "array-union": { 216 | "version": "http://registry.npm.alibaba-inc.com/array-union/download/array-union-1.0.2.tgz", 217 | "bundled": true 218 | }, 219 | "dir-glob": { 220 | "version": "http://registry.npm.alibaba-inc.com/dir-glob/download/dir-glob-2.0.0.tgz", 221 | "bundled": true 222 | }, 223 | "fast-glob": { 224 | "version": "http://registry.npm.alibaba-inc.com/fast-glob/download/fast-glob-2.2.2.tgz", 225 | "bundled": true, 226 | "dependencies": { 227 | "@mrmlnc/readdir-enhanced": { 228 | "version": "http://registry.npm.alibaba-inc.com/@mrmlnc/readdir-enhanced/download/@mrmlnc/readdir-enhanced-2.2.1.tgz", 229 | "dependencies": { 230 | "call-me-maybe": { 231 | "version": "http://registry.npm.alibaba-inc.com/call-me-maybe/download/call-me-maybe-1.0.1.tgz", 232 | "bundled": true 233 | }, 234 | "glob-to-regexp": { 235 | "version": "http://registry.npm.alibaba-inc.com/glob-to-regexp/download/glob-to-regexp-0.3.0.tgz", 236 | "bundled": true 237 | } 238 | } 239 | }, 240 | "@nodelib/fs.stat": { 241 | "version": "http://registry.npm.alibaba-inc.com/@nodelib/fs.stat/download/@nodelib/fs.stat-1.1.0.tgz" 242 | }, 243 | "glob-parent": { 244 | "version": "http://registry.npm.alibaba-inc.com/glob-parent/download/glob-parent-3.1.0.tgz" 245 | }, 246 | "is-glob": { 247 | "version": "http://registry.npm.alibaba-inc.com/is-glob/download/is-glob-4.0.0.tgz" 248 | }, 249 | "merge2": { 250 | "version": "http://registry.npm.alibaba-inc.com/merge2/download/merge2-1.2.2.tgz" 251 | }, 252 | "micromatch": { 253 | "version": "http://registry.npm.alibaba-inc.com/micromatch/download/micromatch-3.1.10.tgz" 254 | } 255 | } 256 | }, 257 | "glob": { 258 | "version": "http://registry.npm.alibaba-inc.com/glob/download/glob-7.1.2.tgz", 259 | "bundled": true, 260 | "dependencies": { 261 | "fs.realpath": { 262 | "version": "http://registry.npm.alibaba-inc.com/fs.realpath/download/fs.realpath-1.0.0.tgz", 263 | "bundled": true 264 | }, 265 | "inflight": { 266 | "version": "http://registry.npm.alibaba-inc.com/inflight/download/inflight-1.0.6.tgz", 267 | "bundled": true 268 | }, 269 | "inherits": { 270 | "version": "http://registry.npm.alibaba-inc.com/inherits/download/inherits-2.0.3.tgz", 271 | "bundled": true 272 | }, 273 | "minimatch": { 274 | "version": "http://registry.npm.alibaba-inc.com/minimatch/download/minimatch-3.0.4.tgz", 275 | "bundled": true 276 | }, 277 | "once": { 278 | "version": "http://registry.npm.alibaba-inc.com/once/download/once-1.4.0.tgz", 279 | "bundled": true, 280 | "dependencies": {} 281 | }, 282 | "path-is-absolute": { 283 | "version": "http://registry.npm.alibaba-inc.com/path-is-absolute/download/path-is-absolute-1.0.1.tgz", 284 | "bundled": true 285 | } 286 | } 287 | }, 288 | "ignore": { 289 | "version": "http://registry.npm.alibaba-inc.com/ignore/download/ignore-3.3.10.tgz", 290 | "bundled": true 291 | }, 292 | "pify": { 293 | "version": "http://registry.npm.alibaba-inc.com/pify/download/pify-3.0.0.tgz", 294 | "bundled": true 295 | }, 296 | "slash": { 297 | "version": "http://registry.npm.alibaba-inc.com/slash/download/slash-1.0.0.tgz", 298 | "bundled": true 299 | } 300 | } 301 | }, 302 | "isbinaryfile": { 303 | "version": "http://registry.npm.alibaba-inc.com/isbinaryfile/download/isbinaryfile-3.0.3.tgz" 304 | }, 305 | "mkdirp": { 306 | "version": "http://registry.npm.alibaba-inc.com/mkdirp/download/mkdirp-0.5.1.tgz" 307 | }, 308 | "multimatch": { 309 | "version": "http://registry.npm.alibaba-inc.com/multimatch/download/multimatch-2.1.0.tgz" 310 | }, 311 | "rimraf": { 312 | "version": "http://registry.npm.alibaba-inc.com/rimraf/download/rimraf-2.6.2.tgz", 313 | "dependencies": { 314 | "glob": { 315 | "version": "http://registry.npm.alibaba-inc.com/glob/download/glob-7.1.2.tgz", 316 | "dependencies": {} 317 | } 318 | } 319 | }, 320 | "through2": { 321 | "version": "http://registry.npm.alibaba-inc.com/through2/download/through2-2.0.3.tgz", 322 | "dependencies": { 323 | "readable-stream": { 324 | "version": "http://registry.npm.alibaba-inc.com/readable-stream/download/readable-stream-2.3.6.tgz", 325 | "bundled": true 326 | }, 327 | "xtend": { 328 | "version": "http://registry.npm.alibaba-inc.com/xtend/download/xtend-4.0.1.tgz", 329 | "bundled": true 330 | } 331 | } 332 | }, 333 | "vinyl": { 334 | "version": "http://registry.npm.alibaba-inc.com/vinyl/download/vinyl-2.2.0.tgz" 335 | } 336 | } 337 | }, 338 | "minimist": { 339 | "version": "http://registry.npm.alibaba-inc.com/minimist/download/minimist-1.2.0.tgz", 340 | "bundled": true 341 | }, 342 | "pretty-bytes": { 343 | "version": "http://registry.npm.alibaba-inc.com/pretty-bytes/download/pretty-bytes-5.1.0.tgz", 344 | "bundled": true 345 | }, 346 | "read-chunk": { 347 | "version": "http://registry.npm.alibaba-inc.com/read-chunk/download/read-chunk-2.1.0.tgz", 348 | "bundled": true 349 | }, 350 | "read-pkg-up": { 351 | "version": "http://registry.npm.alibaba-inc.com/read-pkg-up/download/read-pkg-up-4.0.0.tgz", 352 | "bundled": true, 353 | "dependencies": { 354 | "find-up": { 355 | "version": "http://registry.npm.alibaba-inc.com/find-up/download/find-up-3.0.0.tgz", 356 | "bundled": true 357 | }, 358 | "read-pkg": { 359 | "version": "http://registry.npm.alibaba-inc.com/read-pkg/download/read-pkg-3.0.0.tgz", 360 | "bundled": true, 361 | "dependencies": { 362 | "load-json-file": { 363 | "version": "http://registry.npm.alibaba-inc.com/load-json-file/download/load-json-file-4.0.0.tgz", 364 | "bundled": true 365 | }, 366 | "normalize-package-data": { 367 | "version": "http://registry.npm.alibaba-inc.com/normalize-package-data/download/normalize-package-data-2.4.0.tgz", 368 | "bundled": true 369 | }, 370 | "path-type": { 371 | "version": "http://registry.npm.alibaba-inc.com/path-type/download/path-type-3.0.0.tgz", 372 | "bundled": true, 373 | "dependencies": { 374 | "pify": { 375 | "version": "http://registry.npm.alibaba-inc.com/pify/download/pify-3.0.0.tgz", 376 | "bundled": true 377 | } 378 | } 379 | } 380 | } 381 | } 382 | } 383 | }, 384 | "rimraf": { 385 | "version": "http://registry.npm.alibaba-inc.com/rimraf/download/rimraf-2.6.2.tgz", 386 | "bundled": true, 387 | "dependencies": { 388 | "glob": { 389 | "version": "http://registry.npm.alibaba-inc.com/glob/download/glob-7.1.2.tgz", 390 | "dependencies": {} 391 | } 392 | } 393 | }, 394 | "run-async": { 395 | "version": "http://registry.npm.alibaba-inc.com/run-async/download/run-async-2.3.0.tgz", 396 | "bundled": true, 397 | "dependencies": { 398 | "is-promise": { 399 | "version": "http://registry.npm.alibaba-inc.com/is-promise/download/is-promise-2.1.0.tgz", 400 | "bundled": true 401 | } 402 | } 403 | }, 404 | "shelljs": { 405 | "version": "http://registry.npm.alibaba-inc.com/shelljs/download/shelljs-0.8.2.tgz", 406 | "bundled": true 407 | }, 408 | "text-table": { 409 | "version": "http://registry.npm.alibaba-inc.com/text-table/download/text-table-0.2.0.tgz", 410 | "bundled": true 411 | }, 412 | "through2": { 413 | "version": "http://registry.npm.alibaba-inc.com/through2/download/through2-2.0.3.tgz", 414 | "bundled": true, 415 | "dependencies": { 416 | "readable-stream": { 417 | "version": "http://registry.npm.alibaba-inc.com/readable-stream/download/readable-stream-2.3.6.tgz", 418 | "bundled": true 419 | }, 420 | "xtend": { 421 | "version": "http://registry.npm.alibaba-inc.com/xtend/download/xtend-4.0.1.tgz", 422 | "bundled": true 423 | } 424 | } 425 | }, 426 | "yeoman-environment": { 427 | "version": "http://registry.npm.alibaba-inc.com/yeoman-environment/download/yeoman-environment-2.3.1.tgz", 428 | "bundled": true, 429 | "dependencies": { 430 | "chalk": { 431 | "version": "http://registry.npm.alibaba-inc.com/chalk/download/chalk-2.4.1.tgz", 432 | "bundled": true, 433 | "dependencies": { 434 | "ansi-styles": { 435 | "version": "http://registry.npm.alibaba-inc.com/ansi-styles/download/ansi-styles-3.2.1.tgz" 436 | }, 437 | "escape-string-regexp": { 438 | "version": "http://registry.npm.alibaba-inc.com/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz" 439 | }, 440 | "supports-color": { 441 | "version": "http://registry.npm.alibaba-inc.com/supports-color/download/supports-color-5.4.0.tgz" 442 | } 443 | } 444 | }, 445 | "cross-spawn": { 446 | "version": "http://registry.npm.alibaba-inc.com/cross-spawn/download/cross-spawn-6.0.5.tgz", 447 | "bundled": true 448 | }, 449 | "debug": { 450 | "version": "http://registry.npm.alibaba-inc.com/debug/download/debug-3.1.0.tgz", 451 | "bundled": true 452 | }, 453 | "diff": { 454 | "version": "http://registry.npm.alibaba-inc.com/diff/download/diff-3.5.0.tgz", 455 | "bundled": true 456 | }, 457 | "escape-string-regexp": { 458 | "version": "http://registry.npm.alibaba-inc.com/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz", 459 | "bundled": true 460 | }, 461 | "globby": { 462 | "version": "http://registry.npm.alibaba-inc.com/globby/download/globby-8.0.1.tgz", 463 | "bundled": true, 464 | "dependencies": { 465 | "array-union": { 466 | "version": "http://registry.npm.alibaba-inc.com/array-union/download/array-union-1.0.2.tgz", 467 | "bundled": true 468 | }, 469 | "dir-glob": { 470 | "version": "http://registry.npm.alibaba-inc.com/dir-glob/download/dir-glob-2.0.0.tgz", 471 | "bundled": true 472 | }, 473 | "fast-glob": { 474 | "version": "http://registry.npm.alibaba-inc.com/fast-glob/download/fast-glob-2.2.2.tgz", 475 | "bundled": true, 476 | "dependencies": {} 477 | }, 478 | "glob": { 479 | "version": "http://registry.npm.alibaba-inc.com/glob/download/glob-7.1.2.tgz", 480 | "bundled": true, 481 | "dependencies": {} 482 | }, 483 | "ignore": { 484 | "version": "http://registry.npm.alibaba-inc.com/ignore/download/ignore-3.3.10.tgz", 485 | "bundled": true 486 | }, 487 | "pify": { 488 | "version": "http://registry.npm.alibaba-inc.com/pify/download/pify-3.0.0.tgz", 489 | "bundled": true 490 | }, 491 | "slash": { 492 | "version": "http://registry.npm.alibaba-inc.com/slash/download/slash-1.0.0.tgz", 493 | "bundled": true 494 | } 495 | } 496 | }, 497 | "grouped-queue": { 498 | "version": "http://registry.npm.alibaba-inc.com/grouped-queue/download/grouped-queue-0.3.3.tgz", 499 | "bundled": true 500 | }, 501 | "inquirer": { 502 | "version": "http://registry.npm.alibaba-inc.com/inquirer/download/inquirer-5.2.0.tgz", 503 | "bundled": true, 504 | "dependencies": { 505 | "ansi-escapes": { 506 | "version": "http://registry.npm.alibaba-inc.com/ansi-escapes/download/ansi-escapes-3.1.0.tgz" 507 | }, 508 | "chalk": { 509 | "version": "http://registry.npm.alibaba-inc.com/chalk/download/chalk-2.4.1.tgz", 510 | "dependencies": { 511 | "ansi-styles": { 512 | "version": "http://registry.npm.alibaba-inc.com/ansi-styles/download/ansi-styles-3.2.1.tgz" 513 | }, 514 | "escape-string-regexp": { 515 | "version": "http://registry.npm.alibaba-inc.com/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz" 516 | }, 517 | "supports-color": { 518 | "version": "http://registry.npm.alibaba-inc.com/supports-color/download/supports-color-5.4.0.tgz" 519 | } 520 | } 521 | }, 522 | "cli-cursor": { 523 | "version": "http://registry.npm.alibaba-inc.com/cli-cursor/download/cli-cursor-2.1.0.tgz" 524 | }, 525 | "cli-width": { 526 | "version": "http://registry.npm.alibaba-inc.com/cli-width/download/cli-width-2.2.0.tgz" 527 | }, 528 | "external-editor": { 529 | "version": "http://registry.npm.alibaba-inc.com/external-editor/download/external-editor-2.2.0.tgz" 530 | }, 531 | "figures": { 532 | "version": "http://registry.npm.alibaba-inc.com/figures/download/figures-2.0.0.tgz" 533 | }, 534 | "lodash": { 535 | "version": "http://registry.npm.alibaba-inc.com/lodash/download/lodash-4.17.10.tgz" 536 | }, 537 | "mute-stream": { 538 | "version": "http://registry.npm.alibaba-inc.com/mute-stream/download/mute-stream-0.0.7.tgz" 539 | }, 540 | "run-async": { 541 | "version": "http://registry.npm.alibaba-inc.com/run-async/download/run-async-2.3.0.tgz" 542 | }, 543 | "rxjs": { 544 | "version": "http://registry.npm.alibaba-inc.com/rxjs/download/rxjs-5.5.11.tgz" 545 | }, 546 | "string-width": { 547 | "version": "http://registry.npm.alibaba-inc.com/string-width/download/string-width-2.1.1.tgz" 548 | }, 549 | "strip-ansi": { 550 | "version": "http://registry.npm.alibaba-inc.com/strip-ansi/download/strip-ansi-4.0.0.tgz", 551 | "dependencies": { 552 | "ansi-regex": { 553 | "version": "http://registry.npm.alibaba-inc.com/ansi-regex/download/ansi-regex-3.0.0.tgz", 554 | "bundled": true 555 | } 556 | } 557 | }, 558 | "through": { 559 | "version": "http://registry.npm.alibaba-inc.com/through/download/through-2.3.8.tgz" 560 | } 561 | } 562 | }, 563 | "is-scoped": { 564 | "version": "http://registry.npm.alibaba-inc.com/is-scoped/download/is-scoped-1.0.0.tgz", 565 | "bundled": true 566 | }, 567 | "lodash": { 568 | "version": "http://registry.npm.alibaba-inc.com/lodash/download/lodash-4.17.10.tgz", 569 | "bundled": true 570 | }, 571 | "log-symbols": { 572 | "version": "http://registry.npm.alibaba-inc.com/log-symbols/download/log-symbols-2.2.0.tgz", 573 | "bundled": true 574 | }, 575 | "mem-fs": { 576 | "version": "http://registry.npm.alibaba-inc.com/mem-fs/download/mem-fs-1.1.3.tgz", 577 | "bundled": true 578 | }, 579 | "strip-ansi": { 580 | "version": "http://registry.npm.alibaba-inc.com/strip-ansi/download/strip-ansi-4.0.0.tgz", 581 | "bundled": true, 582 | "dependencies": { 583 | "ansi-regex": { 584 | "version": "http://registry.npm.alibaba-inc.com/ansi-regex/download/ansi-regex-3.0.0.tgz", 585 | "bundled": true 586 | } 587 | } 588 | }, 589 | "text-table": { 590 | "version": "http://registry.npm.alibaba-inc.com/text-table/download/text-table-0.2.0.tgz", 591 | "bundled": true 592 | }, 593 | "untildify": { 594 | "version": "http://registry.npm.alibaba-inc.com/untildify/download/untildify-3.0.3.tgz", 595 | "bundled": true 596 | } 597 | } 598 | } 599 | } 600 | } 601 | } 602 | } 603 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator-coding", 3 | "version": "1.1.0", 4 | "description": "generator-coding", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "javascript", 11 | "nowcoder", 12 | "I/O", 13 | "acmcoder", 14 | "coding" 15 | ], 16 | "author": "healy.lxp", 17 | "license": "ISC", 18 | "dependencies": { 19 | "chalk": "^2.4.1", 20 | "del": "^3.0.0", 21 | "yeoman-generator": "^0.24.1", 22 | "yosay": "^2.0.2" 23 | } 24 | } 25 | --------------------------------------------------------------------------------