├── nodejs
├── async
│ ├── wwwroot
│ │ ├── upload
│ │ └── index.html
│ ├── app-promise.js
│ ├── app-async.js
│ └── app-www.js
├── demo-mkdirp
│ ├── wwwroot
│ │ ├── upload
│ │ └── index.html
│ ├── app-mkdirp.js
│ ├── app-www.js
│ └── app-handwrite.js
├── demofs
│ ├── html
│ │ ├── index.html
│ │ └── base.css
│ ├── package.json
│ └── appfs.js
├── 14web-ejs
│ ├── node_modules
│ │ ├── ejs
│ │ ├── async
│ │ ├── chalk
│ │ ├── jake
│ │ ├── filelist
│ │ ├── has-flag
│ │ ├── .bin
│ │ │ └── ejs
│ │ ├── color-name
│ │ ├── concat-map
│ │ ├── minimatch
│ │ ├── ansi-styles
│ │ ├── color-convert
│ │ ├── balanced-match
│ │ ├── supports-color
│ │ ├── _ejs@3.1.5@ejs
│ │ │ ├── node_modules
│ │ │ │ ├── jake
│ │ │ │ └── .bin
│ │ │ │ │ └── jake
│ │ │ ├── package.json
│ │ │ ├── usage.txt
│ │ │ └── jakefile.js
│ │ ├── brace-expansion
│ │ ├── _jake@10.8.2@jake
│ │ │ ├── node_modules
│ │ │ │ ├── async
│ │ │ │ ├── chalk
│ │ │ │ ├── filelist
│ │ │ │ └── minimatch
│ │ │ ├── test
│ │ │ │ ├── integration
│ │ │ │ │ ├── jakelib
│ │ │ │ │ │ ├── required_module.jake.js
│ │ │ │ │ │ ├── publish.jake.js
│ │ │ │ │ │ └── concurrent.jake.js
│ │ │ │ │ ├── publish_task.js
│ │ │ │ │ ├── selfdep.js
│ │ │ │ │ ├── concurrent.js
│ │ │ │ │ └── helpers.js
│ │ │ │ └── unit
│ │ │ │ │ ├── jakefile.js
│ │ │ │ │ └── namespace.js
│ │ │ ├── lib
│ │ │ │ ├── task
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── directory_task.js
│ │ │ │ ├── utils
│ │ │ │ │ └── logger.js
│ │ │ │ └── namespace.js
│ │ │ ├── README.md
│ │ │ ├── bin
│ │ │ │ ├── cli.js
│ │ │ │ └── bash_completion.sh
│ │ │ ├── usage.txt
│ │ │ ├── package.json
│ │ │ ├── Makefile
│ │ │ └── jakefile.js
│ │ ├── escape-string-regexp
│ │ ├── _chalk@2.4.2@chalk
│ │ │ ├── node_modules
│ │ │ │ ├── ansi-styles
│ │ │ │ ├── supports-color
│ │ │ │ └── escape-string-regexp
│ │ │ ├── license
│ │ │ ├── package.json
│ │ │ ├── index.js.flow
│ │ │ └── types
│ │ │ │ └── index.d.ts
│ │ ├── _filelist@1.0.1@filelist
│ │ │ ├── node_modules
│ │ │ │ └── minimatch
│ │ │ ├── Jakefile
│ │ │ ├── package.json
│ │ │ └── README.md
│ │ ├── _supports-color@5.5.0@supports-color
│ │ │ ├── node_modules
│ │ │ │ └── has-flag
│ │ │ ├── browser.js
│ │ │ ├── license
│ │ │ ├── package.json
│ │ │ ├── readme.md
│ │ │ └── index.js
│ │ ├── _color-convert@1.9.3@color-convert
│ │ │ ├── node_modules
│ │ │ │ └── color-name
│ │ │ ├── LICENSE
│ │ │ ├── package.json
│ │ │ ├── CHANGELOG.md
│ │ │ ├── index.js
│ │ │ ├── route.js
│ │ │ └── README.md
│ │ ├── _ansi-styles@3.2.1@ansi-styles
│ │ │ ├── node_modules
│ │ │ │ └── color-convert
│ │ │ ├── license
│ │ │ └── package.json
│ │ ├── _brace-expansion@1.1.11@brace-expansion
│ │ │ ├── node_modules
│ │ │ │ ├── concat-map
│ │ │ │ └── balanced-match
│ │ │ ├── LICENSE
│ │ │ └── package.json
│ │ ├── _concat-map@0.0.1@concat-map
│ │ │ ├── .travis.yml
│ │ │ ├── example
│ │ │ │ └── map.js
│ │ │ ├── index.js
│ │ │ ├── LICENSE
│ │ │ ├── test
│ │ │ │ └── map.js
│ │ │ ├── package.json
│ │ │ └── README.markdown
│ │ ├── _minimatch@3.0.4@minimatch
│ │ │ ├── node_modules
│ │ │ │ └── brace-expansion
│ │ │ ├── LICENSE
│ │ │ └── package.json
│ │ ├── _async@0.9.2@async
│ │ │ ├── .travis.yml
│ │ │ ├── component.json
│ │ │ ├── bower.json
│ │ │ ├── LICENSE
│ │ │ ├── package.json
│ │ │ └── support
│ │ │ │ └── sync-package-managers.js
│ │ ├── _balanced-match@1.0.0@balanced-match
│ │ │ ├── .npmignore
│ │ │ ├── LICENSE.md
│ │ │ ├── index.js
│ │ │ ├── package.json
│ │ │ └── README.md
│ │ ├── _color-name@1.1.3@color-name
│ │ │ ├── test.js
│ │ │ ├── README.md
│ │ │ ├── package.json
│ │ │ ├── LICENSE
│ │ │ ├── .eslintrc.json
│ │ │ └── .npmignore
│ │ ├── _escape-string-regexp@1.0.5@escape-string-regexp
│ │ │ ├── index.js
│ │ │ ├── readme.md
│ │ │ ├── license
│ │ │ └── package.json
│ │ └── _has-flag@3.0.0@has-flag
│ │ │ ├── index.js
│ │ │ ├── package.json
│ │ │ ├── license
│ │ │ └── readme.md
│ ├── static
│ │ ├── data.json
│ │ ├── test.js
│ │ ├── test.css
│ │ └── test.html
│ ├── data
│ │ └── test.json
│ ├── app.js
│ ├── views
│ │ ├── login.ejs
│ │ └── form.ejs
│ ├── app-1.js
│ └── module
│ │ ├── common.js
│ │ └── routes.js
├── web-server
│ ├── static
│ │ ├── data.json
│ │ ├── test.js
│ │ ├── test.css
│ │ └── test.html
│ ├── data
│ │ └── test.json
│ ├── app.js
│ ├── app-1.js
│ └── module
│ │ └── common.js
├── web-server-fengzhuang
│ ├── static
│ │ ├── data.json
│ │ ├── test.js
│ │ ├── test.css
│ │ └── test.html
│ ├── data
│ │ └── test.json
│ ├── app.js
│ ├── app-1.js
│ └── module
│ │ ├── routes.js
│ │ └── common.js
├── app-3.js
├── demomd5
│ ├── app-md5.js
│ ├── node_modules
│ │ ├── silly-datetime
│ │ │ ├── .babelrc
│ │ │ ├── .travis.yml
│ │ │ ├── rollup.js
│ │ │ ├── bower.json
│ │ │ ├── .jshintrc
│ │ │ ├── .npmignore
│ │ │ ├── LICENSE
│ │ │ ├── package.json
│ │ │ ├── README.md
│ │ │ └── test
│ │ │ │ └── test.js
│ │ ├── charenc
│ │ │ ├── README.js
│ │ │ ├── charenc.js
│ │ │ ├── package.json
│ │ │ └── LICENSE.mkd
│ │ ├── crypt
│ │ │ ├── README.mkd
│ │ │ ├── package.json
│ │ │ ├── LICENSE.mkd
│ │ │ └── crypt.js
│ │ ├── md5
│ │ │ ├── .travis.yml
│ │ │ ├── webpack.config.js
│ │ │ ├── demo
│ │ │ │ └── index.html
│ │ │ ├── LICENSE
│ │ │ ├── package.json
│ │ │ └── test.js
│ │ └── is-buffer
│ │ │ ├── index.js
│ │ │ ├── test
│ │ │ └── basic.js
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ └── package.json
│ ├── app-silly-datetime.js
│ ├── package.json
│ └── package-lock.json
├── node_modules
│ ├── cy
│ │ ├── cy.js
│ │ └── package.json
│ ├── axios
│ │ └── index.js
│ ├── .bin
│ │ ├── mkdirp.cmd
│ │ └── mkdirp
│ └── mkdirp
│ │ ├── lib
│ │ ├── use-native.js
│ │ ├── path-arg.js
│ │ ├── opts-arg.js
│ │ ├── find-made.js
│ │ ├── mkdirp-native.js
│ │ └── mkdirp-manual.js
│ │ ├── CHANGELOG.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── bin
│ │ └── cmd.js
├── module
│ ├── tools.js
│ └── request.js
├── createReadStream
│ ├── app-guandaoliu.js
│ ├── input.txt
│ ├── app-1.js
│ ├── app.js
│ └── data
│ │ ├── app.js
│ │ └── app-copy.js
├── 15express_router
│ ├── express_router-1.js
│ ├── express_router-3.js
│ ├── module
│ │ └── route.js
│ └── express_router-2.js
├── url.js
├── package-lock.json
├── app.js
├── app-1.js
└── app-2.js
├── nodejs-view
├── 1.http-url.js
└── 2.url.js
└── README.md
/nodejs/async/wwwroot/upload:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nodejs/async/wwwroot/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nodejs/demo-mkdirp/wwwroot/upload:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nodejs/demo-mkdirp/wwwroot/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nodejs/demofs/html/index.html:
--------------------------------------------------------------------------------
1 | 你好nodejs
--------------------------------------------------------------------------------
/nodejs/demofs/html/base.css:
--------------------------------------------------------------------------------
1 | body{color:red}
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/ejs:
--------------------------------------------------------------------------------
1 | _ejs@3.1.5@ejs
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/async:
--------------------------------------------------------------------------------
1 | _async@0.9.2@async
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/chalk:
--------------------------------------------------------------------------------
1 | _chalk@2.4.2@chalk
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/jake:
--------------------------------------------------------------------------------
1 | _jake@10.8.2@jake
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/filelist:
--------------------------------------------------------------------------------
1 | _filelist@1.0.1@filelist
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/has-flag:
--------------------------------------------------------------------------------
1 | _has-flag@3.0.0@has-flag
--------------------------------------------------------------------------------
/nodejs/14web-ejs/static/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "aaa": "666"
3 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/static/test.js:
--------------------------------------------------------------------------------
1 | console.log("执行了js部分");
2 |
--------------------------------------------------------------------------------
/nodejs/web-server/static/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "aaa": "666"
3 | }
--------------------------------------------------------------------------------
/nodejs/web-server/static/test.js:
--------------------------------------------------------------------------------
1 | console.log("执行了js部分");
2 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/.bin/ejs:
--------------------------------------------------------------------------------
1 | ../_ejs@3.1.5@ejs/bin/cli.js
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/color-name:
--------------------------------------------------------------------------------
1 | _color-name@1.1.3@color-name
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/concat-map:
--------------------------------------------------------------------------------
1 | _concat-map@0.0.1@concat-map
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/minimatch:
--------------------------------------------------------------------------------
1 | _minimatch@3.0.4@minimatch
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/ansi-styles:
--------------------------------------------------------------------------------
1 | _ansi-styles@3.2.1@ansi-styles
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/static/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "aaa": "666"
3 | }
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/static/test.js:
--------------------------------------------------------------------------------
1 | console.log("执行了js部分");
2 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/color-convert:
--------------------------------------------------------------------------------
1 | _color-convert@1.9.3@color-convert
--------------------------------------------------------------------------------
/nodejs/app-3.js:
--------------------------------------------------------------------------------
1 | // 测试 cy
2 |
3 | const cy = require('cy')
4 |
5 | cy.add()
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/balanced-match:
--------------------------------------------------------------------------------
1 | _balanced-match@1.0.0@balanced-match
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/supports-color:
--------------------------------------------------------------------------------
1 | _supports-color@5.5.0@supports-color
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_ejs@3.1.5@ejs/node_modules/jake:
--------------------------------------------------------------------------------
1 | ../../_jake@10.8.2@jake
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/brace-expansion:
--------------------------------------------------------------------------------
1 | _brace-expansion@1.1.11@brace-expansion
--------------------------------------------------------------------------------
/nodejs/14web-ejs/static/test.css:
--------------------------------------------------------------------------------
1 | .p1 {
2 | color: red;
3 | font-size: 50px;
4 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/node_modules/async:
--------------------------------------------------------------------------------
1 | ../../_async@0.9.2@async
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/node_modules/chalk:
--------------------------------------------------------------------------------
1 | ../../_chalk@2.4.2@chalk
--------------------------------------------------------------------------------
/nodejs/web-server/static/test.css:
--------------------------------------------------------------------------------
1 | .p1 {
2 | color: red;
3 | font-size: 50px;
4 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/escape-string-regexp:
--------------------------------------------------------------------------------
1 | _escape-string-regexp@1.0.5@escape-string-regexp
--------------------------------------------------------------------------------
/nodejs/demomd5/app-md5.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | var md5 = require("md5");
4 |
5 | console.log(md5('123456'));
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [ "es2015-rollup" ]
3 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/node_modules/filelist:
--------------------------------------------------------------------------------
1 | ../../_filelist@1.0.1@filelist
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/node_modules/minimatch:
--------------------------------------------------------------------------------
1 | ../../_minimatch@3.0.4@minimatch
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/charenc/README.js:
--------------------------------------------------------------------------------
1 | **enc** provides crypto character encoding utilities.
2 |
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/static/test.css:
--------------------------------------------------------------------------------
1 | .p1 {
2 | color: red;
3 | font-size: 50px;
4 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_ejs@3.1.5@ejs/node_modules/.bin/jake:
--------------------------------------------------------------------------------
1 | ../../../_jake@10.8.2@jake/bin/cli.js
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/crypt/README.mkd:
--------------------------------------------------------------------------------
1 | **crypt** provides utilities for encryption and hashing
2 |
--------------------------------------------------------------------------------
/nodejs/node_modules/cy/cy.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | exports.add = function(){
4 | console.log('添加数据')
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_chalk@2.4.2@chalk/node_modules/ansi-styles:
--------------------------------------------------------------------------------
1 | ../../_ansi-styles@3.2.1@ansi-styles
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_filelist@1.0.1@filelist/node_modules/minimatch:
--------------------------------------------------------------------------------
1 | ../../_minimatch@3.0.4@minimatch
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_chalk@2.4.2@chalk/node_modules/supports-color:
--------------------------------------------------------------------------------
1 | ../../_supports-color@5.5.0@supports-color
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_supports-color@5.5.0@supports-color/node_modules/has-flag:
--------------------------------------------------------------------------------
1 | ../../_has-flag@3.0.0@has-flag
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-convert@1.9.3@color-convert/node_modules/color-name:
--------------------------------------------------------------------------------
1 | ../../_color-name@1.1.3@color-name
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_ansi-styles@3.2.1@ansi-styles/node_modules/color-convert:
--------------------------------------------------------------------------------
1 | ../../_color-convert@1.9.3@color-convert
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_brace-expansion@1.1.11@brace-expansion/node_modules/concat-map:
--------------------------------------------------------------------------------
1 | ../../_concat-map@0.0.1@concat-map
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_concat-map@0.0.1@concat-map/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.4
4 | - 0.6
5 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_minimatch@3.0.4@minimatch/node_modules/brace-expansion:
--------------------------------------------------------------------------------
1 | ../../_brace-expansion@1.1.11@brace-expansion
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/md5/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.12
4 | - 4
5 | - 5
6 | - 6
7 | - 7
8 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "0.12"
4 | - "0.11"
5 | - "0.10"
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_chalk@2.4.2@chalk/node_modules/escape-string-regexp:
--------------------------------------------------------------------------------
1 | ../../_escape-string-regexp@1.0.5@escape-string-regexp
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_async@0.9.2@async/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "0.10"
4 | - "0.12"
5 | - "iojs"
6 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_brace-expansion@1.1.11@brace-expansion/node_modules/balanced-match:
--------------------------------------------------------------------------------
1 | ../../_balanced-match@1.0.0@balanced-match
--------------------------------------------------------------------------------
/nodejs/module/tools.js:
--------------------------------------------------------------------------------
1 | function formatApi(api){
2 | return "http://www.baidu.com/" + api;
3 | }
4 | module.exports.formatApi = formatApi
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_balanced-match@1.0.0@balanced-match/.npmignore:
--------------------------------------------------------------------------------
1 | test
2 | .gitignore
3 | .travis.yml
4 | Makefile
5 | example.js
6 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_supports-color@5.5.0@supports-color/browser.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | stdout: false,
4 | stderr: false
5 | };
6 |
--------------------------------------------------------------------------------
/nodejs/demo-mkdirp/app-mkdirp.js:
--------------------------------------------------------------------------------
1 |
2 | const mkdirp = require("mkdirp");
3 |
4 | mkdirp('./upload').then(made =>
5 | console.log(`made directories, starting with ${made}`))
--------------------------------------------------------------------------------
/nodejs/node_modules/axios/index.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | exports.get = function(){
4 | console.log('从服务器获取数据')
5 | }
6 |
7 | exports.post = function(){
8 | console.log('提交数据')
9 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/data/test.json:
--------------------------------------------------------------------------------
1 | {
2 | ".html": "text/html",
3 | ".css": "text/css",
4 | ".js": "text/javascript",
5 | ".gz": "application/x-gzip",
6 | ".h": "text/plain",
7 | ".gif": "image/gif"
8 | }
--------------------------------------------------------------------------------
/nodejs/demomd5/app-silly-datetime.js:
--------------------------------------------------------------------------------
1 |
2 | var sd = require('silly-datetime');
3 | // var md5 = require("md5")
4 | var time = sd.format(new Date(), 'YYYY-MM-DD HH:mm');
5 |
6 | // console.log(time)
7 | console.log(md5('123456'))
--------------------------------------------------------------------------------
/nodejs/web-server/data/test.json:
--------------------------------------------------------------------------------
1 | {
2 | ".html": "text/html",
3 | ".css": "text/css",
4 | ".js": "text/javascript",
5 | ".gz": "application/x-gzip",
6 | ".h": "text/plain",
7 | ".gif": "image/gif"
8 | }
--------------------------------------------------------------------------------
/nodejs/node_modules/.bin/mkdirp.cmd:
--------------------------------------------------------------------------------
1 | @IF EXIST "%~dp0\node.exe" (
2 | "%~dp0\node.exe" "%~dp0\..\mkdirp\bin\cmd.js" %*
3 | ) ELSE (
4 | @SETLOCAL
5 | @SET PATHEXT=%PATHEXT:;.JS;=;%
6 | node "%~dp0\..\mkdirp\bin\cmd.js" %*
7 | )
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/data/test.json:
--------------------------------------------------------------------------------
1 | {
2 | ".html": "text/html",
3 | ".css": "text/css",
4 | ".js": "text/javascript",
5 | ".gz": "application/x-gzip",
6 | ".h": "text/plain",
7 | ".gif": "image/gif"
8 | }
--------------------------------------------------------------------------------
/nodejs/module/request.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | var obj = {
4 | get:function(){
5 | console.log('向服务器请求数据')
6 | },
7 | post:function(){
8 | console.log('提交数据')
9 | }
10 | }
11 |
12 | exports.OB = obj;
13 | module.exports = obj
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-name@1.1.3@color-name/test.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | var names = require('./');
4 | var assert = require('assert');
5 |
6 | assert.deepEqual(names.red, [255,0,0]);
7 | assert.deepEqual(names.aliceblue, [240,248,255]);
8 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_concat-map@0.0.1@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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/integration/jakelib/required_module.jake.js:
--------------------------------------------------------------------------------
1 | let { task, namespace } = require("jake");
2 |
3 | namespace('usingRequire', function () {
4 | task('test', () => {
5 | console.log('howdy test');
6 | });
7 | });
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/nodejs/demofs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demofs",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "appfs.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC"
12 | }
13 |
--------------------------------------------------------------------------------
/nodejs/async/app-promise.js:
--------------------------------------------------------------------------------
1 | function getData(resolve, reject) {
2 | setTimeout(function () {
3 | var name = "fhj";
4 | resolve(name);
5 | }, 1000);
6 | }
7 |
8 | // 传入 函数
9 | var p = new Promise(getData);
10 |
11 | p.then((data) => {
12 | console.log(data); // 拿到内部数据 fhj
13 | });
14 |
--------------------------------------------------------------------------------
/nodejs/createReadStream/app-guandaoliu.js:
--------------------------------------------------------------------------------
1 | // 引入 fs模块
2 | const fs = require("fs");
3 |
4 | // 创建 读取流
5 | var readStream = fs.createReadStream("./app.js");
6 | // 创建 写入流
7 | var writeStream = fs.createWriteStream("./data/app-copy.js");
8 | // 管道操作 读取流的内容 流进写入流里面
9 | readStream.pipe(writeStream);
10 |
--------------------------------------------------------------------------------
/nodejs/node_modules/cy/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cy",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "cy.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC"
12 | }
13 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/md5/webpack.config.js:
--------------------------------------------------------------------------------
1 | const {resolve} = require('path');
2 |
3 | module.exports = {
4 | entry: [
5 | './md5.js'
6 | ],
7 | output: {
8 | path: resolve('./dist'),
9 | filename: 'md5.min.js',
10 | libraryTarget: "var",
11 | library: "MD5"
12 | }
13 | };
--------------------------------------------------------------------------------
/nodejs/15express_router/express_router-1.js:
--------------------------------------------------------------------------------
1 | var app = function () {
2 | console.log("调用app方法");
3 | };
4 |
5 | app.get = function () {
6 | console.log("get方法");
7 | };
8 |
9 | app.post = function () {
10 | console.log("post方法");
11 | };
12 |
13 | //调用
14 | app();
15 | app.get();
16 | app.post();
17 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/app.js:
--------------------------------------------------------------------------------
1 | var http = require("http");
2 | http
3 | .createServer(function (request, response) {
4 | response.writeHead(200, { "Content-Type": 'text/html;charset="utf-8"' });
5 | response.end("Hello World");
6 | })
7 | .listen(8081);
8 |
9 | console.log("Server running at http://127.0.0.1:8081/");
10 |
--------------------------------------------------------------------------------
/nodejs/url.js:
--------------------------------------------------------------------------------
1 | const { get } = require("http");
2 | const url = require("url");
3 |
4 | var api = "http://www.baidu.com?name=zhangsan&age=20";
5 |
6 | // console.log(url.parse(api,true))
7 |
8 | var getValue = url.parse(api,true).query;
9 | console.log(getValue)
10 |
11 | console.log(`姓名:${getValue.name} -- 年龄:${getValue.age}`)
--------------------------------------------------------------------------------
/nodejs/web-server/app.js:
--------------------------------------------------------------------------------
1 | var http = require("http");
2 | http
3 | .createServer(function (request, response) {
4 | response.writeHead(200, { "Content-Type": 'text/html;charset="utf-8"' });
5 | response.end("Hello World");
6 | })
7 | .listen(8081);
8 |
9 | console.log("Server running at http://127.0.0.1:8081/");
10 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/lib/task/index.js:
--------------------------------------------------------------------------------
1 |
2 | let Task = require('./task').Task;
3 | let FileTask = require('./file_task').FileTask;
4 | let DirectoryTask = require('./directory_task').DirectoryTask;
5 |
6 | exports.Task = Task;
7 | exports.FileTask = FileTask;
8 | exports.DirectoryTask = DirectoryTask;
9 |
10 |
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/app.js:
--------------------------------------------------------------------------------
1 | var http = require("http");
2 | http
3 | .createServer(function (request, response) {
4 | response.writeHead(200, { "Content-Type": 'text/html;charset="utf-8"' });
5 | response.end("Hello World");
6 | })
7 | .listen(8081);
8 |
9 | console.log("Server running at http://127.0.0.1:8081/");
10 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_filelist@1.0.1@filelist/Jakefile:
--------------------------------------------------------------------------------
1 | testTask('FileList', function () {
2 | this.testFiles.include('test/*.js');
3 | });
4 |
5 | publishTask('FileList', function () {
6 | this.packageFiles.include([
7 | 'Jakefile'
8 | , 'README.md'
9 | , 'package.json'
10 | , 'index.js'
11 | ]);
12 | });
13 |
14 |
15 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_escape-string-regexp@1.0.5@escape-string-regexp/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
4 |
5 | module.exports = function (str) {
6 | if (typeof str !== 'string') {
7 | throw new TypeError('Expected a string');
8 | }
9 |
10 | return str.replace(matchOperatorsRe, '\\$&');
11 | };
12 |
--------------------------------------------------------------------------------
/nodejs/demomd5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demomd5",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "md5": "^2.3.0",
13 | "silly-datetime": "^0.1.2"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/nodejs/createReadStream/input.txt:
--------------------------------------------------------------------------------
1 | 这里有很多数据
2 | 这里有很多数据
3 | 这里有很多数据
4 | 这里有很多数据
5 | 这里有很多数据
6 | 这里有很多数据
7 | 这里有很多数据
8 | 这里有很多数据
9 |
10 | 这里有很多数据
11 | 这里有很多数据
12 | 这里有很多数据
13 | 这里有很多数据
14 | 这里有很多数据
15 | 这里有很多数据
16 | 这里有很多数据
17 |
18 | 这里有很多数据
19 | 这里有很多数据
20 |
21 | 这里有很多数据
22 | 这里有很多数据
23 | 这里有很多数据
24 | 这里有很多数据
25 | 这里有很多数据
26 | 这里有很多数据
27 | 这里有很多数据
28 | 这里有很多数据
29 | 这里有很多数据
30 | 这里有很多数据
31 |
--------------------------------------------------------------------------------
/nodejs-view/1.http-url.js:
--------------------------------------------------------------------------------
1 | // 使用 http模块 输入内容网页不乱码
2 | var http = require("http");
3 |
4 | http
5 | .createServer(function (req, res) {
6 | res.writeHead(200, { "Content-type": "text/html;" });
7 | res.write("
");
8 | res.end("Hello world 你好");
9 | console.log(req.url);
10 | })
11 | .listen(8081);
12 |
13 | console.log("Server is running");
14 |
--------------------------------------------------------------------------------
/nodejs/node_modules/.bin/mkdirp:
--------------------------------------------------------------------------------
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/../mkdirp/bin/cmd.js" "$@"
10 | ret=$?
11 | else
12 | node "$basedir/../mkdirp/bin/cmd.js" "$@"
13 | ret=$?
14 | fi
15 | exit $ret
16 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_has-flag@3.0.0@has-flag/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = (flag, argv) => {
3 | argv = argv || process.argv;
4 | const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
5 | const pos = argv.indexOf(prefix + flag);
6 | const terminatorPos = argv.indexOf('--');
7 | return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
8 | };
9 |
--------------------------------------------------------------------------------
/nodejs/async/app-async.js:
--------------------------------------------------------------------------------
1 | /*
2 | 1、await 必须包裹在 async里
3 | 2、async 函数 返回的是Promise 对象
4 | */
5 | async function test() {
6 | return new Promise((resolve, reject) => {
7 | setTimeout(() => {
8 | var name = "fhj";
9 | resolve(name);
10 | }, 1000);
11 | });
12 | }
13 |
14 | async function main() {
15 | var data = await test(); //获取异步方法里的数据
16 | console.log(data); // fhj
17 | }
18 | main();
19 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_async@0.9.2@async/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "async",
3 | "description": "Higher-order functions and common patterns for asynchronous code",
4 | "version": "0.9.2",
5 | "keywords": [
6 | "async",
7 | "callback",
8 | "utility",
9 | "module"
10 | ],
11 | "license": "MIT",
12 | "repository": "caolan/async",
13 | "scripts": [
14 | "lib/async.js"
15 | ]
16 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/static/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 | test
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/nodejs/web-server/static/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 | test
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/nodejs/createReadStream/app-1.js:
--------------------------------------------------------------------------------
1 | // 以流的方式 写入文件
2 | const fs = require("fs");
3 | var str = "";
4 |
5 | for (var i = 0; i < 300; i++) {
6 | str += "我是从数据库获取的数据,我需要保存起来\n";
7 | }
8 |
9 | //创建 写入流
10 | var writeStream = fs.createWriteStream("./output.txt");
11 | writeStream.write(str);
12 |
13 | //标记文件结束
14 | writeStream.end();
15 |
16 | // 对写入完成进行监听
17 | writeStream.on("finish", () => {
18 | console.log("写入完成");
19 | });
20 |
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/static/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 | test
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_concat-map@0.0.1@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 |
--------------------------------------------------------------------------------
/nodejs/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "requires": true,
3 | "lockfileVersion": 1,
4 | "dependencies": {
5 | "cy": {
6 | "version": "1.0.0"
7 | },
8 | "mkdirp": {
9 | "version": "1.0.4",
10 | "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz",
11 | "integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34="
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-name@1.1.3@color-name/README.md:
--------------------------------------------------------------------------------
1 | A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
2 |
3 | [](https://nodei.co/npm/color-name/)
4 |
5 |
6 | ```js
7 | var colors = require('color-name');
8 | colors.red //[255,0,0]
9 | ```
10 |
11 |
12 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/views/login.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 | 这是一个登陆页面
12 |
13 | <%=msg%>
14 |
15 |
16 | <%for(var i=0;i < tlist.length; i ++){%>
17 | - <%=tlist[i].title%>
18 | <%}%>
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/nodejs/createReadStream/app.js:
--------------------------------------------------------------------------------
1 | // 以流的方式 读取文件
2 | const fs = require("fs");
3 |
4 | // 创建读取流
5 | var readStream = fs.createReadStream("./input.txt");
6 |
7 | var count = 0;
8 | var str = "";
9 |
10 | readStream.on("data", (data) => {
11 | str += data; // 读取数据
12 | count++;
13 | });
14 |
15 | // 监听 读取结束时 打印信息
16 | readStream.on("end", () => {
17 | console.log(str);
18 | console.log(count);
19 | });
20 |
21 | // 监听 读取失败时 打印信息
22 | readStream.on("error", (err) => {
23 | console.log(err);
24 | });
25 |
--------------------------------------------------------------------------------
/nodejs/createReadStream/data/app.js:
--------------------------------------------------------------------------------
1 | // 以流的方式 读取文件
2 | const fs = require("fs");
3 |
4 | // 创建读取流
5 | var readStream = fs.createReadStream("./input.txt");
6 |
7 | var count = 0;
8 | var str = "";
9 |
10 | readStream.on("data", (data) => {
11 | str += data; // 读取数据
12 | count++;
13 | });
14 |
15 | // 监听 读取结束时 打印信息
16 | readStream.on("end", () => {
17 | console.log(str);
18 | console.log(count);
19 | });
20 |
21 | // 监听 读取失败时 打印信息
22 | readStream.on("error", (err) => {
23 | console.log(err);
24 | });
25 |
--------------------------------------------------------------------------------
/nodejs/createReadStream/data/app-copy.js:
--------------------------------------------------------------------------------
1 | // 以流的方式 读取文件
2 | const fs = require("fs");
3 |
4 | // 创建读取流
5 | var readStream = fs.createReadStream("./input.txt");
6 |
7 | var count = 0;
8 | var str = "";
9 |
10 | readStream.on("data", (data) => {
11 | str += data; // 读取数据
12 | count++;
13 | });
14 |
15 | // 监听 读取结束时 打印信息
16 | readStream.on("end", () => {
17 | console.log(str);
18 | console.log(count);
19 | });
20 |
21 | // 监听 读取失败时 打印信息
22 | readStream.on("error", (err) => {
23 | console.log(err);
24 | });
25 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/lib/use-native.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version
4 | const versArr = version.replace(/^v/, '').split('.')
5 | const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12
6 |
7 | const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir
8 | const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync
9 |
10 | module.exports = {useNative, useNativeSync}
11 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/rollup.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var rollup = require( 'rollup' );
4 | var babel = require('rollup-plugin-babel');
5 |
6 | rollup.rollup({
7 | entry: 'src/index.js',
8 | plugins: [
9 | babel()
10 | ]
11 | }).then( function ( bundle ) {
12 | // CommonJS
13 | bundle.write({
14 | format: 'cjs',
15 | dest: 'dest/index.js'
16 | });
17 | // UMD
18 | bundle.write({
19 | format: 'umd',
20 | moduleName: 'SillyDatetime',
21 | dest: 'dest/index.umd.js'
22 | });
23 | });
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changers Lorgs!
2 |
3 | ## 1.0
4 |
5 | Full rewrite. Essentially a brand new module.
6 |
7 | - Return a promise instead of taking a callback.
8 | - Use native `fs.mkdir(path, { recursive: true })` when available.
9 | - Drop support for outdated Node.js versions. (Technically still works on
10 | Node.js v8, but only 10 and above are officially supported.)
11 |
12 | ## 0.x
13 |
14 | Original and most widely used recursive directory creation implementation
15 | in JavaScript, dating back to 2010.
16 |
--------------------------------------------------------------------------------
/nodejs/demo-mkdirp/app-www.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 | const path = "./wwwroot";
3 |
4 | var dirArr = [];
5 | fs.readdir(path, (err, data) => {
6 | if (err) {
7 | console.log(err);
8 | return;
9 | }
10 |
11 | (function getDir(i) {
12 | if (i == data.length) {
13 | console.log(dirArr);
14 | return;
15 | }
16 | fs.stat(path + "/" + data[i], (error, datas) => {
17 | if (datas.isDirectory()) {
18 | dirArr.push(data[i]);
19 | }
20 | getDir(i + 1);
21 | });
22 | })(0);
23 | });
24 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "silly-datetime",
3 | "main": "dest/index.umd.js",
4 | "version": "0.1.1",
5 | "homepage": "https://github.com/csbun/silly-datetime",
6 | "authors": [
7 | "Hans Chan "
8 | ],
9 | "description": "simple datetime formater",
10 | "keywords": [
11 | "datetime",
12 | "format"
13 | ],
14 | "license": "MIT",
15 | "ignore": [
16 | "**/.*",
17 | "node_modules",
18 | "bower_components",
19 | "test",
20 | "tests"
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/views/form.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "bitwise": true,
3 | "camelcase": true,
4 | "eqeqeq": true,
5 | "esnext": true,
6 | "forin": true,
7 | "immed": true,
8 | "indent": 4,
9 | "latedef": false,
10 | "newcap": true,
11 | "noarg": true,
12 | "noempty": true,
13 | "predef": ["describe", "it", "define"],
14 | "quotmark": "single",
15 | "undef": true,
16 | "unused": true,
17 | "strict": true,
18 | "trailing": true,
19 | "eqnull": true,
20 | "browser": true,
21 | "devel": true,
22 | "node": true,
23 | "white": false
24 | }
25 |
--------------------------------------------------------------------------------
/nodejs/15express_router/express_router-3.js:
--------------------------------------------------------------------------------
1 | var http = require("http"); //引入http
2 | const app = require("./module/route"); //引入路由
3 |
4 | // 新建 http服务
5 | var http = require("http");
6 | http.createServer(app).listen(3005);
7 |
8 | // 配置路由
9 | app.get("/", function (req, res) {
10 | // res.send("hello world");
11 | res.writeHead(200, { "Content-Type": 'text/html;charset="utf-8"' });
12 | res.end("首页");
13 | });
14 |
15 | app.get("/news", function (req, res) {
16 | // res.send("hello world");
17 | res.writeHead(200, { "Content-Type": 'text/html;charset="utf-8"' });
18 | res.end("新闻页面");
19 | });
20 |
--------------------------------------------------------------------------------
/nodejs/demo-mkdirp/app-handwrite.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 |
3 | var path = "./upload";
4 |
5 | // 判断是目录还是文件
6 | fs.stat(path, (err, data) => {
7 | if (err) {
8 | //创建目录
9 | mkdir(path);
10 | return;
11 | }
12 | if (!data.isDirectory()) {
13 | fs.unlink(path, (err) => {
14 | if (!err) {
15 | mkdir(path);
16 | } else {
17 | console.log("请检查输入");
18 | }
19 | });
20 | }
21 | });
22 |
23 | // 创建目录
24 | function mkdir(dir) {
25 | fs.mkdir(dir, (err) => {
26 | if (err) {
27 | console.log(err);
28 | return;
29 | }
30 | });
31 | }
32 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/lib/utils/logger.js:
--------------------------------------------------------------------------------
1 | let util = require('util');
2 |
3 | let logger = new (function () {
4 | let _output = function (type, out) {
5 | let quiet = typeof jake != 'undefined' && jake.program &&
6 | jake.program.opts && jake.program.opts.quiet;
7 | let msg;
8 | if (!quiet) {
9 | msg = typeof out == 'string' ? out : util.inspect(out);
10 | console[type](msg);
11 | }
12 | };
13 |
14 | this.log = function (out) {
15 | _output('log', out);
16 | };
17 |
18 | this.error = function (out) {
19 | _output('error', out);
20 | };
21 |
22 | })();
23 |
24 | module.exports = logger;
25 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/README.md:
--------------------------------------------------------------------------------
1 | ### Jake -- the JavaScript build tool for Node.js
2 |
3 | [](https://travis-ci.org/jakejs/jake)
4 |
5 | Documentation site at [http://jakejs.com](http://jakejs.com/)
6 |
7 | ### Contributing
8 | 1. [Install node](http://nodejs.org/#download).
9 | 2. Clone this repository `$ git clone git@github.com:jakejs/jake.git`.
10 | 3. Install dependencies `$ npm install`.
11 | 4. Run tests with `$ npm test`.
12 | 5. Start Hacking!
13 |
14 | ### License
15 |
16 | Licensed under the Apache License, Version 2.0
17 | ()
18 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/.npmignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Directory for instrumented libs generated by jscoverage/JSCover
11 | lib-cov
12 |
13 | # Coverage directory used by tools like istanbul
14 | coverage
15 |
16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17 | .grunt
18 |
19 | # node-waf configuration
20 | .lock-wscript
21 |
22 | # Compiled binary addons (http://nodejs.org/api/addons.html)
23 | build/Release
24 |
25 | # Dependency directory
26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27 | node_modules
28 |
--------------------------------------------------------------------------------
/nodejs/15express_router/module/route.js:
--------------------------------------------------------------------------------
1 | const url = require("url");
2 | //定义 全局global G 一个空对象
3 | var G = {};
4 |
5 | var app = function (req, res) {
6 | // 执行判断
7 | // 下面的判断不能是固定的需要执行判断
8 | // 做对应替换
9 | // http://127.0.0.1:3000/news
10 | // http://127.0.0.1:3002/login 需要引入url
11 | var pathname = url.parse(req.url).pathname;
12 | if (G[pathname]) {
13 | //执行方法
14 | G[pathname](req, res);
15 | }
16 | };
17 |
18 | app.get = function (str, cb) {
19 | // 注册方法 str是下面传递的路径 cb表示callback回调函数
20 | G[str] = cb;
21 | // 相当于 执行了这一步
22 | /*
23 | G['./login'] = function(req,res){
24 | res.send('hello world')
25 | }
26 | */
27 | };
28 |
29 | // 暴露出去
30 | module.exports = app;
31 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nodejs-study
2 |
3 | 一起学习一波 nodejs, 里面有比较全的代码和说明,后加上文档说明,欢迎取用
4 |
5 | ## 学习目录清单
6 |
7 | 1、nodejs系列教程(1) https://juejin.cn/post/6908725575150469134
8 |
9 | 2、nodejs 3分钟学会系列教程(2) supervisor commanjs nodejs模块 https://juejin.cn/post/6908969391648407565
10 |
11 | 3、nodejs 3分钟学会系列教程(3) npm 第三方模块 fs模块 https://juejin.cn/post/6908999327709200392
12 |
13 | 4、nodejs 3分钟学会系列教程(4) fs模块 练习一下 async await https://juejin.cn/post/6909227827095142413
14 |
15 | 5、nodejs 3分钟学会系列教程(5) fs模块的使用 fs.createReadStream 轻松时刻 https://juejin.cn/post/6909411787779768334
16 |
17 | 6、nodejs 3分钟学会系列教程(6) 静态web服务器搭建(http url path fs模块) https://juejin.cn/post/6909461633962082311
18 |
19 | 7、待续
20 |
--------------------------------------------------------------------------------
/nodejs/15express_router/express_router-2.js:
--------------------------------------------------------------------------------
1 | //定义 全局global G 一个空对象
2 | var G = {};
3 |
4 | var app = function (req, res) {
5 | // 执行判断
6 | if (G["/news"]) {
7 | //执行方法
8 | G["/news"](req, res);
9 | }
10 | };
11 |
12 | app.get = function (str, cb) {
13 | // 注册方法 str是下面传递的路径 cb表示callback回调函数
14 | G[str] = cb;
15 | // 相当于 执行了这一步
16 | /*
17 | G['./login'] = function(req,res){
18 | res.send('hello world')
19 | }
20 | */
21 | };
22 |
23 | app.post = function () {
24 | console.log("post方法");
25 | };
26 |
27 | //执行方法
28 | app.get("/news", function (req, res) {
29 | // res.send("hello world");
30 | console.log("执行news方法");
31 | });
32 |
33 | setTimeout(() => {
34 | app("req", "res");
35 | }, 1000);
36 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_escape-string-regexp@1.0.5@escape-string-regexp/readme.md:
--------------------------------------------------------------------------------
1 | # escape-string-regexp [](https://travis-ci.org/sindresorhus/escape-string-regexp)
2 |
3 | > Escape RegExp special characters
4 |
5 |
6 | ## Install
7 |
8 | ```
9 | $ npm install --save escape-string-regexp
10 | ```
11 |
12 |
13 | ## Usage
14 |
15 | ```js
16 | const escapeStringRegexp = require('escape-string-regexp');
17 |
18 | const escapedString = escapeStringRegexp('how much $ for a unicorn?');
19 | //=> 'how much \$ for a unicorn\?'
20 |
21 | new RegExp(escapedString);
22 | ```
23 |
24 |
25 | ## License
26 |
27 | MIT © [Sindre Sorhus](http://sindresorhus.com)
28 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/app-1.js:
--------------------------------------------------------------------------------
1 | var http = require("http");
2 | var url = require("url");
3 |
4 | // 引入 routes.js
5 |
6 | const app = require("./module/routes");
7 |
8 | http
9 | .createServer(function (req, res) {
10 | // 创建 静态web服务器
11 | app.static(req, res, "static");
12 |
13 | // 路由
14 | var pathname = url.parse(req.url).pathname.replace("/", "");
15 |
16 | //http://127.0.0.1:3001/doRegister pathname=/doRegister
17 | //http://127.0.0.1:3001/news pathname=/news
18 |
19 | // 需要在上面加一个 .replace('/','')将斜杠去掉 使用''替换掉了/
20 | // pathname = doRegister pathname=news
21 |
22 | try {
23 | app[pathname](req, res);
24 | } catch (error) {
25 | app["error"](req, res); // 加载routes.js里的error项
26 | }
27 | })
28 | .listen(3002);
29 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/lib/task/directory_task.js:
--------------------------------------------------------------------------------
1 | let fs = require('fs');
2 | let FileTask = require('./file_task').FileTask;
3 |
4 | /**
5 | @name jake
6 | @namespace jake
7 | */
8 | /**
9 | @name jake.DirectoryTask
10 | @constructor
11 | @augments EventEmitter
12 | @augments jake.Task
13 | @augments jake.FileTask
14 | @description A Jake DirectoryTask
15 |
16 | @param {String} name The name of the directory to create.
17 | */
18 | class DirectoryTask extends FileTask {
19 | constructor(...args) {
20 | super(...args);
21 | if (fs.existsSync(this.name)) {
22 | this.updateModTime();
23 | }
24 | else {
25 | this.modTime = null;
26 | }
27 | }
28 | }
29 |
30 | exports.DirectoryTask = DirectoryTask;
31 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/integration/publish_task.js:
--------------------------------------------------------------------------------
1 | let assert = require('assert');
2 | let exec = require('child_process').execSync;
3 |
4 | suite('publishTask', function () {
5 |
6 | this.timeout(7000);
7 |
8 | test('default task', function () {
9 | let out = exec('./node_modules/.bin/jake -q publish').toString().trim();
10 | let expected = [
11 | 'Fetched remote tags.'
12 | , 'On branch v0.0'
13 | , 'Bumped version number to v0.0.2.'
14 | , 'Created package for zerb v0.0.2'
15 | , 'Publishing zerb v0.0.2'
16 | , './pkg/zerb-v0.0.2.tar.gz'
17 | , 'BOOM! Published.'
18 | , 'Cleaned up package'
19 | ].join('\n');
20 | assert.equal(expected, out);
21 | });
22 |
23 | });
24 |
25 |
--------------------------------------------------------------------------------
/nodejs/app.js:
--------------------------------------------------------------------------------
1 | // 引入http模块
2 | var http = require("http");
3 | const url = require("url");
4 | const tools = require("./module/tools.js")
5 | // console.log(tools)
6 | // 请求和响应
7 | http.createServer(function(req,res){
8 |
9 | //设置响应头
10 | res.writeHead(200,{"Content-Type":"text/html;charset='utf-8'"});
11 | //表示页面输出什么 然后结束响应
12 | res.write("");
13 | var api = tools.formatApi('api/focus')
14 | res.write(api)
15 | console.log(req.url) //获取页面url
16 | if(req.url != '/favicon.ico'){
17 | var userinfo = url.parse(req.url,true).query;
18 | console.log(`姓名:${userinfo.name}--年龄${userinfo.age}`)
19 | }
20 | res.end();
21 | }).listen(8081); //监听的端口
22 |
23 | console.log('Server running at http://127.0.0.1:8081/')
24 |
25 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/unit/jakefile.js:
--------------------------------------------------------------------------------
1 |
2 | task('foo', function () {
3 | console.log('ran top-level foo');
4 | });
5 |
6 | task('bar', function () {
7 | console.log('ran top-level bar');
8 | });
9 |
10 | task('zerb', function () {
11 | console.log('ran zerb');
12 | });
13 |
14 | namespace('zooby', function () {
15 | task('zerp', function () {});
16 |
17 | task('derp', ['zerp'], function () {});
18 |
19 | namespace('frang', function () {
20 |
21 | namespace('w00t', function () {
22 | task('bar', function () {
23 | console.log('ran zooby:frang:w00t:bar');
24 | });
25 | });
26 |
27 | task('asdf', function () {});
28 | });
29 |
30 | });
31 |
32 | namespace('hurr', function () {
33 | namespace('durr');
34 | });
35 |
36 |
37 |
--------------------------------------------------------------------------------
/nodejs/app-1.js:
--------------------------------------------------------------------------------
1 | // 引入http模块
2 | var http = require("http");
3 | const url = require("url");
4 | const request = require("./module/request")
5 | console.log(request)
6 | // 请求和响应
7 | http.createServer(function(req,res){
8 |
9 | //设置响应头
10 | res.writeHead(200,{"Content-Type":"text/html;charset='utf-8'"});
11 | //表示页面输出什么 然后结束响应
12 | res.write("");
13 | var api = tools.formatApi('api/focus')
14 | res.write(api)
15 | console.log(req.url) //获取页面url
16 | if(req.url != '/favicon.ico'){
17 | var userinfo = url.parse(req.url,true).query;
18 | console.log(`姓名:${userinfo.name}--年龄${userinfo.age}`)
19 | }
20 | res.end();
21 | }).listen(8081); //监听的端口
22 |
23 | console.log('Server running at http://127.0.0.1:8081/')
24 |
25 |
--------------------------------------------------------------------------------
/nodejs-view/2.url.js:
--------------------------------------------------------------------------------
1 | //这部分展示 的 url url.parse的使用
2 |
3 | const http = require("http");
4 | const url = require("url");
5 |
6 | http
7 | .createServer((req, res) => {
8 | res.writeHead(200, { "Content-type": "text/html" });
9 | res.write("");
10 | res.end("hello url 真好");
11 | console.log(req.url); ///?name=zhangsan&age=20 /favicon.ico
12 | if (req.url != "/favicon.ico") {
13 | var userinfo = url.parse(req.url, true).query;
14 | console.log(userinfo); //[Object: null prototype] { name: 'zhangsan', age: '20' }
15 | console.log(url.parse(req.url)); // 打印出拆分的url 其中包含 query: 'name=zhangsan&age=20',
16 | console.log(`姓名:${userinfo.name}--年龄${userinfo.age}`);
17 | }
18 | })
19 | .listen(8081);
20 |
21 | console.log("server is running");
22 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/is-buffer/index.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Determine if an object is a Buffer
3 | *
4 | * @author Feross Aboukhadijeh
5 | * @license MIT
6 | */
7 |
8 | // The _isBuffer check is for Safari 5-7 support, because it's missing
9 | // Object.prototype.constructor. Remove this eventually
10 | module.exports = function (obj) {
11 | return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
12 | }
13 |
14 | function isBuffer (obj) {
15 | return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
16 | }
17 |
18 | // For Node v0.10 support. Remove this eventually.
19 | function isSlowBuffer (obj) {
20 | return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
21 | }
22 |
--------------------------------------------------------------------------------
/nodejs/app-2.js:
--------------------------------------------------------------------------------
1 |
2 | // 测试 axios
3 | // 引入http模块
4 | var http = require("http");
5 | const url = require("url");
6 | const axios = require("axios");
7 |
8 | axios.get();
9 | axios.post();
10 |
11 | // 请求和响应
12 | http.createServer(function(req,res){
13 |
14 | //设置响应头
15 | res.writeHead(200,{"Content-Type":"text/html;charset='utf-8'"});
16 | //表示页面输出什么 然后结束响应
17 | res.write("");
18 | var api = tools.formatApi('api/focus')
19 | res.write(api)
20 | console.log(req.url) //获取页面url
21 | if(req.url != '/favicon.ico'){
22 | var userinfo = url.parse(req.url,true).query;
23 | console.log(`姓名:${userinfo.name}--年龄${userinfo.age}`)
24 | }
25 | res.end();
26 | }).listen(8081); //监听的端口
27 |
28 | console.log('Server running at http://127.0.0.1:8081/')
29 |
30 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_minimatch@3.0.4@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 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/lib/path-arg.js:
--------------------------------------------------------------------------------
1 | const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform
2 | const { resolve, parse } = require('path')
3 | const pathArg = path => {
4 | if (/\0/.test(path)) {
5 | // simulate same failure that node raises
6 | throw Object.assign(
7 | new TypeError('path must be a string without null bytes'),
8 | {
9 | path,
10 | code: 'ERR_INVALID_ARG_VALUE',
11 | }
12 | )
13 | }
14 |
15 | path = resolve(path)
16 | if (platform === 'win32') {
17 | const badWinChars = /[*|"<>?:]/
18 | const {root} = parse(path)
19 | if (badWinChars.test(path.substr(root.length))) {
20 | throw Object.assign(new Error('Illegal characters in path.'), {
21 | path,
22 | code: 'EINVAL',
23 | })
24 | }
25 | }
26 |
27 | return path
28 | }
29 | module.exports = pathArg
30 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_async@0.9.2@async/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "async",
3 | "description": "Higher-order functions and common patterns for asynchronous code",
4 | "version": "0.9.2",
5 | "main": "lib/async.js",
6 | "keywords": [
7 | "async",
8 | "callback",
9 | "utility",
10 | "module"
11 | ],
12 | "license": "MIT",
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/caolan/async.git"
16 | },
17 | "devDependencies": {
18 | "nodeunit": ">0.0.0",
19 | "uglify-js": "1.2.x",
20 | "nodelint": ">0.0.0",
21 | "lodash": ">=2.4.1"
22 | },
23 | "moduleType": [
24 | "amd",
25 | "globals",
26 | "node"
27 | ],
28 | "ignore": [
29 | "**/.*",
30 | "node_modules",
31 | "bower_components",
32 | "test",
33 | "tests"
34 | ],
35 | "authors": [
36 | "Caolan McMahon"
37 | ]
38 | }
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/lib/opts-arg.js:
--------------------------------------------------------------------------------
1 | const { promisify } = require('util')
2 | const fs = require('fs')
3 | const optsArg = opts => {
4 | if (!opts)
5 | opts = { mode: 0o777, fs }
6 | else if (typeof opts === 'object')
7 | opts = { mode: 0o777, fs, ...opts }
8 | else if (typeof opts === 'number')
9 | opts = { mode: opts, fs }
10 | else if (typeof opts === 'string')
11 | opts = { mode: parseInt(opts, 8), fs }
12 | else
13 | throw new TypeError('invalid options argument')
14 |
15 | opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir
16 | opts.mkdirAsync = promisify(opts.mkdir)
17 | opts.stat = opts.stat || opts.fs.stat || fs.stat
18 | opts.statAsync = promisify(opts.stat)
19 | opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync
20 | opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync
21 | return opts
22 | }
23 | module.exports = optsArg
24 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/lib/find-made.js:
--------------------------------------------------------------------------------
1 | const {dirname} = require('path')
2 |
3 | const findMade = (opts, parent, path = undefined) => {
4 | // we never want the 'made' return value to be a root directory
5 | if (path === parent)
6 | return Promise.resolve()
7 |
8 | return opts.statAsync(parent).then(
9 | st => st.isDirectory() ? path : undefined, // will fail later
10 | er => er.code === 'ENOENT'
11 | ? findMade(opts, dirname(parent), parent)
12 | : undefined
13 | )
14 | }
15 |
16 | const findMadeSync = (opts, parent, path = undefined) => {
17 | if (path === parent)
18 | return undefined
19 |
20 | try {
21 | return opts.statSync(parent).isDirectory() ? path : undefined
22 | } catch (er) {
23 | return er.code === 'ENOENT'
24 | ? findMadeSync(opts, dirname(parent), parent)
25 | : undefined
26 | }
27 | }
28 |
29 | module.exports = {findMade, findMadeSync}
30 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-name@1.1.3@color-name/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "color-name",
3 | "version": "1.1.3",
4 | "description": "A list of color names and its values",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "node test.js"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git@github.com:dfcreative/color-name.git"
12 | },
13 | "keywords": [
14 | "color-name",
15 | "color",
16 | "color-keyword",
17 | "keyword"
18 | ],
19 | "author": "DY ",
20 | "license": "MIT",
21 | "bugs": {
22 | "url": "https://github.com/dfcreative/color-name/issues"
23 | },
24 | "homepage": "https://github.com/dfcreative/color-name",
25 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
26 | "_from": "color-name@1.1.3",
27 | "_resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz"
28 | }
--------------------------------------------------------------------------------
/nodejs/async/app-www.js:
--------------------------------------------------------------------------------
1 | // 1、isDir判断是目录-true 文件-false
2 | const fs = require("fs");
3 | async function isDir(path) {
4 | return new Promise((resolve, reject) => {
5 | fs.stat(path, (error, stats) => {
6 | if (error) {
7 | console.log(err);
8 | reject(err);
9 | return;
10 | }
11 | if (stats.isDirectory()) {
12 | resolve(true);
13 | } else {
14 | resolve(false);
15 | }
16 | });
17 | });
18 | }
19 |
20 | // 2、获取 wwwroot 里面的所有资源 循环遍历
21 | function main() {
22 | var path = "./wwwroot";
23 | var dirArr = [];
24 | fs.readdir(path, async (err, data) => {
25 | if (err) {
26 | console.log(err);
27 | return;
28 | }
29 | for (var i = 0; i < data.length; i++) {
30 | if (await isDir(path + "/" + data[i])) {
31 | dirArr.push(data[i]);
32 | }
33 | }
34 | console.log(dirArr);
35 | });
36 | }
37 |
38 | main();
39 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_filelist@1.0.1@filelist/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "filelist",
3 | "version": "1.0.1",
4 | "description": "Lazy-evaluating list of files, based on globs or regex patterns",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "jake test"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/mde/filelist.git"
12 | },
13 | "keywords": [
14 | "file",
15 | "utility",
16 | "glob"
17 | ],
18 | "author": "Matthew Eernisse (http://fleegix.org)",
19 | "license": "Apache-2.0",
20 | "bugs": {
21 | "url": "https://github.com/mde/filelist/issues"
22 | },
23 | "homepage": "https://github.com/mde/filelist",
24 | "dependencies": {
25 | "minimatch": "^3.0.4"
26 | },
27 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
28 | "_from": "filelist@1.0.1",
29 | "_resolved": "https://registry.npm.taobao.org/filelist/download/filelist-1.0.1.tgz"
30 | }
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/app-1.js:
--------------------------------------------------------------------------------
1 | var http = require("http");
2 | var url = require("url");
3 | // 引入 routes.js
4 | const routes = require("./module/routes");
5 |
6 | http
7 | .createServer(function (req, res) {
8 | // 创建 静态web服务器
9 | routes.static(req, res, "static");
10 |
11 | // 路由
12 | var pathname = url.parse(req.url).pathname;
13 |
14 | if (pathname == "/login") {
15 | res.writeHead(200, { "Content-Type": ' text/html ;charset="utf-8"' });
16 | res.end("执行登陆");
17 | } else if (pathname == "/register") {
18 | res.writeHead(200, { "Content-Type": ' text/html ;charset="utf-8"' });
19 | res.end("执行注册");
20 | } else if (pathname == "/admin") {
21 | res.writeHead(200, { "Content-Type": ' text/html ;charset="utf-8"' });
22 | res.end("处理后的业务逻辑");
23 | } else {
24 | res.writeHead(404, { "Content-Type": ' text/html ;charset="utf-8"' });
25 | res.end("页面不存在");
26 | }
27 | })
28 | .listen(3001);
29 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/integration/selfdep.js:
--------------------------------------------------------------------------------
1 | let assert = require('assert');
2 | let exec = require('child_process').execSync;
3 |
4 | suite('selfDep', function () {
5 |
6 | this.timeout(7000);
7 |
8 | let origStderrWrite;
9 |
10 | setup(function () {
11 | origStderrWrite = process.stderr.write;
12 | process.stderr.write = function () {};
13 | });
14 |
15 | teardown(function () {
16 | process.stderr.write = origStderrWrite;
17 | });
18 |
19 | test('self dep const', function () {
20 | try {
21 | exec('./node_modules/.bin/jake selfdepconst');
22 | }
23 | catch(e) {
24 | assert(e.message.indexOf('dependency of itself') > -1)
25 | }
26 | });
27 |
28 | test('self dep dyn', function () {
29 | try {
30 | exec('./node_modules/.bin/jake selfdepdyn');
31 | }
32 | catch(e) {
33 | assert(e.message.indexOf('dependency of itself') > -1)
34 | }
35 | });
36 |
37 | });
38 |
39 |
40 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/charenc/charenc.js:
--------------------------------------------------------------------------------
1 | var charenc = {
2 | // UTF-8 encoding
3 | utf8: {
4 | // Convert a string to a byte array
5 | stringToBytes: function(str) {
6 | return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
7 | },
8 |
9 | // Convert a byte array to a string
10 | bytesToString: function(bytes) {
11 | return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
12 | }
13 | },
14 |
15 | // Binary encoding
16 | bin: {
17 | // Convert a string to a byte array
18 | stringToBytes: function(str) {
19 | for (var bytes = [], i = 0; i < str.length; i++)
20 | bytes.push(str.charCodeAt(i) & 0xFF);
21 | return bytes;
22 | },
23 |
24 | // Convert a byte array to a string
25 | bytesToString: function(bytes) {
26 | for (var str = [], i = 0; i < bytes.length; i++)
27 | str.push(String.fromCharCode(bytes[i]));
28 | return str.join('');
29 | }
30 | }
31 | };
32 |
33 | module.exports = charenc;
34 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_minimatch@3.0.4@minimatch/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "Isaac Z. Schlueter (http://blog.izs.me)",
3 | "name": "minimatch",
4 | "description": "a glob matcher in javascript",
5 | "version": "3.0.4",
6 | "repository": {
7 | "type": "git",
8 | "url": "git://github.com/isaacs/minimatch.git"
9 | },
10 | "main": "minimatch.js",
11 | "scripts": {
12 | "test": "tap test/*.js --cov",
13 | "preversion": "npm test",
14 | "postversion": "npm publish",
15 | "postpublish": "git push origin --all; git push origin --tags"
16 | },
17 | "engines": {
18 | "node": "*"
19 | },
20 | "dependencies": {
21 | "brace-expansion": "^1.1.7"
22 | },
23 | "devDependencies": {
24 | "tap": "^10.3.2"
25 | },
26 | "license": "ISC",
27 | "files": [
28 | "minimatch.js"
29 | ],
30 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
31 | "_from": "minimatch@3.0.4",
32 | "_resolved": "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz"
33 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/bin/cli.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | /*
3 | * Jake JavaScript build tool
4 | * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | *
18 | */
19 |
20 | // Try to load a local jake
21 | try {
22 | require(`${ process.cwd() }/node_modules/jake`);
23 | }
24 | // If that fails, likely running globally
25 | catch(e) {
26 | require('../lib/jake');
27 | }
28 |
29 | var args = process.argv.slice(2);
30 |
31 | jake.run.apply(jake, args);
32 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/usage.txt:
--------------------------------------------------------------------------------
1 | Jake JavaScript build tool
2 | ********************************************************************************
3 | If no flags are given, Jake looks for a Jakefile or Jakefile.js in the current directory.
4 | ********************************************************************************
5 | {Usage}: jake [options ...] [env variables ...] target
6 |
7 | {Options}:
8 | -f, --jakefile FILE Use FILE as the Jakefile.
9 | -C, --directory DIRECTORY Change to DIRECTORY before running tasks.
10 | -B, --always-make Unconditionally make all targets.
11 | -T/ls, --tasks Display the tasks (matching optional PATTERN) with descriptions, then exit.
12 | -J, --jakelibdir JAKELIBDIR Auto-import any .jake files in JAKELIBDIR. (default is \'jakelib\')
13 | -h, --help Display this help message.
14 | -V/v, --version Display the Jake version.
15 | -ar, --allow-rejection Keep running even after unhandled promise rejection
16 |
17 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/is-buffer/test/basic.js:
--------------------------------------------------------------------------------
1 | var isBuffer = require('../')
2 | var test = require('tape')
3 |
4 | test('is-buffer', function (t) {
5 | t.equal(isBuffer(Buffer.alloc(4)), true, 'new Buffer(4)')
6 | t.equal(isBuffer(Buffer.allocUnsafeSlow(100)), true, 'SlowBuffer(100)')
7 |
8 | t.equal(isBuffer(undefined), false, 'undefined')
9 | t.equal(isBuffer(null), false, 'null')
10 | t.equal(isBuffer(''), false, 'empty string')
11 | t.equal(isBuffer(true), false, 'true')
12 | t.equal(isBuffer(false), false, 'false')
13 | t.equal(isBuffer(0), false, '0')
14 | t.equal(isBuffer(1), false, '1')
15 | t.equal(isBuffer(1.0), false, '1.0')
16 | t.equal(isBuffer('string'), false, 'string')
17 | t.equal(isBuffer({}), false, '{}')
18 | t.equal(isBuffer([]), false, '[]')
19 | t.equal(isBuffer(function foo () {}), false, 'function foo () {}')
20 | t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }')
21 | t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }')
22 |
23 | t.end()
24 | })
25 |
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/module/routes.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 | const url = require("url");
3 | const path = require("path");
4 |
5 | // 私有方法 不暴露出来 只在这个里面使用
6 | var getFileMine = function (extname) {
7 | var data = fs.readFileSync("./data/test.json"); // 同步方法
8 | var mimeObj = JSON.parse(data.toString());
9 | return mimeObj[extname];
10 | };
11 |
12 | //导出部分命名为 static
13 | exports.static = function (req, res, staticPath) {
14 | // 1、读取地址
15 | // var pathname = req.url;
16 | var pathname = url.parse(req.url).pathname;
17 | // console.log(url.parse(req.url));
18 | // 需要加一点判断
19 | pathname = pathname == "/" ? "/test.html" : pathname;
20 |
21 | // 这个方法 可以获取后缀名 path.extname
22 | var extname = path.extname(pathname);
23 | // 2、通过fs 模块读取文件
24 | if (pathname != "/favicon.ico") {
25 | try {
26 | var data = fs.readFileSync("./" + staticPath + pathname);
27 | if (data) {
28 | var mine = getFileMine(extname);
29 | res.writeHead(200, { "Content-Type": "" + mine + ';charset="utf-8"' });
30 | res.end(data);
31 | }
32 | } catch (error) {}
33 | }
34 | };
35 |
--------------------------------------------------------------------------------
/nodejs/web-server/app-1.js:
--------------------------------------------------------------------------------
1 | var http = require("http");
2 | var fs = require("fs");
3 | var path = require("path");
4 | var url = require("url");
5 | // 引入 common.js
6 | const common = require("./module/common");
7 |
8 | common.getFileMine(".gif");
9 | http
10 | .createServer(function (req, res) {
11 | // 1、读取地址
12 | // var pathname = req.url;
13 | var pathname = url.parse(req.url).pathname;
14 | // console.log(url.parse(req.url));
15 | // 需要加一点判断
16 | pathname = pathname == "/" ? "/test.html" : pathname;
17 |
18 | // 这个方法 可以获取后缀名 path.extname
19 | var extname = path.extname(pathname);
20 | // 2、通过fs 模块读取文件
21 | if (pathname != "/favicon.ico") {
22 | fs.readFile("./static" + pathname, async (err, data) => {
23 | if (err) {
24 | res.writeHead(404, { "Content-Type": 'text/html;charset="utf-8"' });
25 | res.end("404 这个界面不存在");
26 | }
27 | var mine = await common.getFileMine(extname);
28 | res.writeHead(200, { "Content-Type": "" + mine + ';charset="utf-8"' });
29 | res.end(data);
30 | });
31 | }
32 | })
33 | .listen(3001);
34 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-name@1.1.3@color-name/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | Copyright (c) 2015 Dmitry Ivanov
3 |
4 | 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:
5 |
6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 |
8 | 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.
--------------------------------------------------------------------------------
/nodejs/14web-ejs/module/common.js:
--------------------------------------------------------------------------------
1 | // 单独写一个模块 导出这个模块 匹配常见后缀
2 | exports.getMine = function (extname) {
3 | switch (
4 | extname // extname 表示后缀
5 | ) {
6 | case ".html":
7 | return "text/html";
8 | case ".css":
9 | return "text/css";
10 | case ".js":
11 | return "text/javascript";
12 | default:
13 | return "text/html";
14 | }
15 | };
16 |
17 | // const fs = require("fs");
18 | // exports.getFileMine = function (extname) {
19 | // return new Promise((resolve, reject) => {
20 | // fs.readFile("./data/test.json", (err, data) => {
21 | // if (err) {
22 | // console.log(err);
23 | // reject(err); // 失败捕获
24 | // return;
25 | // }
26 |
27 | // let mimeObj = JSON.parse(data.toString());
28 | // // console.log(mimeObj[extname]);
29 | // resolve(mimeObj[extname]); // 成功时拿到后缀
30 | // });
31 | // });
32 | // };
33 |
34 | // 第二种方法
35 | const fs = require("fs");
36 | exports.getFileMine = function (extname) {
37 | var data = fs.readFileSync("./data/test.json"); // 同步方法
38 | var mimeObj = JSON.parse(data.toString());
39 | return mimeObj[extname];
40 | };
41 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_has-flag@3.0.0@has-flag/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "has-flag",
3 | "version": "3.0.0",
4 | "description": "Check if argv has a specific flag",
5 | "license": "MIT",
6 | "repository": "sindresorhus/has-flag",
7 | "author": {
8 | "name": "Sindre Sorhus",
9 | "email": "sindresorhus@gmail.com",
10 | "url": "sindresorhus.com"
11 | },
12 | "engines": {
13 | "node": ">=4"
14 | },
15 | "scripts": {
16 | "test": "xo && ava"
17 | },
18 | "files": [
19 | "index.js"
20 | ],
21 | "keywords": [
22 | "has",
23 | "check",
24 | "detect",
25 | "contains",
26 | "find",
27 | "flag",
28 | "cli",
29 | "command-line",
30 | "argv",
31 | "process",
32 | "arg",
33 | "args",
34 | "argument",
35 | "arguments",
36 | "getopt",
37 | "minimist",
38 | "optimist"
39 | ],
40 | "devDependencies": {
41 | "ava": "*",
42 | "xo": "*"
43 | },
44 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
45 | "_from": "has-flag@3.0.0",
46 | "_resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz"
47 | }
--------------------------------------------------------------------------------
/nodejs/web-server/module/common.js:
--------------------------------------------------------------------------------
1 | // 单独写一个模块 导出这个模块 匹配常见后缀
2 | exports.getMine = function (extname) {
3 | switch (
4 | extname // extname 表示后缀
5 | ) {
6 | case ".html":
7 | return "text/html";
8 | case ".css":
9 | return "text/css";
10 | case ".js":
11 | return "text/javascript";
12 | default:
13 | return "text/html";
14 | }
15 | };
16 |
17 | // const fs = require("fs");
18 | // exports.getFileMine = function (extname) {
19 | // return new Promise((resolve, reject) => {
20 | // fs.readFile("./data/test.json", (err, data) => {
21 | // if (err) {
22 | // console.log(err);
23 | // reject(err); // 失败捕获
24 | // return;
25 | // }
26 |
27 | // let mimeObj = JSON.parse(data.toString());
28 | // // console.log(mimeObj[extname]);
29 | // resolve(mimeObj[extname]); // 成功时拿到后缀
30 | // });
31 | // });
32 | // };
33 |
34 | // 第二种方法
35 | const fs = require("fs");
36 | exports.getFileMine = function (extname) {
37 | var data = fs.readFileSync("./data/test.json"); // 同步方法
38 | var mimeObj = JSON.parse(data.toString());
39 | return mimeObj[extname];
40 | };
41 |
--------------------------------------------------------------------------------
/nodejs/web-server-fengzhuang/module/common.js:
--------------------------------------------------------------------------------
1 | // 单独写一个模块 导出这个模块 匹配常见后缀
2 | exports.getMine = function (extname) {
3 | switch (
4 | extname // extname 表示后缀
5 | ) {
6 | case ".html":
7 | return "text/html";
8 | case ".css":
9 | return "text/css";
10 | case ".js":
11 | return "text/javascript";
12 | default:
13 | return "text/html";
14 | }
15 | };
16 |
17 | // const fs = require("fs");
18 | // exports.getFileMine = function (extname) {
19 | // return new Promise((resolve, reject) => {
20 | // fs.readFile("./data/test.json", (err, data) => {
21 | // if (err) {
22 | // console.log(err);
23 | // reject(err); // 失败捕获
24 | // return;
25 | // }
26 |
27 | // let mimeObj = JSON.parse(data.toString());
28 | // // console.log(mimeObj[extname]);
29 | // resolve(mimeObj[extname]); // 成功时拿到后缀
30 | // });
31 | // });
32 | // };
33 |
34 | // 第二种方法
35 | const fs = require("fs");
36 | exports.getFileMine = function (extname) {
37 | var data = fs.readFileSync("./data/test.json"); // 同步方法
38 | var mimeObj = JSON.parse(data.toString());
39 | return mimeObj[extname];
40 | };
41 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_chalk@2.4.2@chalk/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 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/lib/mkdirp-native.js:
--------------------------------------------------------------------------------
1 | const {dirname} = require('path')
2 | const {findMade, findMadeSync} = require('./find-made.js')
3 | const {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js')
4 |
5 | const mkdirpNative = (path, opts) => {
6 | opts.recursive = true
7 | const parent = dirname(path)
8 | if (parent === path)
9 | return opts.mkdirAsync(path, opts)
10 |
11 | return findMade(opts, path).then(made =>
12 | opts.mkdirAsync(path, opts).then(() => made)
13 | .catch(er => {
14 | if (er.code === 'ENOENT')
15 | return mkdirpManual(path, opts)
16 | else
17 | throw er
18 | }))
19 | }
20 |
21 | const mkdirpNativeSync = (path, opts) => {
22 | opts.recursive = true
23 | const parent = dirname(path)
24 | if (parent === path)
25 | return opts.mkdirSync(path, opts)
26 |
27 | const made = findMadeSync(opts, path)
28 | try {
29 | opts.mkdirSync(path, opts)
30 | return made
31 | } catch (er) {
32 | if (er.code === 'ENOENT')
33 | return mkdirpManualSync(path, opts)
34 | else
35 | throw er
36 | }
37 | }
38 |
39 | module.exports = {mkdirpNative, mkdirpNativeSync}
40 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_async@0.9.2@async/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010-2014 Caolan McMahon
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
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all 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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_has-flag@3.0.0@has-flag/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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_ansi-styles@3.2.1@ansi-styles/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 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/md5/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
15 |
16 |
49 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/index.js:
--------------------------------------------------------------------------------
1 | const optsArg = require('./lib/opts-arg.js')
2 | const pathArg = require('./lib/path-arg.js')
3 |
4 | const {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js')
5 | const {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js')
6 | const {useNative, useNativeSync} = require('./lib/use-native.js')
7 |
8 |
9 | const mkdirp = (path, opts) => {
10 | path = pathArg(path)
11 | opts = optsArg(opts)
12 | return useNative(opts)
13 | ? mkdirpNative(path, opts)
14 | : mkdirpManual(path, opts)
15 | }
16 |
17 | const mkdirpSync = (path, opts) => {
18 | path = pathArg(path)
19 | opts = optsArg(opts)
20 | return useNativeSync(opts)
21 | ? mkdirpNativeSync(path, opts)
22 | : mkdirpManualSync(path, opts)
23 | }
24 |
25 | mkdirp.sync = mkdirpSync
26 | mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts))
27 | mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts))
28 | mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts))
29 | mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts))
30 |
31 | module.exports = mkdirp
32 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_concat-map@0.0.1@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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_supports-color@5.5.0@supports-color/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 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/is-buffer/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) Feross Aboukhadijeh
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 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Hans Chan
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 |
23 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-convert@1.9.3@color-convert/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2016 Heather Arthur
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
22 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_balanced-match@1.0.0@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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_brace-expansion@1.1.11@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 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me)
2 |
3 | This project is free software released under the MIT license:
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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_escape-string-regexp@1.0.5@escape-string-regexp/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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_escape-string-regexp@1.0.5@escape-string-regexp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "escape-string-regexp",
3 | "version": "1.0.5",
4 | "description": "Escape RegExp special characters",
5 | "license": "MIT",
6 | "repository": "sindresorhus/escape-string-regexp",
7 | "author": {
8 | "name": "Sindre Sorhus",
9 | "email": "sindresorhus@gmail.com",
10 | "url": "sindresorhus.com"
11 | },
12 | "maintainers": [
13 | "Sindre Sorhus (sindresorhus.com)",
14 | "Joshua Boy Nicolai Appelman (jbna.nl)"
15 | ],
16 | "engines": {
17 | "node": ">=0.8.0"
18 | },
19 | "scripts": {
20 | "test": "xo && ava"
21 | },
22 | "files": [
23 | "index.js"
24 | ],
25 | "keywords": [
26 | "escape",
27 | "regex",
28 | "regexp",
29 | "re",
30 | "regular",
31 | "expression",
32 | "string",
33 | "str",
34 | "special",
35 | "characters"
36 | ],
37 | "devDependencies": {
38 | "ava": "*",
39 | "xo": "*"
40 | },
41 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
42 | "_from": "escape-string-regexp@1.0.5",
43 | "_resolved": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz"
44 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-convert@1.9.3@color-convert/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "color-convert",
3 | "description": "Plain color conversion functions",
4 | "version": "1.9.3",
5 | "author": "Heather Arthur ",
6 | "license": "MIT",
7 | "repository": "Qix-/color-convert",
8 | "scripts": {
9 | "pretest": "xo",
10 | "test": "node test/basic.js"
11 | },
12 | "keywords": [
13 | "color",
14 | "colour",
15 | "convert",
16 | "converter",
17 | "conversion",
18 | "rgb",
19 | "hsl",
20 | "hsv",
21 | "hwb",
22 | "cmyk",
23 | "ansi",
24 | "ansi16"
25 | ],
26 | "files": [
27 | "index.js",
28 | "conversions.js",
29 | "css-keywords.js",
30 | "route.js"
31 | ],
32 | "xo": {
33 | "rules": {
34 | "default-case": 0,
35 | "no-inline-comments": 0,
36 | "operator-linebreak": 0
37 | }
38 | },
39 | "devDependencies": {
40 | "chalk": "1.1.1",
41 | "xo": "0.11.2"
42 | },
43 | "dependencies": {
44 | "color-name": "1.1.3"
45 | },
46 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
47 | "_from": "color-convert@1.9.3",
48 | "_resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz"
49 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_concat-map@0.0.1@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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_has-flag@3.0.0@has-flag/readme.md:
--------------------------------------------------------------------------------
1 | # has-flag [](https://travis-ci.org/sindresorhus/has-flag)
2 |
3 | > Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
4 |
5 | Correctly stops looking after an `--` argument terminator.
6 |
7 |
8 | ## Install
9 |
10 | ```
11 | $ npm install has-flag
12 | ```
13 |
14 |
15 | ## Usage
16 |
17 | ```js
18 | // foo.js
19 | const hasFlag = require('has-flag');
20 |
21 | hasFlag('unicorn');
22 | //=> true
23 |
24 | hasFlag('--unicorn');
25 | //=> true
26 |
27 | hasFlag('f');
28 | //=> true
29 |
30 | hasFlag('-f');
31 | //=> true
32 |
33 | hasFlag('foo=bar');
34 | //=> true
35 |
36 | hasFlag('foo');
37 | //=> false
38 |
39 | hasFlag('rainbow');
40 | //=> false
41 | ```
42 |
43 | ```
44 | $ node foo.js -f --unicorn --foo=bar -- --rainbow
45 | ```
46 |
47 |
48 | ## API
49 |
50 | ### hasFlag(flag, [argv])
51 |
52 | Returns a boolean for whether the flag exists.
53 |
54 | #### flag
55 |
56 | Type: `string`
57 |
58 | CLI flag to look for. The `--` prefix is optional.
59 |
60 | #### argv
61 |
62 | Type: `string[]`
63 | Default: `process.argv`
64 |
65 | CLI arguments.
66 |
67 |
68 | ## License
69 |
70 | MIT © [Sindre Sorhus](https://sindresorhus.com)
71 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jake",
3 | "description": "JavaScript build tool, similar to Make or Rake",
4 | "keywords": [
5 | "build",
6 | "cli",
7 | "make",
8 | "rake"
9 | ],
10 | "version": "10.8.2",
11 | "author": "Matthew Eernisse (http://fleegix.org)",
12 | "license": "Apache-2.0",
13 | "bin": {
14 | "jake": "./bin/cli.js"
15 | },
16 | "main": "./lib/jake.js",
17 | "scripts": {
18 | "lint": "eslint --format codeframe \"lib/**/*.js\" \"test/**/*.js\"",
19 | "lint:fix": "eslint --fix \"lib/**/*.js\" \"test/**/*.js\"",
20 | "test": "./bin/cli.js test",
21 | "test:ci": "npm run lint && npm run test"
22 | },
23 | "repository": {
24 | "type": "git",
25 | "url": "git://github.com/jakejs/jake.git"
26 | },
27 | "preferGlobal": true,
28 | "dependencies": {
29 | "filelist": "^1.0.1",
30 | "minimatch": "^3.0.4",
31 | "chalk": "^2.4.2",
32 | "async": "0.9.x"
33 | },
34 | "devDependencies": {
35 | "eslint": "^6.8.0",
36 | "mocha": "^7.1.1",
37 | "q": "^1.5.1"
38 | },
39 | "engines": {
40 | "node": "*"
41 | },
42 | "__npminstall_done": "Thu Dec 24 2020 20:48:43 GMT+0800 (GMT+08:00)",
43 | "_from": "jake@10.8.2",
44 | "_resolved": "https://registry.npm.taobao.org/jake/download/jake-10.8.2.tgz"
45 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-name@1.1.3@color-name/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true,
4 | "node": true,
5 | "commonjs": true,
6 | "es6": true
7 | },
8 | "extends": "eslint:recommended",
9 | "rules": {
10 | "strict": 2,
11 | "indent": 0,
12 | "linebreak-style": 0,
13 | "quotes": 0,
14 | "semi": 0,
15 | "no-cond-assign": 1,
16 | "no-constant-condition": 1,
17 | "no-duplicate-case": 1,
18 | "no-empty": 1,
19 | "no-ex-assign": 1,
20 | "no-extra-boolean-cast": 1,
21 | "no-extra-semi": 1,
22 | "no-fallthrough": 1,
23 | "no-func-assign": 1,
24 | "no-global-assign": 1,
25 | "no-implicit-globals": 2,
26 | "no-inner-declarations": ["error", "functions"],
27 | "no-irregular-whitespace": 2,
28 | "no-loop-func": 1,
29 | "no-multi-str": 1,
30 | "no-mixed-spaces-and-tabs": 1,
31 | "no-proto": 1,
32 | "no-sequences": 1,
33 | "no-throw-literal": 1,
34 | "no-unmodified-loop-condition": 1,
35 | "no-useless-call": 1,
36 | "no-void": 1,
37 | "no-with": 2,
38 | "wrap-iife": 1,
39 | "no-redeclare": 1,
40 | "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
41 | "no-sparse-arrays": 1
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_ejs@3.1.5@ejs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ejs",
3 | "description": "Embedded JavaScript templates",
4 | "keywords": [
5 | "template",
6 | "engine",
7 | "ejs"
8 | ],
9 | "version": "3.1.5",
10 | "author": "Matthew Eernisse (http://fleegix.org)",
11 | "license": "Apache-2.0",
12 | "bin": {
13 | "ejs": "./bin/cli.js"
14 | },
15 | "main": "./lib/ejs.js",
16 | "jsdelivr": "ejs.min.js",
17 | "unpkg": "ejs.min.js",
18 | "repository": {
19 | "type": "git",
20 | "url": "git://github.com/mde/ejs.git"
21 | },
22 | "bugs": "https://github.com/mde/ejs/issues",
23 | "homepage": "https://github.com/mde/ejs",
24 | "dependencies": {
25 | "jake": "^10.6.1"
26 | },
27 | "devDependencies": {
28 | "browserify": "^16.5.1",
29 | "eslint": "^6.8.0",
30 | "git-directory-deploy": "^1.5.1",
31 | "jsdoc": "^3.6.4",
32 | "lru-cache": "^4.0.1",
33 | "mocha": "^7.1.1",
34 | "uglify-js": "^3.3.16"
35 | },
36 | "engines": {
37 | "node": ">=0.10.0"
38 | },
39 | "scripts": {
40 | "test": "mocha"
41 | },
42 | "__npminstall_done": "Thu Dec 24 2020 20:48:43 GMT+0800 (GMT+08:00)",
43 | "_from": "ejs@3.1.5",
44 | "_resolved": "https://registry.npm.taobao.org/ejs/download/ejs-3.1.5.tgz?cache=0&sync_timestamp=1597678482545&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fejs%2Fdownload%2Fejs-3.1.5.tgz"
45 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_concat-map@0.0.1@concat-map/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "concat-map",
3 | "description": "concatenative mapdashery",
4 | "version": "0.0.1",
5 | "repository": {
6 | "type": "git",
7 | "url": "git://github.com/substack/node-concat-map.git"
8 | },
9 | "main": "index.js",
10 | "keywords": [
11 | "concat",
12 | "concatMap",
13 | "map",
14 | "functional",
15 | "higher-order"
16 | ],
17 | "directories": {
18 | "example": "example",
19 | "test": "test"
20 | },
21 | "scripts": {
22 | "test": "tape test/*.js"
23 | },
24 | "devDependencies": {
25 | "tape": "~2.4.0"
26 | },
27 | "license": "MIT",
28 | "author": {
29 | "name": "James Halliday",
30 | "email": "mail@substack.net",
31 | "url": "http://substack.net"
32 | },
33 | "testling": {
34 | "files": "test/*.js",
35 | "browsers": {
36 | "ie": [
37 | 6,
38 | 7,
39 | 8,
40 | 9
41 | ],
42 | "ff": [
43 | 3.5,
44 | 10,
45 | 15
46 | ],
47 | "chrome": [
48 | 10,
49 | 22
50 | ],
51 | "safari": [
52 | 5.1
53 | ],
54 | "opera": [
55 | 12
56 | ]
57 | }
58 | },
59 | "__npminstall_done": "Thu Dec 24 2020 20:48:45 GMT+0800 (GMT+08:00)",
60 | "_from": "concat-map@0.0.1",
61 | "_resolved": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz"
62 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_async@0.9.2@async/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "async",
3 | "description": "Higher-order functions and common patterns for asynchronous code",
4 | "main": "lib/async.js",
5 | "author": "Caolan McMahon",
6 | "version": "0.9.2",
7 | "keywords": [
8 | "async",
9 | "callback",
10 | "utility",
11 | "module"
12 | ],
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/caolan/async.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/caolan/async/issues"
19 | },
20 | "license": "MIT",
21 | "devDependencies": {
22 | "nodeunit": ">0.0.0",
23 | "uglify-js": "1.2.x",
24 | "nodelint": ">0.0.0",
25 | "lodash": ">=2.4.1"
26 | },
27 | "jam": {
28 | "main": "lib/async.js",
29 | "include": [
30 | "lib/async.js",
31 | "README.md",
32 | "LICENSE"
33 | ],
34 | "categories": [
35 | "Utilities"
36 | ]
37 | },
38 | "scripts": {
39 | "test": "nodeunit test/test-async.js"
40 | },
41 | "spm": {
42 | "main": "lib/async.js"
43 | },
44 | "volo": {
45 | "main": "lib/async.js",
46 | "ignore": [
47 | "**/.*",
48 | "node_modules",
49 | "bower_components",
50 | "test",
51 | "tests"
52 | ]
53 | },
54 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
55 | "_from": "async@0.9.2",
56 | "_resolved": "https://registry.npm.taobao.org/async/download/async-0.9.2.tgz"
57 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_balanced-match@1.0.0@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 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_concat-map@0.0.1@concat-map/README.markdown:
--------------------------------------------------------------------------------
1 | concat-map
2 | ==========
3 |
4 | Concatenative mapdashery.
5 |
6 | [](http://ci.testling.com/substack/node-concat-map)
7 |
8 | [](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 |
--------------------------------------------------------------------------------
/nodejs/demomd5/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demomd5",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "charenc": {
8 | "version": "0.0.2",
9 | "resolved": "https://registry.npm.taobao.org/charenc/download/charenc-0.0.2.tgz",
10 | "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
11 | },
12 | "crypt": {
13 | "version": "0.0.2",
14 | "resolved": "https://registry.npm.taobao.org/crypt/download/crypt-0.0.2.tgz",
15 | "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
16 | },
17 | "is-buffer": {
18 | "version": "1.1.6",
19 | "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz?cache=0&sync_timestamp=1604429452232&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-buffer%2Fdownload%2Fis-buffer-1.1.6.tgz",
20 | "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4="
21 | },
22 | "md5": {
23 | "version": "2.3.0",
24 | "resolved": "https://registry.npm.taobao.org/md5/download/md5-2.3.0.tgz",
25 | "integrity": "sha1-w9qaaq46MLRreww0m4exENw72k8=",
26 | "requires": {
27 | "charenc": "0.0.2",
28 | "crypt": "0.0.2",
29 | "is-buffer": "~1.1.6"
30 | }
31 | },
32 | "silly-datetime": {
33 | "version": "0.1.2",
34 | "resolved": "https://registry.npm.taobao.org/silly-datetime/download/silly-datetime-0.1.2.tgz",
35 | "integrity": "sha1-IZeOjo2EgWFgY6wRL/FGk/BuuFs="
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Jake JavaScript build tool
3 | # Copyright 2112 Matthew Eernisse (mde@fleegix.org)
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | .PHONY: all build install clean uninstall
19 |
20 | PREFIX=/usr/local
21 | DESTDIR=
22 |
23 | all: build
24 |
25 | build:
26 | @echo 'Jake built.'
27 |
28 | install:
29 | @mkdir -p $(DESTDIR)$(PREFIX)/bin && \
30 | mkdir -p $(DESTDIR)$(PREFIX)/lib/node_modules/jake && \
31 | mkdir -p ./node_modules && \
32 | npm install utilities minimatch && \
33 | cp -R ./* $(DESTDIR)$(PREFIX)/lib/node_modules/jake/ && \
34 | ln -snf ../lib/node_modules/jake/bin/cli.js $(DESTDIR)$(PREFIX)/bin/jake && \
35 | chmod 755 $(DESTDIR)$(PREFIX)/lib/node_modules/jake/bin/cli.js && \
36 | echo 'Jake installed.'
37 |
38 | clean:
39 | @true
40 |
41 | uninstall:
42 | @rm -f $(DESTDIR)$(PREFIX)/bin/jake && \
43 | rm -fr $(DESTDIR)$(PREFIX)/lib/node_modules/jake/ && \
44 | echo 'Jake uninstalled.'
45 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_supports-color@5.5.0@supports-color/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "supports-color",
3 | "version": "5.5.0",
4 | "description": "Detect whether a terminal supports color",
5 | "license": "MIT",
6 | "repository": "chalk/supports-color",
7 | "author": {
8 | "name": "Sindre Sorhus",
9 | "email": "sindresorhus@gmail.com",
10 | "url": "sindresorhus.com"
11 | },
12 | "engines": {
13 | "node": ">=4"
14 | },
15 | "scripts": {
16 | "test": "xo && ava"
17 | },
18 | "files": [
19 | "index.js",
20 | "browser.js"
21 | ],
22 | "keywords": [
23 | "color",
24 | "colour",
25 | "colors",
26 | "terminal",
27 | "console",
28 | "cli",
29 | "ansi",
30 | "styles",
31 | "tty",
32 | "rgb",
33 | "256",
34 | "shell",
35 | "xterm",
36 | "command-line",
37 | "support",
38 | "supports",
39 | "capability",
40 | "detect",
41 | "truecolor",
42 | "16m"
43 | ],
44 | "dependencies": {
45 | "has-flag": "^3.0.0"
46 | },
47 | "devDependencies": {
48 | "ava": "^0.25.0",
49 | "import-fresh": "^2.0.0",
50 | "xo": "^0.20.0"
51 | },
52 | "browser": "browser.js",
53 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
54 | "_from": "supports-color@5.5.0",
55 | "_resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz?cache=0&sync_timestamp=1608033534040&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-5.5.0.tgz"
56 | }
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/crypt/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "_from": "crypt@0.0.2",
3 | "_id": "crypt@0.0.2",
4 | "_inBundle": false,
5 | "_integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=",
6 | "_location": "/crypt",
7 | "_phantomChildren": {},
8 | "_requested": {
9 | "type": "version",
10 | "registry": true,
11 | "raw": "crypt@0.0.2",
12 | "name": "crypt",
13 | "escapedName": "crypt",
14 | "rawSpec": "0.0.2",
15 | "saveSpec": null,
16 | "fetchSpec": "0.0.2"
17 | },
18 | "_requiredBy": [
19 | "/md5"
20 | ],
21 | "_resolved": "https://registry.npm.taobao.org/crypt/download/crypt-0.0.2.tgz",
22 | "_shasum": "88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b",
23 | "_spec": "crypt@0.0.2",
24 | "_where": "C:\\Users\\13119\\Desktop\\nodejs-study\\nodejs\\demomd5\\node_modules\\md5",
25 | "author": {
26 | "name": "Paul Vorbach",
27 | "email": "paul@vorb.de",
28 | "url": "http://vorb.de"
29 | },
30 | "bugs": {
31 | "url": "https://github.com/pvorb/node-crypt/issues"
32 | },
33 | "bundleDependencies": false,
34 | "deprecated": false,
35 | "description": "utilities for encryption and hashing",
36 | "engines": {
37 | "node": "*"
38 | },
39 | "homepage": "https://github.com/pvorb/node-crypt#readme",
40 | "license": "BSD-3-Clause",
41 | "main": "crypt.js",
42 | "name": "crypt",
43 | "repository": {
44 | "type": "git",
45 | "url": "git://github.com/pvorb/node-crypt.git"
46 | },
47 | "tags": [
48 | "hash",
49 | "security"
50 | ],
51 | "version": "0.0.2"
52 | }
53 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_balanced-match@1.0.0@balanced-match/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "balanced-match",
3 | "description": "Match balanced character pairs, like \"{\" and \"}\"",
4 | "version": "1.0.0",
5 | "repository": {
6 | "type": "git",
7 | "url": "git://github.com/juliangruber/balanced-match.git"
8 | },
9 | "homepage": "https://github.com/juliangruber/balanced-match",
10 | "main": "index.js",
11 | "scripts": {
12 | "test": "make test",
13 | "bench": "make bench"
14 | },
15 | "dependencies": {},
16 | "devDependencies": {
17 | "matcha": "^0.7.0",
18 | "tape": "^4.6.0"
19 | },
20 | "keywords": [
21 | "match",
22 | "regexp",
23 | "test",
24 | "balanced",
25 | "parse"
26 | ],
27 | "author": {
28 | "name": "Julian Gruber",
29 | "email": "mail@juliangruber.com",
30 | "url": "http://juliangruber.com"
31 | },
32 | "license": "MIT",
33 | "testling": {
34 | "files": "test/*.js",
35 | "browsers": [
36 | "ie/8..latest",
37 | "firefox/20..latest",
38 | "firefox/nightly",
39 | "chrome/25..latest",
40 | "chrome/canary",
41 | "opera/12..latest",
42 | "opera/next",
43 | "safari/5.1..latest",
44 | "ipad/6.0..latest",
45 | "iphone/6.0..latest",
46 | "android-browser/4.2..latest"
47 | ]
48 | },
49 | "__npminstall_done": "Thu Dec 24 2020 20:48:45 GMT+0800 (GMT+08:00)",
50 | "_from": "balanced-match@1.0.0",
51 | "_resolved": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz"
52 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_brace-expansion@1.1.11@brace-expansion/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "brace-expansion",
3 | "description": "Brace expansion as known from sh/bash",
4 | "version": "1.1.11",
5 | "repository": {
6 | "type": "git",
7 | "url": "git://github.com/juliangruber/brace-expansion.git"
8 | },
9 | "homepage": "https://github.com/juliangruber/brace-expansion",
10 | "main": "index.js",
11 | "scripts": {
12 | "test": "tape test/*.js",
13 | "gentest": "bash test/generate.sh",
14 | "bench": "matcha test/perf/bench.js"
15 | },
16 | "dependencies": {
17 | "balanced-match": "^1.0.0",
18 | "concat-map": "0.0.1"
19 | },
20 | "devDependencies": {
21 | "matcha": "^0.7.0",
22 | "tape": "^4.6.0"
23 | },
24 | "keywords": [],
25 | "author": {
26 | "name": "Julian Gruber",
27 | "email": "mail@juliangruber.com",
28 | "url": "http://juliangruber.com"
29 | },
30 | "license": "MIT",
31 | "testling": {
32 | "files": "test/*.js",
33 | "browsers": [
34 | "ie/8..latest",
35 | "firefox/20..latest",
36 | "firefox/nightly",
37 | "chrome/25..latest",
38 | "chrome/canary",
39 | "opera/12..latest",
40 | "opera/next",
41 | "safari/5.1..latest",
42 | "ipad/6.0..latest",
43 | "iphone/6.0..latest",
44 | "android-browser/4.2..latest"
45 | ]
46 | },
47 | "__npminstall_done": "Thu Dec 24 2020 20:48:45 GMT+0800 (GMT+08:00)",
48 | "_from": "brace-expansion@1.1.11",
49 | "_resolved": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz"
50 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/bin/bash_completion.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # http://stackoverflow.com/a/246128
4 | SOURCE="${BASH_SOURCE[0]}"
5 | while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
6 | DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
7 | SOURCE="$(readlink "$SOURCE")"
8 | [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
9 | done
10 | JAKE_BIN_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
11 |
12 | # http://stackoverflow.com/a/12495480
13 | # http://stackoverflow.com/a/28647824
14 | _auto_jake()
15 | {
16 | local cur
17 | local -a COMPGEN=()
18 | _get_comp_words_by_ref -n : -c cur
19 |
20 | # run auto-completions in jake via our auto_complete.js wrapper
21 | local -a auto_complete_info=( $(export COMP_LINE="${COMP_LINE}" && ${JAKE_BIN_DIR}/auto_complete.js "$cur" "${3}") )
22 | # check reply flag
23 | local reply_flag="${auto_complete_info[0]}"
24 | if [[ "${reply_flag}" == "no-complete" ]]; then
25 | return 1
26 | fi
27 | local auto_completions=("${auto_complete_info[@]:1}")
28 | COMPGEN=( $(compgen -W "${auto_completions[*]}" -- "$cur") )
29 | COMPREPLY=( "${COMPGEN[@]}" )
30 |
31 | __ltrim_colon_completions "$cur"
32 |
33 | # do we need another space??
34 | if [[ "${reply_flag}" == "yes-space" ]]; then
35 | COMPREPLY=( "${COMPGEN[@]}" " " )
36 | fi
37 |
38 | return 0
39 | }
40 |
41 | complete -o default -F _auto_jake jake
42 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/charenc/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "_from": "charenc@0.0.2",
3 | "_id": "charenc@0.0.2",
4 | "_inBundle": false,
5 | "_integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=",
6 | "_location": "/charenc",
7 | "_phantomChildren": {},
8 | "_requested": {
9 | "type": "version",
10 | "registry": true,
11 | "raw": "charenc@0.0.2",
12 | "name": "charenc",
13 | "escapedName": "charenc",
14 | "rawSpec": "0.0.2",
15 | "saveSpec": null,
16 | "fetchSpec": "0.0.2"
17 | },
18 | "_requiredBy": [
19 | "/md5"
20 | ],
21 | "_resolved": "https://registry.npm.taobao.org/charenc/download/charenc-0.0.2.tgz",
22 | "_shasum": "c0a1d2f3a7092e03774bfa83f14c0fc5790a8667",
23 | "_spec": "charenc@0.0.2",
24 | "_where": "C:\\Users\\13119\\Desktop\\nodejs-study\\nodejs\\demomd5\\node_modules\\md5",
25 | "author": {
26 | "name": "Paul Vorbach",
27 | "email": "paul@vorb.de",
28 | "url": "http://vorb.de"
29 | },
30 | "bugs": {
31 | "url": "https://github.com/pvorb/node-charenc/issues"
32 | },
33 | "bundleDependencies": false,
34 | "deprecated": false,
35 | "description": "character encoding utilities",
36 | "engines": {
37 | "node": "*"
38 | },
39 | "homepage": "https://github.com/pvorb/node-charenc#readme",
40 | "license": "BSD-3-Clause",
41 | "main": "charenc.js",
42 | "name": "charenc",
43 | "repository": {
44 | "type": "git",
45 | "url": "git://github.com/pvorb/node-charenc.git"
46 | },
47 | "tags": [
48 | "utf8",
49 | "binary",
50 | "byte",
51 | "string"
52 | ],
53 | "version": "0.0.2"
54 | }
55 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/md5/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright © 2011-2012, Paul Vorbach.
2 | Copyright © 2009, Jeff Mott.
3 |
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without modification,
7 | are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 | * Redistributions in binary form must reproduce the above copyright notice, this
12 | list of conditions and the following disclaimer in the documentation and/or
13 | other materials provided with the distribution.
14 | * Neither the name Crypto-JS nor the names of its contributors may be used to
15 | endorse or promote products derived from this software without specific prior
16 | written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/charenc/LICENSE.mkd:
--------------------------------------------------------------------------------
1 | Copyright © 2011, Paul Vorbach. All rights reserved.
2 | Copyright © 2009, Jeff Mott. All rights reserved.
3 |
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without modification,
7 | are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 | * Redistributions in binary form must reproduce the above copyright notice, this
12 | list of conditions and the following disclaimer in the documentation and/or
13 | other materials provided with the distribution.
14 | * Neither the name Crypto-JS nor the names of its contributors may be used to
15 | endorse or promote products derived from this software without specific prior
16 | written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/crypt/LICENSE.mkd:
--------------------------------------------------------------------------------
1 | Copyright © 2011, Paul Vorbach. All rights reserved.
2 | Copyright © 2009, Jeff Mott. All rights reserved.
3 |
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without modification,
7 | are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 | * Redistributions in binary form must reproduce the above copyright notice, this
12 | list of conditions and the following disclaimer in the documentation and/or
13 | other materials provided with the distribution.
14 | * Neither the name Crypto-JS nor the names of its contributors may be used to
15 | endorse or promote products derived from this software without specific prior
16 | written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/integration/jakelib/publish.jake.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Jake JavaScript build tool
3 | * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | *
17 | */
18 |
19 | const PROJECT_DIR = process.env.PROJECT_DIR;
20 |
21 | let fs = require('fs');
22 | let { publishTask, rmRf, mkdirP } = require(`${PROJECT_DIR}/lib/jake`);
23 |
24 | fs.writeFileSync('package.json', '{"version": "0.0.1"}');
25 | mkdirP('tmp_publish');
26 | fs.writeFileSync('tmp_publish/foo.txt', 'FOO');
27 |
28 | publishTask('zerb', function () {
29 | this.packageFiles.include([
30 | 'package.json'
31 | , 'tmp_publish/**'
32 | ]);
33 | this.publishCmd = 'node -p -e "\'%filename\'"';
34 | this.gitCmd = 'echo'
35 | this.scheduleDelay = 0;
36 |
37 | this._ensureRepoClean = function () {};
38 | this._getCurrentBranch = function () {
39 | return 'v0.0'
40 | };
41 | });
42 |
43 | jake.setTaskTimeout(5000);
44 |
45 | jake.Task['publish'].on('complete', function () {
46 | rmRf('tmp_publish', {silent: true});
47 | rmRf('package.json', {silent: true});
48 | });
49 |
50 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_ansi-styles@3.2.1@ansi-styles/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ansi-styles",
3 | "version": "3.2.1",
4 | "description": "ANSI escape codes for styling strings in the terminal",
5 | "license": "MIT",
6 | "repository": "chalk/ansi-styles",
7 | "author": {
8 | "name": "Sindre Sorhus",
9 | "email": "sindresorhus@gmail.com",
10 | "url": "sindresorhus.com"
11 | },
12 | "engines": {
13 | "node": ">=4"
14 | },
15 | "scripts": {
16 | "test": "xo && ava",
17 | "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
18 | },
19 | "files": [
20 | "index.js"
21 | ],
22 | "keywords": [
23 | "ansi",
24 | "styles",
25 | "color",
26 | "colour",
27 | "colors",
28 | "terminal",
29 | "console",
30 | "cli",
31 | "string",
32 | "tty",
33 | "escape",
34 | "formatting",
35 | "rgb",
36 | "256",
37 | "shell",
38 | "xterm",
39 | "log",
40 | "logging",
41 | "command-line",
42 | "text"
43 | ],
44 | "dependencies": {
45 | "color-convert": "^1.9.0"
46 | },
47 | "devDependencies": {
48 | "ava": "*",
49 | "babel-polyfill": "^6.23.0",
50 | "svg-term-cli": "^2.1.1",
51 | "xo": "*"
52 | },
53 | "ava": {
54 | "require": "babel-polyfill"
55 | },
56 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
57 | "_from": "ansi-styles@3.2.1",
58 | "_resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz?cache=0&sync_timestamp=1606794868110&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-3.2.1.tgz"
59 | }
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-convert@1.9.3@color-convert/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 1.0.0 - 2016-01-07
2 |
3 | - Removed: unused speed test
4 | - Added: Automatic routing between previously unsupported conversions
5 | ([#27](https://github.com/Qix-/color-convert/pull/27))
6 | - Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions
7 | ([#27](https://github.com/Qix-/color-convert/pull/27))
8 | - Removed: `convert()` class
9 | ([#27](https://github.com/Qix-/color-convert/pull/27))
10 | - Changed: all functions to lookup dictionary
11 | ([#27](https://github.com/Qix-/color-convert/pull/27))
12 | - Changed: `ansi` to `ansi256`
13 | ([#27](https://github.com/Qix-/color-convert/pull/27))
14 | - Fixed: argument grouping for functions requiring only one argument
15 | ([#27](https://github.com/Qix-/color-convert/pull/27))
16 |
17 | # 0.6.0 - 2015-07-23
18 |
19 | - Added: methods to handle
20 | [ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors:
21 | - rgb2ansi16
22 | - rgb2ansi
23 | - hsl2ansi16
24 | - hsl2ansi
25 | - hsv2ansi16
26 | - hsv2ansi
27 | - hwb2ansi16
28 | - hwb2ansi
29 | - cmyk2ansi16
30 | - cmyk2ansi
31 | - keyword2ansi16
32 | - keyword2ansi
33 | - ansi162rgb
34 | - ansi162hsl
35 | - ansi162hsv
36 | - ansi162hwb
37 | - ansi162cmyk
38 | - ansi162keyword
39 | - ansi2rgb
40 | - ansi2hsl
41 | - ansi2hsv
42 | - ansi2hwb
43 | - ansi2cmyk
44 | - ansi2keyword
45 | ([#18](https://github.com/harthur/color-convert/pull/18))
46 |
47 | # 0.5.3 - 2015-06-02
48 |
49 | - Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
50 | ([#15](https://github.com/harthur/color-convert/issues/15))
51 |
52 | ---
53 |
54 | Check out commit logs for older releases
55 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_ejs@3.1.5@ejs/usage.txt:
--------------------------------------------------------------------------------
1 | EJS Embedded JavaScript templates
2 | {Usage}: ejs [options ...] template-file [data variables ...]
3 |
4 | {Options}:
5 | -o, --output-file FILE Write the rendered output to FILE rather than stdout.
6 | -f, --data-file FILE Must be JSON-formatted. Use parsed input from FILE as data for rendering.
7 | -i, --data-input STRING Must be JSON-formatted and URI-encoded. Use parsed input from STRING as data for rendering.
8 | -m, --delimiter CHARACTER Use CHARACTER with angle brackets for open/close (defaults to %).
9 | -p, --open-delimiter CHARACTER Use CHARACTER instead of left angle bracket to open.
10 | -c, --close-delimiter CHARACTER Use CHARACTER instead of right angle bracket to close.
11 | -s, --strict When set to `true`, generated function is in strict mode
12 | -n --no-with Use 'locals' object for vars rather than using `with` (implies --strict).
13 | -l --locals-name Name to use for the object storing local variables when not using `with`.
14 | -w --rm-whitespace Remove all safe-to-remove whitespace, including leading and trailing whitespace.
15 | -d --debug Outputs generated function body
16 | -h, --help Display this help message.
17 | -V/v, --version Display the EJS version.
18 |
19 | {Examples}:
20 | ejs -m $ ./test/fixtures/user.ejs -f ./user_data.json
21 | ejs -m $ ./test/fixtures/user.ejs name=Lerxst
22 | ejs -p [ -c ] ./template_file.ejs -o ./output.html
23 | ejs -n -l _ ./some_template.ejs -f ./data_file.json
24 | ejs -w ./template_with_whitspace.ejs -o ./output_file.html
25 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/module/routes.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 | const url = require("url");
3 | const path = require("path");
4 | const ejs = require("ejs");
5 |
6 | // 私有方法 不暴露出来 只在这个里面使用
7 | var getFileMine = function (extname) {
8 | var data = fs.readFileSync("./data/test.json"); // 同步方法
9 | var mimeObj = JSON.parse(data.toString());
10 | return mimeObj[extname];
11 | };
12 |
13 | var app = {
14 | // 静态 web服务
15 | static: (req, res, staticPath) => {
16 | // 1、读取地址
17 | // var pathname = req.url;
18 | var pathname = url.parse(req.url).pathname;
19 | // console.log(url.parse(req.url));
20 | // 需要加一点判断
21 | pathname = pathname == "/" ? "/test.html" : pathname;
22 | // 这个方法 可以获取后缀名 path.extname
23 | var extname = path.extname(pathname);
24 | // 2、通过fs 模块读取文件
25 | if (pathname != "/favicon.ico") {
26 | try {
27 | var data = fs.readFileSync("./" + staticPath + pathname);
28 | if (data) {
29 | var mine = getFileMine(extname);
30 | res.writeHead(200, {
31 | "Content-Type": "" + mine + ';charset="utf-8"',
32 | });
33 | res.end(data);
34 | }
35 | } catch (error) {}
36 | }
37 | },
38 | // 下面是一些路由
39 | news: (req, res) => {
40 | // res.end("news");
41 | ejs.renderFile("./views/form.ejs", {}, (err, data) => {
42 | res.writeHead(200, { "Content-Type": 'text/html;charset="utf-8' });
43 | res.end(data);
44 | });
45 | },
46 | register: (req, res) => {
47 | res.end("register");
48 | },
49 | doRegister: (req, res) => {
50 | res.end("doRegister");
51 | },
52 | error: (req, res) => {
53 | res.end("error");
54 | },
55 | };
56 |
57 | // 常规调用方法有两种
58 | // app.login('req...','res...')
59 | // app["login"]('req...','res...')
60 | // 将这个app暴露出去
61 | module.exports = app;
62 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_async@0.9.2@async/support/sync-package-managers.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | // This should probably be its own module but complaints about bower/etc.
4 | // support keep coming up and I'd rather just enable the workflow here for now
5 | // and figure out where this should live later. -- @beaugunderson
6 |
7 | var fs = require('fs');
8 | var _ = require('lodash');
9 |
10 | var packageJson = require('../package.json');
11 |
12 | var IGNORES = ['**/.*', 'node_modules', 'bower_components', 'test', 'tests'];
13 | var INCLUDES = ['lib/async.js', 'README.md', 'LICENSE'];
14 | var REPOSITORY_NAME = 'caolan/async';
15 |
16 | packageJson.jam = {
17 | main: packageJson.main,
18 | include: INCLUDES,
19 | categories: ['Utilities']
20 | };
21 |
22 | packageJson.spm = {
23 | main: packageJson.main
24 | };
25 |
26 | packageJson.volo = {
27 | main: packageJson.main,
28 | ignore: IGNORES
29 | };
30 |
31 | var bowerSpecific = {
32 | moduleType: ['amd', 'globals', 'node'],
33 | ignore: IGNORES,
34 | authors: [packageJson.author]
35 | };
36 |
37 | var bowerInclude = ['name', 'description', 'version', 'main', 'keywords',
38 | 'license', 'homepage', 'repository', 'devDependencies'];
39 |
40 | var componentSpecific = {
41 | repository: REPOSITORY_NAME,
42 | scripts: [packageJson.main]
43 | };
44 |
45 | var componentInclude = ['name', 'description', 'version', 'keywords',
46 | 'license'];
47 |
48 | var bowerJson = _.merge({}, _.pick(packageJson, bowerInclude), bowerSpecific);
49 | var componentJson = _.merge({}, _.pick(packageJson, componentInclude), componentSpecific);
50 |
51 | fs.writeFileSync('./bower.json', JSON.stringify(bowerJson, null, 2));
52 | fs.writeFileSync('./component.json', JSON.stringify(componentJson, null, 2));
53 | fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
54 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/integration/concurrent.js:
--------------------------------------------------------------------------------
1 | let assert = require('assert');
2 | let exec = require('child_process').execSync;
3 |
4 | suite('concurrent', function () {
5 |
6 | this.timeout(7000);
7 |
8 | test(' simple concurrent prerequisites 1', function () {
9 | let out = exec('./node_modules/.bin/jake -q concurrent:simple1').toString().trim()
10 | assert.equal('Started A\nStarted B\nFinished B\nFinished A', out);
11 | });
12 |
13 | test(' simple concurrent prerequisites 2', function () {
14 | let out = exec('./node_modules/.bin/jake -q concurrent:simple2').toString().trim()
15 | assert.equal('Started C\nStarted D\nFinished C\nFinished D', out);
16 | });
17 |
18 | test(' sequential concurrent prerequisites', function () {
19 | let out = exec('./node_modules/.bin/jake -q concurrent:seqconcurrent').toString().trim()
20 | assert.equal('Started A\nStarted B\nFinished B\nFinished A\nStarted C\nStarted D\nFinished C\nFinished D', out);
21 | });
22 |
23 | test(' concurrent concurrent prerequisites', function () {
24 | let out = exec('./node_modules/.bin/jake -q concurrent:concurrentconcurrent').toString().trim()
25 | assert.equal('Started A\nStarted B\nStarted C\nStarted D\nFinished B\nFinished C\nFinished A\nFinished D', out);
26 | });
27 |
28 | test(' concurrent prerequisites with subdependency', function () {
29 | let out = exec('./node_modules/.bin/jake -q concurrent:subdep').toString().trim()
30 | assert.equal('Started A\nFinished A\nStarted Ba\nFinished Ba', out);
31 | });
32 |
33 | test(' failing in concurrent prerequisites', function () {
34 | try {
35 | exec('./node_modules/.bin/jake -q concurrent:Cfail');
36 | }
37 | catch(err) {
38 | assert(err.message.indexOf('Command failed') > -1);
39 | }
40 | });
41 |
42 | });
43 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/md5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "_from": "md5",
3 | "_id": "md5@2.3.0",
4 | "_inBundle": false,
5 | "_integrity": "sha1-w9qaaq46MLRreww0m4exENw72k8=",
6 | "_location": "/md5",
7 | "_phantomChildren": {},
8 | "_requested": {
9 | "type": "tag",
10 | "registry": true,
11 | "raw": "md5",
12 | "name": "md5",
13 | "escapedName": "md5",
14 | "rawSpec": "",
15 | "saveSpec": null,
16 | "fetchSpec": "latest"
17 | },
18 | "_requiredBy": [
19 | "#USER",
20 | "/"
21 | ],
22 | "_resolved": "https://registry.npm.taobao.org/md5/download/md5-2.3.0.tgz",
23 | "_shasum": "c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f",
24 | "_spec": "md5",
25 | "_where": "C:\\Users\\13119\\Desktop\\nodejs-study\\nodejs\\demomd5",
26 | "author": {
27 | "name": "Paul Vorbach",
28 | "email": "paul@vorba.ch",
29 | "url": "http://paul.vorba.ch"
30 | },
31 | "bugs": {
32 | "url": "https://github.com/pvorb/node-md5/issues"
33 | },
34 | "bundleDependencies": false,
35 | "contributors": [
36 | {
37 | "name": "salba"
38 | }
39 | ],
40 | "dependencies": {
41 | "charenc": "0.0.2",
42 | "crypt": "0.0.2",
43 | "is-buffer": "~1.1.6"
44 | },
45 | "deprecated": false,
46 | "description": "js function for hashing messages with MD5",
47 | "devDependencies": {
48 | "mocha": "~2.3.4",
49 | "webpack": "~2.4.1"
50 | },
51 | "homepage": "https://github.com/pvorb/node-md5#readme",
52 | "license": "BSD-3-Clause",
53 | "main": "md5.js",
54 | "name": "md5",
55 | "optionalDependencies": {},
56 | "repository": {
57 | "type": "git",
58 | "url": "git://github.com/pvorb/node-md5.git"
59 | },
60 | "scripts": {
61 | "test": "mocha",
62 | "webpack": "webpack -p"
63 | },
64 | "tags": [
65 | "md5",
66 | "hash",
67 | "encryption",
68 | "message digest"
69 | ],
70 | "version": "2.3.0"
71 | }
72 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/lib/mkdirp-manual.js:
--------------------------------------------------------------------------------
1 | const {dirname} = require('path')
2 |
3 | const mkdirpManual = (path, opts, made) => {
4 | opts.recursive = false
5 | const parent = dirname(path)
6 | if (parent === path) {
7 | return opts.mkdirAsync(path, opts).catch(er => {
8 | // swallowed by recursive implementation on posix systems
9 | // any other error is a failure
10 | if (er.code !== 'EISDIR')
11 | throw er
12 | })
13 | }
14 |
15 | return opts.mkdirAsync(path, opts).then(() => made || path, er => {
16 | if (er.code === 'ENOENT')
17 | return mkdirpManual(parent, opts)
18 | .then(made => mkdirpManual(path, opts, made))
19 | if (er.code !== 'EEXIST' && er.code !== 'EROFS')
20 | throw er
21 | return opts.statAsync(path).then(st => {
22 | if (st.isDirectory())
23 | return made
24 | else
25 | throw er
26 | }, () => { throw er })
27 | })
28 | }
29 |
30 | const mkdirpManualSync = (path, opts, made) => {
31 | const parent = dirname(path)
32 | opts.recursive = false
33 |
34 | if (parent === path) {
35 | try {
36 | return opts.mkdirSync(path, opts)
37 | } catch (er) {
38 | // swallowed by recursive implementation on posix systems
39 | // any other error is a failure
40 | if (er.code !== 'EISDIR')
41 | throw er
42 | else
43 | return
44 | }
45 | }
46 |
47 | try {
48 | opts.mkdirSync(path, opts)
49 | return made || path
50 | } catch (er) {
51 | if (er.code === 'ENOENT')
52 | return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made))
53 | if (er.code !== 'EEXIST' && er.code !== 'EROFS')
54 | throw er
55 | try {
56 | if (!opts.statSync(path).isDirectory())
57 | throw er
58 | } catch (_) {
59 | throw er
60 | }
61 | }
62 | }
63 |
64 | module.exports = {mkdirpManual, mkdirpManualSync}
65 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_chalk@2.4.2@chalk/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "chalk",
3 | "version": "2.4.2",
4 | "description": "Terminal string styling done right",
5 | "license": "MIT",
6 | "repository": "chalk/chalk",
7 | "engines": {
8 | "node": ">=4"
9 | },
10 | "scripts": {
11 | "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava",
12 | "bench": "matcha benchmark.js",
13 | "coveralls": "nyc report --reporter=text-lcov | coveralls"
14 | },
15 | "files": [
16 | "index.js",
17 | "templates.js",
18 | "types/index.d.ts",
19 | "index.js.flow"
20 | ],
21 | "keywords": [
22 | "color",
23 | "colour",
24 | "colors",
25 | "terminal",
26 | "console",
27 | "cli",
28 | "string",
29 | "str",
30 | "ansi",
31 | "style",
32 | "styles",
33 | "tty",
34 | "formatting",
35 | "rgb",
36 | "256",
37 | "shell",
38 | "xterm",
39 | "log",
40 | "logging",
41 | "command-line",
42 | "text"
43 | ],
44 | "dependencies": {
45 | "ansi-styles": "^3.2.1",
46 | "escape-string-regexp": "^1.0.5",
47 | "supports-color": "^5.3.0"
48 | },
49 | "devDependencies": {
50 | "ava": "*",
51 | "coveralls": "^3.0.0",
52 | "execa": "^0.9.0",
53 | "flow-bin": "^0.68.0",
54 | "import-fresh": "^2.0.0",
55 | "matcha": "^0.7.0",
56 | "nyc": "^11.0.2",
57 | "resolve-from": "^4.0.0",
58 | "typescript": "^2.5.3",
59 | "xo": "*"
60 | },
61 | "types": "types/index.d.ts",
62 | "xo": {
63 | "envs": [
64 | "node",
65 | "mocha"
66 | ],
67 | "ignores": [
68 | "test/_flow.js"
69 | ]
70 | },
71 | "__npminstall_done": "Thu Dec 24 2020 20:48:44 GMT+0800 (GMT+08:00)",
72 | "_from": "chalk@2.4.2",
73 | "_resolved": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz?cache=0&sync_timestamp=1591687356178&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchalk%2Fdownload%2Fchalk-2.4.2.tgz"
74 | }
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/is-buffer/README.md:
--------------------------------------------------------------------------------
1 | # is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
2 |
3 | [travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg
4 | [travis-url]: https://travis-ci.org/feross/is-buffer
5 | [npm-image]: https://img.shields.io/npm/v/is-buffer.svg
6 | [npm-url]: https://npmjs.org/package/is-buffer
7 | [downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg
8 | [downloads-url]: https://npmjs.org/package/is-buffer
9 | [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
10 | [standard-url]: https://standardjs.com
11 |
12 | #### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer))
13 |
14 | [![saucelabs][saucelabs-image]][saucelabs-url]
15 |
16 | [saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg
17 | [saucelabs-url]: https://saucelabs.com/u/is-buffer
18 |
19 | ## Why not use `Buffer.isBuffer`?
20 |
21 | This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)).
22 |
23 | It's future-proof and works in node too!
24 |
25 | ## install
26 |
27 | ```bash
28 | npm install is-buffer
29 | ```
30 |
31 | ## usage
32 |
33 | ```js
34 | var isBuffer = require('is-buffer')
35 |
36 | isBuffer(new Buffer(4)) // true
37 |
38 | isBuffer(undefined) // false
39 | isBuffer(null) // false
40 | isBuffer('') // false
41 | isBuffer(true) // false
42 | isBuffer(false) // false
43 | isBuffer(0) // false
44 | isBuffer(1) // false
45 | isBuffer(1.0) // false
46 | isBuffer('string') // false
47 | isBuffer({}) // false
48 | isBuffer(function foo () {}) // false
49 | ```
50 |
51 | ## license
52 |
53 | MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org).
54 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/integration/helpers.js:
--------------------------------------------------------------------------------
1 | var exec = require('child_process').exec;
2 |
3 | var helpers = new (function () {
4 | var _tests;
5 | var _names = [];
6 | var _name;
7 | var _callback;
8 | var _runner = function () {
9 | if ((_name = _names.shift())) {
10 | console.log('Running ' + _name);
11 | _tests[_name]();
12 | }
13 | else {
14 | _callback();
15 | }
16 | };
17 |
18 | this.exec = function () {
19 | var args = Array.prototype.slice.call(arguments);
20 | var arg;
21 | var cmd = args.shift();
22 | var opts = {};
23 | var callback;
24 | // Optional opts/callback or callback/opts
25 | while ((arg = args.shift())) {
26 | if (typeof arg == 'function') {
27 | callback = arg;
28 | }
29 | else {
30 | opts = arg;
31 | }
32 | }
33 |
34 | cmd += ' --trace';
35 | var execOpts = opts.execOpts ? opts.execOpts : {};
36 | exec(cmd, execOpts, function (err, stdout, stderr) {
37 | var out = helpers.trim(stdout);
38 | if (err) {
39 | if (opts.breakOnError === false) {
40 | return callback(err);
41 | }
42 | else {
43 | throw err;
44 | }
45 | }
46 | if (stderr) {
47 | callback(stderr);
48 | }
49 | else {
50 | callback(out);
51 | }
52 | });
53 | };
54 |
55 | this.trim = function (s) {
56 | var str = s || '';
57 | return str.replace(/^\s*|\s*$/g, '');
58 | };
59 |
60 | this.parse = function (s) {
61 | var str = s || '';
62 | str = helpers.trim(str);
63 | str = str.replace(/'/g, '"');
64 | return JSON.parse(str);
65 | };
66 |
67 | this.run = function (tests, callback) {
68 | _tests = tests;
69 | _names = Object.keys(tests);
70 | _callback = callback;
71 | _runner();
72 | };
73 |
74 | this.next = function () {
75 | _runner();
76 | };
77 |
78 | })();
79 |
80 | module.exports = helpers;
81 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-name@1.1.3@color-name/.npmignore:
--------------------------------------------------------------------------------
1 | //this will affect all the git repos
2 | git config --global core.excludesfile ~/.gitignore
3 |
4 |
5 | //update files since .ignore won't if already tracked
6 | git rm --cached
7 |
8 | # Compiled source #
9 | ###################
10 | *.com
11 | *.class
12 | *.dll
13 | *.exe
14 | *.o
15 | *.so
16 |
17 | # Packages #
18 | ############
19 | # it's better to unpack these files and commit the raw source
20 | # git has its own built in compression methods
21 | *.7z
22 | *.dmg
23 | *.gz
24 | *.iso
25 | *.jar
26 | *.rar
27 | *.tar
28 | *.zip
29 |
30 | # Logs and databases #
31 | ######################
32 | *.log
33 | *.sql
34 | *.sqlite
35 |
36 | # OS generated files #
37 | ######################
38 | .DS_Store
39 | .DS_Store?
40 | ._*
41 | .Spotlight-V100
42 | .Trashes
43 | # Icon?
44 | ehthumbs.db
45 | Thumbs.db
46 | .cache
47 | .project
48 | .settings
49 | .tmproj
50 | *.esproj
51 | nbproject
52 |
53 | # Numerous always-ignore extensions #
54 | #####################################
55 | *.diff
56 | *.err
57 | *.orig
58 | *.rej
59 | *.swn
60 | *.swo
61 | *.swp
62 | *.vi
63 | *~
64 | *.sass-cache
65 | *.grunt
66 | *.tmp
67 |
68 | # Dreamweaver added files #
69 | ###########################
70 | _notes
71 | dwsync.xml
72 |
73 | # Komodo #
74 | ###########################
75 | *.komodoproject
76 | .komodotools
77 |
78 | # Node #
79 | #####################
80 | node_modules
81 |
82 | # Bower #
83 | #####################
84 | bower_components
85 |
86 | # Folders to ignore #
87 | #####################
88 | .hg
89 | .svn
90 | .CVS
91 | intermediate
92 | publish
93 | .idea
94 | .graphics
95 | _test
96 | _archive
97 | uploads
98 | tmp
99 |
100 | # Vim files to ignore #
101 | #######################
102 | .VimballRecord
103 | .netrwhist
104 |
105 | bundle.*
106 |
107 | _demo
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "_from": "silly-datetime",
3 | "_id": "silly-datetime@0.1.2",
4 | "_inBundle": false,
5 | "_integrity": "sha1-IZeOjo2EgWFgY6wRL/FGk/BuuFs=",
6 | "_location": "/silly-datetime",
7 | "_phantomChildren": {},
8 | "_requested": {
9 | "type": "tag",
10 | "registry": true,
11 | "raw": "silly-datetime",
12 | "name": "silly-datetime",
13 | "escapedName": "silly-datetime",
14 | "rawSpec": "",
15 | "saveSpec": null,
16 | "fetchSpec": "latest"
17 | },
18 | "_requiredBy": [
19 | "#USER",
20 | "/"
21 | ],
22 | "_resolved": "https://registry.npm.taobao.org/silly-datetime/download/silly-datetime-0.1.2.tgz",
23 | "_shasum": "21978e8e8d8481616063ac112ff14693f06eb85b",
24 | "_spec": "silly-datetime",
25 | "_where": "C:\\Users\\13119\\Desktop\\nodejs-study\\nodejs\\demomd5",
26 | "author": {
27 | "name": "Hans Chan"
28 | },
29 | "bugs": {
30 | "url": "https://github.com/csbun/silly-datetime/issues"
31 | },
32 | "bundleDependencies": false,
33 | "deprecated": false,
34 | "description": "simple datetime formater",
35 | "devDependencies": {
36 | "babel-preset-es2015-rollup": "^1.0.0",
37 | "coveralls": "^2.11.3",
38 | "istanbul": "^0.3.17",
39 | "mocha": "^2.2.5",
40 | "mocha-lcov-reporter": "0.0.2",
41 | "rollup": "^0.21.0",
42 | "rollup-plugin-babel": "^2.1.0"
43 | },
44 | "homepage": "https://github.com/csbun/silly-datetime",
45 | "jsnext:main": "src/index.js",
46 | "keywords": [
47 | "datetime",
48 | "format"
49 | ],
50 | "license": "MIT",
51 | "main": "dest/index.js",
52 | "name": "silly-datetime",
53 | "repository": {
54 | "type": "git",
55 | "url": "git+https://github.com/csbun/silly-datetime.git"
56 | },
57 | "scripts": {
58 | "prepublish": "node rollup.js",
59 | "test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
60 | },
61 | "version": "0.1.2"
62 | }
63 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-convert@1.9.3@color-convert/index.js:
--------------------------------------------------------------------------------
1 | var conversions = require('./conversions');
2 | var route = require('./route');
3 |
4 | var convert = {};
5 |
6 | var models = Object.keys(conversions);
7 |
8 | function wrapRaw(fn) {
9 | var wrappedFn = function (args) {
10 | if (args === undefined || args === null) {
11 | return args;
12 | }
13 |
14 | if (arguments.length > 1) {
15 | args = Array.prototype.slice.call(arguments);
16 | }
17 |
18 | return fn(args);
19 | };
20 |
21 | // preserve .conversion property if there is one
22 | if ('conversion' in fn) {
23 | wrappedFn.conversion = fn.conversion;
24 | }
25 |
26 | return wrappedFn;
27 | }
28 |
29 | function wrapRounded(fn) {
30 | var wrappedFn = function (args) {
31 | if (args === undefined || args === null) {
32 | return args;
33 | }
34 |
35 | if (arguments.length > 1) {
36 | args = Array.prototype.slice.call(arguments);
37 | }
38 |
39 | var result = fn(args);
40 |
41 | // we're assuming the result is an array here.
42 | // see notice in conversions.js; don't use box types
43 | // in conversion functions.
44 | if (typeof result === 'object') {
45 | for (var len = result.length, i = 0; i < len; i++) {
46 | result[i] = Math.round(result[i]);
47 | }
48 | }
49 |
50 | return result;
51 | };
52 |
53 | // preserve .conversion property if there is one
54 | if ('conversion' in fn) {
55 | wrappedFn.conversion = fn.conversion;
56 | }
57 |
58 | return wrappedFn;
59 | }
60 |
61 | models.forEach(function (fromModel) {
62 | convert[fromModel] = {};
63 |
64 | Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
65 | Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
66 |
67 | var routes = route(fromModel);
68 | var routeModels = Object.keys(routes);
69 |
70 | routeModels.forEach(function (toModel) {
71 | var fn = routes[toModel];
72 |
73 | convert[fromModel][toModel] = wrapRounded(fn);
74 | convert[fromModel][toModel].raw = wrapRaw(fn);
75 | });
76 | });
77 |
78 | module.exports = convert;
79 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "_from": "mkdirp",
3 | "_id": "mkdirp@1.0.4",
4 | "_inBundle": false,
5 | "_integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=",
6 | "_location": "/mkdirp",
7 | "_phantomChildren": {},
8 | "_requested": {
9 | "type": "tag",
10 | "registry": true,
11 | "raw": "mkdirp",
12 | "name": "mkdirp",
13 | "escapedName": "mkdirp",
14 | "rawSpec": "",
15 | "saveSpec": null,
16 | "fetchSpec": "latest"
17 | },
18 | "_requiredBy": [
19 | "#USER",
20 | "/"
21 | ],
22 | "_resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz",
23 | "_shasum": "3eb5ed62622756d79a5f0e2a221dfebad75c2f7e",
24 | "_spec": "mkdirp",
25 | "_where": "C:\\Users\\13119\\Desktop\\nodejs-study\\nodejs\\demo-mkdirp",
26 | "bin": {
27 | "mkdirp": "bin/cmd.js"
28 | },
29 | "bugs": {
30 | "url": "https://github.com/isaacs/node-mkdirp/issues"
31 | },
32 | "bundleDependencies": false,
33 | "deprecated": false,
34 | "description": "Recursively mkdir, like `mkdir -p`",
35 | "devDependencies": {
36 | "require-inject": "^1.4.4",
37 | "tap": "^14.10.7"
38 | },
39 | "engines": {
40 | "node": ">=10"
41 | },
42 | "files": [
43 | "bin",
44 | "lib",
45 | "index.js"
46 | ],
47 | "homepage": "https://github.com/isaacs/node-mkdirp#readme",
48 | "keywords": [
49 | "mkdir",
50 | "directory",
51 | "make dir",
52 | "make",
53 | "dir",
54 | "recursive",
55 | "native"
56 | ],
57 | "license": "MIT",
58 | "main": "index.js",
59 | "name": "mkdirp",
60 | "repository": {
61 | "type": "git",
62 | "url": "git+https://github.com/isaacs/node-mkdirp.git"
63 | },
64 | "scripts": {
65 | "postpublish": "git push origin --follow-tags",
66 | "postversion": "npm publish",
67 | "preversion": "npm test",
68 | "snap": "tap",
69 | "test": "tap"
70 | },
71 | "tap": {
72 | "check-coverage": true,
73 | "coverage-map": "map.js"
74 | },
75 | "version": "1.0.4"
76 | }
77 |
--------------------------------------------------------------------------------
/nodejs/node_modules/mkdirp/bin/cmd.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const usage = () => `
4 | usage: mkdirp [DIR1,DIR2..] {OPTIONS}
5 |
6 | Create each supplied directory including any necessary parent directories
7 | that don't yet exist.
8 |
9 | If the directory already exists, do nothing.
10 |
11 | OPTIONS are:
12 |
13 | -m If a directory needs to be created, set the mode as an octal
14 | --mode= permission string.
15 |
16 | -v --version Print the mkdirp version number
17 |
18 | -h --help Print this helpful banner
19 |
20 | -p --print Print the first directories created for each path provided
21 |
22 | --manual Use manual implementation, even if native is available
23 | `
24 |
25 | const dirs = []
26 | const opts = {}
27 | let print = false
28 | let dashdash = false
29 | let manual = false
30 | for (const arg of process.argv.slice(2)) {
31 | if (dashdash)
32 | dirs.push(arg)
33 | else if (arg === '--')
34 | dashdash = true
35 | else if (arg === '--manual')
36 | manual = true
37 | else if (/^-h/.test(arg) || /^--help/.test(arg)) {
38 | console.log(usage())
39 | process.exit(0)
40 | } else if (arg === '-v' || arg === '--version') {
41 | console.log(require('../package.json').version)
42 | process.exit(0)
43 | } else if (arg === '-p' || arg === '--print') {
44 | print = true
45 | } else if (/^-m/.test(arg) || /^--mode=/.test(arg)) {
46 | const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8)
47 | if (isNaN(mode)) {
48 | console.error(`invalid mode argument: ${arg}\nMust be an octal number.`)
49 | process.exit(1)
50 | }
51 | opts.mode = mode
52 | } else
53 | dirs.push(arg)
54 | }
55 |
56 | const mkdirp = require('../')
57 | const impl = manual ? mkdirp.manual : mkdirp
58 | if (dirs.length === 0)
59 | console.error(usage())
60 |
61 | Promise.all(dirs.map(dir => impl(dir, opts)))
62 | .then(made => print ? made.forEach(m => m && console.log(m)) : null)
63 | .catch(er => {
64 | console.error(er.message)
65 | if (er.code)
66 | console.error(' code: ' + er.code)
67 | process.exit(1)
68 | })
69 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_supports-color@5.5.0@supports-color/readme.md:
--------------------------------------------------------------------------------
1 | # supports-color [](https://travis-ci.org/chalk/supports-color)
2 |
3 | > Detect whether a terminal supports color
4 |
5 |
6 | ## Install
7 |
8 | ```
9 | $ npm install supports-color
10 | ```
11 |
12 |
13 | ## Usage
14 |
15 | ```js
16 | const supportsColor = require('supports-color');
17 |
18 | if (supportsColor.stdout) {
19 | console.log('Terminal stdout supports color');
20 | }
21 |
22 | if (supportsColor.stdout.has256) {
23 | console.log('Terminal stdout supports 256 colors');
24 | }
25 |
26 | if (supportsColor.stderr.has16m) {
27 | console.log('Terminal stderr supports 16 million colors (truecolor)');
28 | }
29 | ```
30 |
31 |
32 | ## API
33 |
34 | Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
35 |
36 | The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
37 |
38 | - `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
39 | - `.level = 2` and `.has256 = true`: 256 color support
40 | - `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
41 |
42 |
43 | ## Info
44 |
45 | It obeys the `--color` and `--no-color` CLI flags.
46 |
47 | Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
48 |
49 | Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
50 |
51 |
52 | ## Related
53 |
54 | - [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
55 | - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
56 |
57 |
58 | ## Maintainers
59 |
60 | - [Sindre Sorhus](https://github.com/sindresorhus)
61 | - [Josh Junon](https://github.com/qix-)
62 |
63 |
64 | ## License
65 |
66 | MIT
67 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_chalk@2.4.2@chalk/index.js.flow:
--------------------------------------------------------------------------------
1 | // @flow strict
2 |
3 | type TemplateStringsArray = $ReadOnlyArray;
4 |
5 | export type Level = $Values<{
6 | None: 0,
7 | Basic: 1,
8 | Ansi256: 2,
9 | TrueColor: 3
10 | }>;
11 |
12 | export type ChalkOptions = {|
13 | enabled?: boolean,
14 | level?: Level
15 | |};
16 |
17 | export type ColorSupport = {|
18 | level: Level,
19 | hasBasic: boolean,
20 | has256: boolean,
21 | has16m: boolean
22 | |};
23 |
24 | export interface Chalk {
25 | (...text: string[]): string,
26 | (text: TemplateStringsArray, ...placeholders: string[]): string,
27 | constructor(options?: ChalkOptions): Chalk,
28 | enabled: boolean,
29 | level: Level,
30 | rgb(r: number, g: number, b: number): Chalk,
31 | hsl(h: number, s: number, l: number): Chalk,
32 | hsv(h: number, s: number, v: number): Chalk,
33 | hwb(h: number, w: number, b: number): Chalk,
34 | bgHex(color: string): Chalk,
35 | bgKeyword(color: string): Chalk,
36 | bgRgb(r: number, g: number, b: number): Chalk,
37 | bgHsl(h: number, s: number, l: number): Chalk,
38 | bgHsv(h: number, s: number, v: number): Chalk,
39 | bgHwb(h: number, w: number, b: number): Chalk,
40 | hex(color: string): Chalk,
41 | keyword(color: string): Chalk,
42 |
43 | +reset: Chalk,
44 | +bold: Chalk,
45 | +dim: Chalk,
46 | +italic: Chalk,
47 | +underline: Chalk,
48 | +inverse: Chalk,
49 | +hidden: Chalk,
50 | +strikethrough: Chalk,
51 |
52 | +visible: Chalk,
53 |
54 | +black: Chalk,
55 | +red: Chalk,
56 | +green: Chalk,
57 | +yellow: Chalk,
58 | +blue: Chalk,
59 | +magenta: Chalk,
60 | +cyan: Chalk,
61 | +white: Chalk,
62 | +gray: Chalk,
63 | +grey: Chalk,
64 | +blackBright: Chalk,
65 | +redBright: Chalk,
66 | +greenBright: Chalk,
67 | +yellowBright: Chalk,
68 | +blueBright: Chalk,
69 | +magentaBright: Chalk,
70 | +cyanBright: Chalk,
71 | +whiteBright: Chalk,
72 |
73 | +bgBlack: Chalk,
74 | +bgRed: Chalk,
75 | +bgGreen: Chalk,
76 | +bgYellow: Chalk,
77 | +bgBlue: Chalk,
78 | +bgMagenta: Chalk,
79 | +bgCyan: Chalk,
80 | +bgWhite: Chalk,
81 | +bgBlackBright: Chalk,
82 | +bgRedBright: Chalk,
83 | +bgGreenBright: Chalk,
84 | +bgYellowBright: Chalk,
85 | +bgBlueBright: Chalk,
86 | +bgMagentaBright: Chalk,
87 | +bgCyanBright: Chalk,
88 | +bgWhiteBrigh: Chalk,
89 |
90 | supportsColor: ColorSupport
91 | };
92 |
93 | declare module.exports: Chalk;
94 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_ejs@3.1.5@ejs/jakefile.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var execSync = require('child_process').execSync;
3 | var exec = function (cmd) {
4 | execSync(cmd, {stdio: 'inherit'});
5 | };
6 |
7 | /* global jake, task, desc, publishTask */
8 |
9 | task('build', ['lint', 'clean', 'browserify', 'minify'], function () {
10 | console.log('Build completed.');
11 | });
12 |
13 | desc('Cleans browerified/minified files and package files');
14 | task('clean', ['clobber'], function () {
15 | jake.rmRf('./ejs.js');
16 | jake.rmRf('./ejs.min.js');
17 | console.log('Cleaned up compiled files.');
18 | });
19 |
20 | desc('Lints the source code');
21 | task('lint', ['clean'], function () {
22 | exec('./node_modules/.bin/eslint "**/*.js"');
23 | console.log('Linting completed.');
24 | });
25 |
26 | task('browserify', function () {
27 | exec('./node_modules/browserify/bin/cmd.js --standalone ejs lib/ejs.js > ejs.js');
28 | console.log('Browserification completed.');
29 | });
30 |
31 | task('minify', function () {
32 | exec('./node_modules/uglify-js/bin/uglifyjs ejs.js > ejs.min.js');
33 | console.log('Minification completed.');
34 | });
35 |
36 | desc('Generates the EJS API docs');
37 | task('doc', function (dev) {
38 | jake.rmRf('out');
39 | var p = dev ? '-p' : '';
40 | exec('./node_modules/.bin/jsdoc ' + p + ' -c jsdoc.json lib/* docs/jsdoc/*');
41 | console.log('Documentation generated.');
42 | });
43 |
44 | desc('Publishes the EJS API docs');
45 | task('docPublish', ['doc'], function () {
46 | fs.writeFileSync('out/CNAME', 'api.ejs.co');
47 | console.log('Pushing docs to gh-pages...');
48 | exec('./node_modules/.bin/git-directory-deploy --directory out/');
49 | console.log('Docs published to gh-pages.');
50 | });
51 |
52 | desc('Runs the EJS test suite');
53 | task('test', ['lint'], function () {
54 | exec('./node_modules/.bin/mocha');
55 | });
56 |
57 | publishTask('ejs', ['build'], function () {
58 | this.packageFiles.include([
59 | 'jakefile.js',
60 | 'README.md',
61 | 'LICENSE',
62 | 'package.json',
63 | 'ejs.js',
64 | 'ejs.min.js',
65 | 'lib/**',
66 | 'bin/**',
67 | 'usage.txt'
68 | ]);
69 | });
70 |
71 | jake.Task.publish.on('complete', function () {
72 | console.log('Updating hosted docs...');
73 | console.log('If this fails, run jake docPublish to re-try.');
74 | jake.Task.docPublish.invoke();
75 | });
76 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/is-buffer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "_from": "is-buffer@~1.1.6",
3 | "_id": "is-buffer@1.1.6",
4 | "_inBundle": false,
5 | "_integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=",
6 | "_location": "/is-buffer",
7 | "_phantomChildren": {},
8 | "_requested": {
9 | "type": "range",
10 | "registry": true,
11 | "raw": "is-buffer@~1.1.6",
12 | "name": "is-buffer",
13 | "escapedName": "is-buffer",
14 | "rawSpec": "~1.1.6",
15 | "saveSpec": null,
16 | "fetchSpec": "~1.1.6"
17 | },
18 | "_requiredBy": [
19 | "/md5"
20 | ],
21 | "_resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz?cache=0&sync_timestamp=1604429452232&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-buffer%2Fdownload%2Fis-buffer-1.1.6.tgz",
22 | "_shasum": "efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be",
23 | "_spec": "is-buffer@~1.1.6",
24 | "_where": "C:\\Users\\13119\\Desktop\\nodejs-study\\nodejs\\demomd5\\node_modules\\md5",
25 | "author": {
26 | "name": "Feross Aboukhadijeh",
27 | "email": "feross@feross.org",
28 | "url": "http://feross.org/"
29 | },
30 | "bugs": {
31 | "url": "https://github.com/feross/is-buffer/issues"
32 | },
33 | "bundleDependencies": false,
34 | "dependencies": {},
35 | "deprecated": false,
36 | "description": "Determine if an object is a Buffer",
37 | "devDependencies": {
38 | "standard": "*",
39 | "tape": "^4.0.0",
40 | "zuul": "^3.0.0"
41 | },
42 | "homepage": "https://github.com/feross/is-buffer#readme",
43 | "keywords": [
44 | "buffer",
45 | "buffers",
46 | "type",
47 | "core buffer",
48 | "browser buffer",
49 | "browserify",
50 | "typed array",
51 | "uint32array",
52 | "int16array",
53 | "int32array",
54 | "float32array",
55 | "float64array",
56 | "browser",
57 | "arraybuffer",
58 | "dataview"
59 | ],
60 | "license": "MIT",
61 | "main": "index.js",
62 | "name": "is-buffer",
63 | "repository": {
64 | "type": "git",
65 | "url": "git://github.com/feross/is-buffer.git"
66 | },
67 | "scripts": {
68 | "test": "standard && npm run test-node && npm run test-browser",
69 | "test-browser": "zuul -- test/*.js",
70 | "test-browser-local": "zuul --local -- test/*.js",
71 | "test-node": "tape test/*.js"
72 | },
73 | "testling": {
74 | "files": "test/*.js"
75 | },
76 | "version": "1.1.6"
77 | }
78 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_filelist@1.0.1@filelist/README.md:
--------------------------------------------------------------------------------
1 | ## FileList
2 |
3 | A FileList is a lazy-evaluated list of files. When given a list
4 | of glob patterns for possible files to be included in the file
5 | list, instead of searching the file structures to find the files,
6 | a FileList holds the pattern for latter use.
7 |
8 | This allows you to define a FileList to match any number of
9 | files, but only search out the actual files when then FileList
10 | itself is actually used. The key is that the first time an
11 | element of the FileList/Array is requested, the pending patterns
12 | are resolved into a real list of file names.
13 |
14 | ### Usage
15 |
16 | Add files to the list with the `include` method. You can add glob
17 | patterns, individual files, or RegExp objects. When the Array
18 | methods are invoked on the FileList, these items are resolved to
19 | an actual list of files.
20 |
21 | ```javascript
22 | var fl = new FileList();
23 | fl.include('test/*.js');
24 | fl.exclude('test/helpers.js');
25 | ```
26 |
27 | Use the `exclude` method to override inclusions. You can use this
28 | when your inclusions are too broad.
29 |
30 | ### Array methods
31 |
32 | FileList has lazy-evaluated versions of most of the array
33 | methods, including the following:
34 |
35 | * join
36 | * pop
37 | * push
38 | * concat
39 | * reverse
40 | * shift
41 | * unshift
42 | * slice
43 | * splice
44 | * sort
45 | * filter
46 | * forEach
47 | * some
48 | * every
49 | * map
50 | * indexOf
51 | * lastIndexOf
52 | * reduce
53 | * reduceRight
54 |
55 | When you call one of these methods, the items in the FileList
56 | will be resolved to the full list of files, and the method will
57 | be invoked on that result.
58 |
59 | ### Special `length` method
60 |
61 | `length`: FileList includes a length *method* (instead of a
62 | property) which returns the number of actual files in the list
63 | once it's been resolved.
64 |
65 | ### FileList-specific methods
66 |
67 | `include`: Add a filename/glob/regex to the list
68 |
69 | `exclude`: Override inclusions by excluding a filename/glob/regex
70 |
71 | `resolve`: Resolve the items in the FileList to the full list of
72 | files. This method is invoked automatically when one of the array
73 | methods is called.
74 |
75 | `toArray`: Immediately resolves the list of items, and returns an
76 | actual array of filepaths.
77 |
78 | `clearInclusions`: Clears any pending items -- must be used
79 | before resolving the list.
80 |
81 | `clearExclusions`: Clears the list of exclusions rules.
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/md5/test.js:
--------------------------------------------------------------------------------
1 | var md5 = require('./md5.js');
2 | var assert = require('assert');
3 |
4 | describe('md5', function () {
5 |
6 | it('should throw an error for an undefined value', function() {
7 | assert.throws(function() {
8 | md5(undefined);
9 | });
10 | });
11 |
12 | it('should allow the hashing of the string `undefined`', function() {
13 | assert.equal('5e543256c480ac577d30f76f9120eb74', md5('undefined'));
14 | });
15 |
16 | it('should throw an error for `null`', function() {
17 | assert.throws(function() {
18 | md5(null);
19 | });
20 | });
21 |
22 | it('should return the expected MD5 hash for "message"', function() {
23 | assert.equal('78e731027d8fd50ed642340b7c9a63b3', md5('message'));
24 | });
25 |
26 | it('should not return the same hash for random numbers twice', function() {
27 | var msg1 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime();
28 | var msg2 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime();
29 |
30 | if (msg1 !== msg2) {
31 | assert.notEqual(md5(msg1), md5(msg2));
32 | } else {
33 | assert.equal(md5(msg1), md5(msg1));
34 | }
35 | });
36 |
37 | it('should support Node.js Buffers', function() {
38 | var buffer = new Buffer('message áßäöü', 'utf8');
39 |
40 | assert.equal(md5(buffer), md5('message áßäöü'));
41 | })
42 |
43 | it('should be able to use a binary encoded string', function() {
44 | var hash1 = md5('abc', { asString: true });
45 | var hash2 = md5(hash1 + 'a', { asString: true, encoding : 'binary' });
46 | var hash3 = md5(hash1 + 'a', { encoding : 'binary' });
47 | assert.equal(hash3, '131f0ac52813044f5110e4aec638c169');
48 | });
49 |
50 | it('should support Uint8Array', function() {
51 | // Polyfills
52 | if (!Array.from) {
53 | Array.from = function(src, fn) {
54 | var result = new Array(src.length);
55 | for (var i = 0; i < src.length; ++i)
56 | result[i] = fn(src[i]);
57 | return result;
58 | };
59 | }
60 | if (!Uint8Array.from) {
61 | Uint8Array.from = function(src) {
62 | var result = new Uint8Array(src.length);
63 | for (var i = 0; i < src.length; ++i)
64 | result[i] = src[i];
65 | return result;
66 | };
67 | }
68 |
69 | var message = 'foobarbaz';
70 | var u8arr = Uint8Array.from(
71 | Array.from(message, function(c) { return c.charCodeAt(0); }));
72 | var u8aHash = md5(u8arr);
73 | assert.equal(u8aHash, md5(message));
74 | });
75 | });
76 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-convert@1.9.3@color-convert/route.js:
--------------------------------------------------------------------------------
1 | var conversions = require('./conversions');
2 |
3 | /*
4 | this function routes a model to all other models.
5 |
6 | all functions that are routed have a property `.conversion` attached
7 | to the returned synthetic function. This property is an array
8 | of strings, each with the steps in between the 'from' and 'to'
9 | color models (inclusive).
10 |
11 | conversions that are not possible simply are not included.
12 | */
13 |
14 | function buildGraph() {
15 | var graph = {};
16 | // https://jsperf.com/object-keys-vs-for-in-with-closure/3
17 | var models = Object.keys(conversions);
18 |
19 | for (var len = models.length, i = 0; i < len; i++) {
20 | graph[models[i]] = {
21 | // http://jsperf.com/1-vs-infinity
22 | // micro-opt, but this is simple.
23 | distance: -1,
24 | parent: null
25 | };
26 | }
27 |
28 | return graph;
29 | }
30 |
31 | // https://en.wikipedia.org/wiki/Breadth-first_search
32 | function deriveBFS(fromModel) {
33 | var graph = buildGraph();
34 | var queue = [fromModel]; // unshift -> queue -> pop
35 |
36 | graph[fromModel].distance = 0;
37 |
38 | while (queue.length) {
39 | var current = queue.pop();
40 | var adjacents = Object.keys(conversions[current]);
41 |
42 | for (var len = adjacents.length, i = 0; i < len; i++) {
43 | var adjacent = adjacents[i];
44 | var node = graph[adjacent];
45 |
46 | if (node.distance === -1) {
47 | node.distance = graph[current].distance + 1;
48 | node.parent = current;
49 | queue.unshift(adjacent);
50 | }
51 | }
52 | }
53 |
54 | return graph;
55 | }
56 |
57 | function link(from, to) {
58 | return function (args) {
59 | return to(from(args));
60 | };
61 | }
62 |
63 | function wrapConversion(toModel, graph) {
64 | var path = [graph[toModel].parent, toModel];
65 | var fn = conversions[graph[toModel].parent][toModel];
66 |
67 | var cur = graph[toModel].parent;
68 | while (graph[cur].parent) {
69 | path.unshift(graph[cur].parent);
70 | fn = link(conversions[graph[cur].parent][cur], fn);
71 | cur = graph[cur].parent;
72 | }
73 |
74 | fn.conversion = path;
75 | return fn;
76 | }
77 |
78 | module.exports = function (fromModel) {
79 | var graph = deriveBFS(fromModel);
80 | var conversion = {};
81 |
82 | var models = Object.keys(graph);
83 | for (var len = models.length, i = 0; i < len; i++) {
84 | var toModel = models[i];
85 | var node = graph[toModel];
86 |
87 | if (node.parent === null) {
88 | // no possible conversion, or this node is the source model.
89 | continue;
90 | }
91 |
92 | conversion[toModel] = wrapConversion(toModel, graph);
93 | }
94 |
95 | return conversion;
96 | };
97 |
98 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_chalk@2.4.2@chalk/types/index.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for Chalk
2 | // Definitions by: Thomas Sauer
3 |
4 | export const enum Level {
5 | None = 0,
6 | Basic = 1,
7 | Ansi256 = 2,
8 | TrueColor = 3
9 | }
10 |
11 | export interface ChalkOptions {
12 | enabled?: boolean;
13 | level?: Level;
14 | }
15 |
16 | export interface ChalkConstructor {
17 | new (options?: ChalkOptions): Chalk;
18 | (options?: ChalkOptions): Chalk;
19 | }
20 |
21 | export interface ColorSupport {
22 | level: Level;
23 | hasBasic: boolean;
24 | has256: boolean;
25 | has16m: boolean;
26 | }
27 |
28 | export interface Chalk {
29 | (...text: string[]): string;
30 | (text: TemplateStringsArray, ...placeholders: string[]): string;
31 | constructor: ChalkConstructor;
32 | enabled: boolean;
33 | level: Level;
34 | rgb(r: number, g: number, b: number): this;
35 | hsl(h: number, s: number, l: number): this;
36 | hsv(h: number, s: number, v: number): this;
37 | hwb(h: number, w: number, b: number): this;
38 | bgHex(color: string): this;
39 | bgKeyword(color: string): this;
40 | bgRgb(r: number, g: number, b: number): this;
41 | bgHsl(h: number, s: number, l: number): this;
42 | bgHsv(h: number, s: number, v: number): this;
43 | bgHwb(h: number, w: number, b: number): this;
44 | hex(color: string): this;
45 | keyword(color: string): this;
46 |
47 | readonly reset: this;
48 | readonly bold: this;
49 | readonly dim: this;
50 | readonly italic: this;
51 | readonly underline: this;
52 | readonly inverse: this;
53 | readonly hidden: this;
54 | readonly strikethrough: this;
55 |
56 | readonly visible: this;
57 |
58 | readonly black: this;
59 | readonly red: this;
60 | readonly green: this;
61 | readonly yellow: this;
62 | readonly blue: this;
63 | readonly magenta: this;
64 | readonly cyan: this;
65 | readonly white: this;
66 | readonly gray: this;
67 | readonly grey: this;
68 | readonly blackBright: this;
69 | readonly redBright: this;
70 | readonly greenBright: this;
71 | readonly yellowBright: this;
72 | readonly blueBright: this;
73 | readonly magentaBright: this;
74 | readonly cyanBright: this;
75 | readonly whiteBright: this;
76 |
77 | readonly bgBlack: this;
78 | readonly bgRed: this;
79 | readonly bgGreen: this;
80 | readonly bgYellow: this;
81 | readonly bgBlue: this;
82 | readonly bgMagenta: this;
83 | readonly bgCyan: this;
84 | readonly bgWhite: this;
85 | readonly bgBlackBright: this;
86 | readonly bgRedBright: this;
87 | readonly bgGreenBright: this;
88 | readonly bgYellowBright: this;
89 | readonly bgBlueBright: this;
90 | readonly bgMagentaBright: this;
91 | readonly bgCyanBright: this;
92 | readonly bgWhiteBright: this;
93 | }
94 |
95 | declare const chalk: Chalk & { supportsColor: ColorSupport };
96 |
97 | export default chalk
98 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/unit/namespace.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Jake JavaScript build tool
3 | * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | *
17 | */
18 |
19 | const PROJECT_DIR = process.env.PROJECT_DIR;
20 |
21 | // Load the jake global
22 | require(`${PROJECT_DIR}/lib/jake`);
23 | let { Namespace } = require(`${PROJECT_DIR}/lib/namespace`);
24 |
25 | require('./jakefile');
26 |
27 | let assert = require('assert');
28 |
29 | suite('namespace', function () {
30 |
31 | this.timeout(7000);
32 |
33 | test('resolve namespace by relative name', function () {
34 | let aaa, bbb, ccc;
35 | aaa = namespace('aaa', function () {
36 | bbb = namespace('bbb', function () {
37 | ccc = namespace('ccc', function () {
38 | });
39 | });
40 | });
41 |
42 | assert.ok(aaa, Namespace.ROOT_NAMESPACE.resolveNamespace('aaa'));
43 | assert.ok(bbb === aaa.resolveNamespace('bbb'));
44 | assert.ok(ccc === aaa.resolveNamespace('bbb:ccc'));
45 | });
46 |
47 | test('resolve task in sub-namespace by relative path', function () {
48 | let curr = Namespace.ROOT_NAMESPACE.resolveNamespace('zooby');
49 | let task = curr.resolveTask('frang:w00t:bar');
50 | assert.ok(task.action.toString().indexOf('zooby:frang:w00t:bar') > -1);
51 | });
52 |
53 | test('prefer local to top-level', function () {
54 | let curr = Namespace.ROOT_NAMESPACE.resolveNamespace('zooby:frang:w00t');
55 | let task = curr.resolveTask('bar');
56 | assert.ok(task.action.toString().indexOf('zooby:frang:w00t:bar') > -1);
57 | });
58 |
59 | test('does resolve top-level', function () {
60 | let curr = Namespace.ROOT_NAMESPACE.resolveNamespace('zooby:frang:w00t');
61 | let task = curr.resolveTask('foo');
62 | assert.ok(task.action.toString().indexOf('top-level foo') > -1);
63 | });
64 |
65 | test('absolute lookup works from sub-namespaces', function () {
66 | let curr = Namespace.ROOT_NAMESPACE.resolveNamespace('hurr:durr');
67 | let task = curr.resolveTask('zooby:frang:w00t:bar');
68 | assert.ok(task.action.toString().indexOf('zooby:frang:w00t:bar') > -1);
69 | });
70 |
71 | test('resolution miss with throw error', function () {
72 | let curr = Namespace.ROOT_NAMESPACE;
73 | let task = curr.resolveTask('asdf:qwer');
74 | assert.ok(!task);
75 | });
76 |
77 | });
78 |
--------------------------------------------------------------------------------
/nodejs/demofs/appfs.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | // 1、fs.stat 检测是文件还是目录
4 |
5 | // const fs = require("fs")
6 | // fs.stat('./html',(err,data)=>{
7 | // if(err){
8 | // console.log(err);
9 | // return;
10 | // }
11 |
12 | // console.log(`是文件:${data.isFile()}`);
13 | // console.log(`是目录:${data.isDirectory()}`)
14 | // })
15 |
16 | // 2、fs.mkdir 创建 目录
17 | // const fs = require("fs")
18 | // fs.mkdir('./css',(err)=>{
19 | // if(err){console.log(err);return ;}
20 | // console.log('创建成功')
21 | // })
22 |
23 | // 3、fs.writeFile() 写入文件
24 | // const fs = require("fs")
25 |
26 | // fs.writeFile('./html/index.html' ,"你好nodejs",(err)=>{
27 | // if(err){
28 | // console.log(err);
29 | // return;
30 | // }
31 | // console.log('写入成功')
32 | // })
33 |
34 | // 4、appendFile() 追加 文件
35 |
36 | // const fs = require("fs")
37 | // fs.appendFile("./css/base.css",'body{color:red}',(err)=>{
38 | // if(err){
39 | // console.log(err);
40 | // return;
41 | // }
42 | // console.log('appendFile 成功')
43 | // })
44 |
45 | // 5、fs.readFile() 读取文件
46 | // const fs = require("fs")
47 | // fs.readFile("./html/index.html",(err,data)=>{
48 | // if(err){
49 | // console.log(err);
50 | // return;
51 | // }
52 | // console.log(data)
53 | // console.log(data.toString()) //把 Buffer转化为 string类型
54 | // })
55 |
56 | // 6、fs.readdir() 读取目录
57 | // const fs = require("fs")
58 | // fs.readdir("./html",(err,data)=>{
59 | // if(err){
60 | // console.log(err);
61 | // return;
62 | // }
63 | // console.log(data)
64 | // })
65 |
66 | // 7、fs.rename 重命名/移动文件
67 | // const fs = require("fs")
68 |
69 | // 重命名
70 | // fs.rename("./css/index.css","./css/base.css",(err)=>{
71 | // if(err){
72 | // console.log(err);
73 | // return;
74 | // }
75 | // console.log('成功')
76 | // })
77 |
78 | //移动文件
79 | // fs.rename("./css/base.css","./html/base.css",(err)=>{
80 | // if(err){
81 | // console.log(err);
82 | // return;
83 | // }
84 | // console.log('移动成功')
85 | // })
86 |
87 | // 8、fs.unlink 删除文件
88 | // const fs = require("fs")
89 |
90 | // fs.unlink('./aaa/index.js',(err)=>{
91 | // if(err){
92 | // console.log(err);
93 | // return;
94 | // }
95 | // console.log('删除文件成功')
96 | // })
97 |
98 | // 9、fs.rmdir 删除目录
99 | const fs = require("fs")
100 |
101 | fs.rmdir('./aaa',(err)=>{
102 | if(err){
103 | console.log(err);
104 | return;
105 | }
106 | console.log('删除目录成功')
107 | })
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/lib/namespace.js:
--------------------------------------------------------------------------------
1 | const ROOT_NAMESPACE_NAME = '__rootNamespace__';
2 |
3 | class Namespace {
4 | constructor(name, parentNamespace) {
5 | this.name = name;
6 | this.parentNamespace = parentNamespace;
7 | this.childNamespaces = {};
8 | this.tasks = {};
9 | this.rules = {};
10 | this.path = this.getPath();
11 | }
12 |
13 | get fullName() {
14 | return this._getFullName();
15 | }
16 |
17 | addTask(task) {
18 | this.tasks[task.name] = task;
19 | task.namespace = this;
20 | }
21 |
22 | resolveTask(name) {
23 | if (!name) {
24 | return;
25 | }
26 |
27 | let taskPath = name.split(':');
28 | let taskName = taskPath.pop();
29 | let task;
30 | let ns;
31 |
32 | // Namespaced, return either relative to current, or from root
33 | if (taskPath.length) {
34 | taskPath = taskPath.join(':');
35 | ns = this.resolveNamespace(taskPath) ||
36 | Namespace.ROOT_NAMESPACE.resolveNamespace(taskPath);
37 | task = (ns && ns.resolveTask(taskName));
38 | }
39 | // Bare task, return either local, or top-level
40 | else {
41 | task = this.tasks[name] || Namespace.ROOT_NAMESPACE.tasks[name];
42 | }
43 |
44 | return task || null;
45 | }
46 |
47 |
48 | resolveNamespace(relativeName) {
49 | if (!relativeName) {
50 | return this;
51 | }
52 |
53 | let parts = relativeName.split(':');
54 | let ns = this;
55 |
56 | for (let i = 0, ii = parts.length; (ns && i < ii); i++) {
57 | ns = ns.childNamespaces[parts[i]];
58 | }
59 |
60 | return ns || null;
61 | }
62 |
63 | matchRule(relativeName) {
64 | let parts = relativeName.split(':');
65 | parts.pop();
66 | let ns = this.resolveNamespace(parts.join(':'));
67 | let rules = ns ? ns.rules : [];
68 | let r;
69 | let match;
70 |
71 | for (let p in rules) {
72 | r = rules[p];
73 | if (r.match(relativeName)) {
74 | match = r;
75 | }
76 | }
77 |
78 | return (ns && match) ||
79 | (this.parentNamespace &&
80 | this.parentNamespace.matchRule(relativeName));
81 | }
82 |
83 | getPath() {
84 | let parts = [];
85 | let next = this.parentNamespace;
86 | while (next) {
87 | parts.push(next.name);
88 | next = next.parentNamespace;
89 | }
90 | parts.pop(); // Remove '__rootNamespace__'
91 | return parts.reverse().join(':');
92 | }
93 |
94 | _getFullName() {
95 | let path = this.path;
96 | path = (path && path.split(':')) || [];
97 | path.push(this.name);
98 | return path.join(':');
99 | }
100 |
101 | isRootNamespace() {
102 | return !this.parentNamespace;
103 | }
104 | }
105 |
106 | class RootNamespace extends Namespace {
107 | constructor() {
108 | super(ROOT_NAMESPACE_NAME, null);
109 | Namespace.ROOT_NAMESPACE = this;
110 | }
111 | }
112 |
113 | module.exports.Namespace = Namespace;
114 | module.exports.RootNamespace = RootNamespace;
115 |
116 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/test/integration/jakelib/concurrent.jake.js:
--------------------------------------------------------------------------------
1 |
2 | namespace('concurrent', function () {
3 | task('A', function () {
4 | console.log('Started A');
5 | return new Promise((resolve, reject) => {
6 | setTimeout(() => {
7 | console.log('Finished A');
8 | resolve();
9 | }, 200);
10 | });
11 | });
12 |
13 | task('B', function () {
14 | console.log('Started B');
15 | return new Promise((resolve, reject) => {
16 | setTimeout(() => {
17 | console.log('Finished B');
18 | resolve();
19 | }, 50);
20 | });
21 | });
22 |
23 | task('C', function () {
24 | console.log('Started C');
25 | return new Promise((resolve, reject) => {
26 | setTimeout(() => {
27 | console.log('Finished C');
28 | resolve();
29 | }, 100);
30 | });
31 | });
32 |
33 | task('D', function () {
34 | console.log('Started D');
35 | return new Promise((resolve, reject) => {
36 | setTimeout(() => {
37 | console.log('Finished D');
38 | resolve();
39 | }, 300);
40 | });
41 | });
42 |
43 | task('Ba', ['A'], function () {
44 | console.log('Started Ba');
45 | return new Promise((resolve, reject) => {
46 | setTimeout(() => {
47 | console.log('Finished Ba');
48 | resolve();
49 | }, 50);
50 | });
51 | });
52 |
53 | task('Afail', function () {
54 | console.log('Started failing task');
55 | return new Promise((resolve, reject) => {
56 | setTimeout(() => {
57 | console.log('Failing B with error');
58 | throw new Error('I failed');
59 | }, 50);
60 | });
61 | });
62 |
63 | task('simple1', ['A','B'], {concurrency: 2}, function () {
64 | return new Promise((resolve, reject) => {
65 | setTimeout(() => {
66 | resolve();
67 | }, 50);
68 | });
69 | });
70 |
71 | task('simple2', ['C','D'], {concurrency: 2}, function () {
72 | return new Promise((resolve, reject) => {
73 | setTimeout(() => {
74 | resolve();
75 | }, 50);
76 | });
77 | });
78 |
79 | task('seqconcurrent', ['simple1','simple2'], function () {
80 | return new Promise((resolve, reject) => {
81 | setTimeout(() => {
82 | resolve();
83 | }, 50);
84 | });
85 | });
86 |
87 | task('concurrentconcurrent', ['simple1','simple2'], {concurrency: 2}, function () {
88 | return new Promise((resolve, reject) => {
89 | setTimeout(() => {
90 | resolve();
91 | }, 50);
92 | });
93 | });
94 |
95 | task('subdep', ['A','Ba'], {concurrency: 2}, function () {
96 | return new Promise((resolve, reject) => {
97 | setTimeout(() => {
98 | resolve();
99 | }, 50);
100 | });
101 | });
102 |
103 | task('fail', ['A', 'B', 'Afail'], {concurrency: 3}, function () {
104 | return new Promise((resolve, reject) => {
105 | setTimeout(() => {
106 | resolve();
107 | }, 50);
108 | });
109 | });
110 |
111 | });
112 |
113 |
114 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_color-convert@1.9.3@color-convert/README.md:
--------------------------------------------------------------------------------
1 | # color-convert
2 |
3 | [](https://travis-ci.org/Qix-/color-convert)
4 |
5 | Color-convert is a color conversion library for JavaScript and node.
6 | It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
7 |
8 | ```js
9 | var convert = require('color-convert');
10 |
11 | convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
12 | convert.keyword.rgb('blue'); // [0, 0, 255]
13 |
14 | var rgbChannels = convert.rgb.channels; // 3
15 | var cmykChannels = convert.cmyk.channels; // 4
16 | var ansiChannels = convert.ansi16.channels; // 1
17 | ```
18 |
19 | # Install
20 |
21 | ```console
22 | $ npm install color-convert
23 | ```
24 |
25 | # API
26 |
27 | Simply get the property of the _from_ and _to_ conversion that you're looking for.
28 |
29 | All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
30 |
31 | All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
32 |
33 | ```js
34 | var convert = require('color-convert');
35 |
36 | // Hex to LAB
37 | convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
38 | convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
39 |
40 | // RGB to CMYK
41 | convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ]
42 | convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
43 | ```
44 |
45 | ### Arrays
46 | All functions that accept multiple arguments also support passing an array.
47 |
48 | Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
49 |
50 | ```js
51 | var convert = require('color-convert');
52 |
53 | convert.rgb.hex(123, 45, 67); // '7B2D43'
54 | convert.rgb.hex([123, 45, 67]); // '7B2D43'
55 | ```
56 |
57 | ## Routing
58 |
59 | Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
60 |
61 | Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
62 |
63 | # Contribute
64 |
65 | If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
66 |
67 | # License
68 | Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
69 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/README.md:
--------------------------------------------------------------------------------
1 | # silly-datetime
2 |
3 | Simple datetime formater
4 |
5 | [](https://nodei.co/npm/silly-datetime/)
6 |
7 | [](https://travis-ci.org/csbun/silly-datetime)
8 | [](https://coveralls.io/github/csbun/silly-datetime?branch=master)
9 |
10 | ## Install
11 |
12 | ### npm
13 |
14 | ```sh
15 | npm i silly-datetime --save
16 | ```
17 |
18 | ### bower
19 |
20 | ```sh
21 | bower install silly-datetime --save
22 | ```
23 |
24 | ## Example
25 |
26 | ```javascript
27 | var sd = require('silly-datetime');
28 | sd.format(new Date(), 'YYYY-MM-DD HH:mm');
29 | // 2015-07-06 15:10
30 |
31 | sd.fromNow(+new Date() - 2000);
32 | // a few seconds ago
33 | ```
34 |
35 | ES2015:
36 |
37 | ```javascript
38 | import {
39 | format,
40 | fromNow
41 | } from 'silly-datetime';
42 | format(new Date(), 'YYYY-MM-DD HH:mm'); // 2015-07-06 15:10
43 | fromNow(+new Date() - 2000); // a few seconds ago
44 | ```
45 |
46 | ## Usage
47 |
48 | ### .format(datetime, format)
49 |
50 | Format a Date object to specified format.
51 |
52 | - datetime: Date Object
53 | - format: formate string, default to `'YYYY-MM-DD HH:mm:ss'`
54 |
55 | Format | Example | Description
56 | ------ | ------- | -----------
57 | `YYYY` | `2015` | 4 digit year
58 | `M MM` | `0..12` | Month number
59 | `D DD` | `0..31` | Day of month
60 | `H HH` | `0..23` | 24 hour time
61 | `h hh` | `1..12` | 12 hour time used with `a A`.
62 | `a A` | `am pm` | Post or ante meridiem
63 | `m mm` | `0..59` | Minutes
64 | `s ss` | `0..59` | Seconds
65 |
66 | ```javascript
67 | sd.format(new Date(), 'YYYY-MM-DD HH:mm');
68 | // 2015-07-06 15:10
69 | ```
70 |
71 | ### .fromNow(datetime)
72 |
73 | Time from now. This is sometimes called timeago or relative time.
74 |
75 | - datetime: Date Object
76 |
77 | ```javascript
78 | sd.fromNow(+new Date() - 2000);
79 | // a few seconds ago
80 | ```
81 |
82 | ### .locate(newLocale)
83 |
84 | Changing locale globally. By default, silly-datetime comes with English locale strings.
85 |
86 | - newLocale: locate string or locate Object
87 |
88 | Locate string can be `en` (default) or `zh-cn`;
89 |
90 | ```javascript
91 | var datetime = +new Date() + 10 * 60 * 1000;
92 | sd.locate('zh-cn')
93 | sd.fromNow(datetime);
94 | // 10分钟内
95 | ```
96 |
97 | Or just pass an custom locate object with any of the key in the table below:
98 |
99 | key | en | zh-cn
100 | -------- | --------------- | ------
101 | `future` | `in %s` | `%s内`
102 | `past` | `%s ago` | `%s前`
103 | `s` | `a few seconds` | `刚刚`
104 | `mm` | `%s minutes` | `%s分钟`
105 | `hh` | `%s hours` | `%s小时`
106 | `dd` | `%s days` | `%s天`
107 | `MM` | `%s months` | `%s月`
108 | `yy` | `%s years` | `%s年`
109 |
110 | ```javascript
111 | sd.locate({
112 | past: '%s之前',
113 | hh: '%s小時'
114 | });
115 | var datetime = +new Date() + 10 * 60 * 60 * 1000;
116 | sd.fromNow(datetime);
117 | // 10小時之前
118 | ```
119 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/crypt/crypt.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var base64map
3 | = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
4 |
5 | crypt = {
6 | // Bit-wise rotation left
7 | rotl: function(n, b) {
8 | return (n << b) | (n >>> (32 - b));
9 | },
10 |
11 | // Bit-wise rotation right
12 | rotr: function(n, b) {
13 | return (n << (32 - b)) | (n >>> b);
14 | },
15 |
16 | // Swap big-endian to little-endian and vice versa
17 | endian: function(n) {
18 | // If number given, swap endian
19 | if (n.constructor == Number) {
20 | return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
21 | }
22 |
23 | // Else, assume array and swap all items
24 | for (var i = 0; i < n.length; i++)
25 | n[i] = crypt.endian(n[i]);
26 | return n;
27 | },
28 |
29 | // Generate an array of any length of random bytes
30 | randomBytes: function(n) {
31 | for (var bytes = []; n > 0; n--)
32 | bytes.push(Math.floor(Math.random() * 256));
33 | return bytes;
34 | },
35 |
36 | // Convert a byte array to big-endian 32-bit words
37 | bytesToWords: function(bytes) {
38 | for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
39 | words[b >>> 5] |= bytes[i] << (24 - b % 32);
40 | return words;
41 | },
42 |
43 | // Convert big-endian 32-bit words to a byte array
44 | wordsToBytes: function(words) {
45 | for (var bytes = [], b = 0; b < words.length * 32; b += 8)
46 | bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
47 | return bytes;
48 | },
49 |
50 | // Convert a byte array to a hex string
51 | bytesToHex: function(bytes) {
52 | for (var hex = [], i = 0; i < bytes.length; i++) {
53 | hex.push((bytes[i] >>> 4).toString(16));
54 | hex.push((bytes[i] & 0xF).toString(16));
55 | }
56 | return hex.join('');
57 | },
58 |
59 | // Convert a hex string to a byte array
60 | hexToBytes: function(hex) {
61 | for (var bytes = [], c = 0; c < hex.length; c += 2)
62 | bytes.push(parseInt(hex.substr(c, 2), 16));
63 | return bytes;
64 | },
65 |
66 | // Convert a byte array to a base-64 string
67 | bytesToBase64: function(bytes) {
68 | for (var base64 = [], i = 0; i < bytes.length; i += 3) {
69 | var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
70 | for (var j = 0; j < 4; j++)
71 | if (i * 8 + j * 6 <= bytes.length * 8)
72 | base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
73 | else
74 | base64.push('=');
75 | }
76 | return base64.join('');
77 | },
78 |
79 | // Convert a base-64 string to a byte array
80 | base64ToBytes: function(base64) {
81 | // Remove non-base-64 characters
82 | base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
83 |
84 | for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
85 | imod4 = ++i % 4) {
86 | if (imod4 == 0) continue;
87 | bytes.push(((base64map.indexOf(base64.charAt(i - 1))
88 | & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
89 | | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
90 | }
91 | return bytes;
92 | }
93 | };
94 |
95 | module.exports = crypt;
96 | })();
97 |
--------------------------------------------------------------------------------
/nodejs/demomd5/node_modules/silly-datetime/test/test.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var assert = require('assert');
4 | var sd = require('../');
5 |
6 |
7 | describe('silly-datetime', function () {
8 |
9 | describe('#format', function () {
10 | var FORMAT_A = 'YYYY-MM-DD HH:mm:ss';
11 | var FORMAT_B = 'M/D/YYYY H:m a';
12 | var datetime = new Date(2015, 7, 6, 15, 10, 3);
13 | it('should return as `' + FORMAT_A + '`', function () {
14 | assert.equal('2015-08-06 15:10:03', sd.format(datetime, FORMAT_A));
15 | });
16 | it('should return as `' + FORMAT_B + '`', function () {
17 | assert.equal('8/6/2015 15:10 pm', sd.format(datetime, FORMAT_B));
18 | });
19 | });
20 |
21 |
22 | describe('#fromNow', function () {
23 | var SECOND_IN = 'in a few seconds';
24 | it('test `' + SECOND_IN + '`', function () {
25 | var datetime = +new Date() + 3 * 1000;
26 | assert.equal(SECOND_IN, sd.fromNow(datetime));
27 | });
28 |
29 | var SECOND_AGO = 'a few seconds ago';
30 | it('test `' + SECOND_AGO + '`', function () {
31 | assert.equal(SECOND_AGO, sd.fromNow(NaN));
32 | });
33 |
34 | var MINUTE = 3;
35 | var MINUTE_AGO = MINUTE + ' minutes ago';
36 | it('test `' + MINUTE_AGO + '`', function () {
37 | var datetime = +new Date() - MINUTE * 60 * 1000;
38 | assert.equal(MINUTE_AGO, sd.fromNow(datetime));
39 | });
40 |
41 | var HOUR = 3;
42 | var HOUR_AGO = HOUR + ' hours ago';
43 | it('test `' + HOUR_AGO + '`', function () {
44 | var datetime = +new Date() - HOUR * 60 * 60 * 1000;
45 | assert.equal(HOUR_AGO, sd.fromNow(datetime));
46 | });
47 |
48 |
49 | var DAY = 3;
50 | var DAY_AGO = DAY + ' days ago';
51 | it('test `' + DAY_AGO + '`', function () {
52 | var datetime = +new Date() - DAY * 24 * 60 * 60 * 1000;
53 | assert.equal(DAY_AGO, sd.fromNow(datetime));
54 | });
55 |
56 |
57 | var MONTH = 3;
58 | var MONTH_AGO = MONTH + ' months ago';
59 | it('test `' + MONTH_AGO + '`', function () {
60 | var datetime = new Date();
61 | datetime.setMonth(datetime.getMonth() - MONTH);
62 | assert.equal(MONTH_AGO, sd.fromNow(datetime));
63 | });
64 |
65 | var YEAR = 3;
66 | var YEAR_AGO = YEAR + ' years ago';
67 | it('test `' + YEAR_AGO + '`', function () {
68 | var datetime = new Date();
69 | datetime.setFullYear(datetime.getFullYear() - YEAR);
70 | assert.equal(YEAR_AGO, sd.fromNow(datetime));
71 | });
72 | });
73 |
74 |
75 | describe('#locate', function () {
76 | var FORMAT_ZH_CN_MINUTE = 10;
77 | var FORMAT_ZH_CN = FORMAT_ZH_CN_MINUTE + '分钟内';
78 | it('should return as `' + FORMAT_ZH_CN + '`', function () {
79 | var datetime = +new Date() + (FORMAT_ZH_CN_MINUTE * 60 + 1) * 1000;
80 | sd.locate('zh-cn');
81 | assert.equal(
82 | FORMAT_ZH_CN,
83 | sd.fromNow(datetime)
84 | );
85 | });
86 |
87 | var FORMAT_ZH_TW_HOUR = 10;
88 | var FORMAT_ZH_TW = FORMAT_ZH_TW_HOUR + '小時以内';
89 | it('should return as `' + FORMAT_ZH_TW + '`', function () {
90 | var datetime = +new Date() + (FORMAT_ZH_TW_HOUR * 60 * 60 + 1) * 1000;
91 | sd.locate({ future: '%s以内', hh: '%s小時' });
92 | assert.equal(
93 | FORMAT_ZH_TW,
94 | sd.fromNow(datetime)
95 | );
96 | });
97 | });
98 |
99 |
100 | });
101 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_jake@10.8.2@jake/jakefile.js:
--------------------------------------------------------------------------------
1 | let fs = require('fs')
2 | let path = require('path');
3 | let proc = require('child_process');
4 |
5 | const PROJECT_DIR = process.cwd();
6 | process.env.PROJECT_DIR = PROJECT_DIR;
7 |
8 | namespace('doc', function () {
9 | task('generate', ['doc:clobber'], function () {
10 | var cmd = '../node-jsdoc-toolkit/app/run.js -n -r=100 ' +
11 | '-t=../node-jsdoc-toolkit/templates/codeview -d=./doc/ ./lib';
12 | jake.logger.log('Generating docs ...');
13 | jake.exec([cmd], function () {
14 | jake.logger.log('Done.');
15 | complete();
16 | });
17 | }, {async: true});
18 |
19 | task('clobber', function () {
20 | var cmd = 'rm -fr ./doc/*';
21 | jake.exec([cmd], function () {
22 | jake.logger.log('Clobbered old docs.');
23 | complete();
24 | });
25 | }, {async: true});
26 |
27 | });
28 |
29 | desc('Generate docs for Jake');
30 | task('doc', ['doc:generate']);
31 |
32 | npmPublishTask('jake', function () {
33 | this.packageFiles.include([
34 | 'Makefile',
35 | 'jakefile.js',
36 | 'README.md',
37 | 'package.json',
38 | 'usage.txt',
39 | 'lib/**',
40 | 'bin/**',
41 | 'test/**'
42 | ]);
43 | this.packageFiles.exclude([
44 | 'test/tmp'
45 | ]);
46 | });
47 |
48 | jake.Task['publish:package'].directory = PROJECT_DIR;
49 |
50 | namespace('test', function () {
51 |
52 | let integrationTest = task('integration', ['publish:package'], async function () {
53 | let pkg = JSON.parse(fs.readFileSync(`${PROJECT_DIR}/package.json`).toString());
54 | let version = pkg.version;
55 |
56 | proc.execSync('rm -rf ./node_modules');
57 | // Install from the actual package, run tests from the packaged binary
58 | proc.execSync(`mkdir -p node_modules/.bin && mv ${PROJECT_DIR}/pkg/jake-v` +
59 | `${version} node_modules/jake && ln -s ${process.cwd()}` +
60 | '/node_modules/jake/bin/cli.js ./node_modules/.bin/jake');
61 |
62 | let testArgs = [];
63 | if (process.env.filter) {
64 | testArgs.push(process.env.filter);
65 | }
66 | else {
67 | testArgs.push('*.js');
68 | }
69 | let spawned = proc.spawn(`${PROJECT_DIR}/node_modules/.bin/mocha`, testArgs, {
70 | stdio: 'inherit'
71 | });
72 | return new Promise((resolve, reject) => {
73 | spawned.on('exit', () => {
74 | if (!(process.env.noclobber || process.env.noClobber)) {
75 | proc.execSync('rm -rf tmp_publish && rm -rf package.json' +
76 | ' && rm -rf package-lock.json && rm -rf node_modules');
77 | // Rather than invoking 'clobber' task
78 | jake.rmRf(`${PROJECT_DIR}/pkg`);
79 | }
80 | resolve();
81 | });
82 | });
83 |
84 | });
85 |
86 | integrationTest.directory = `${PROJECT_DIR}/test/integration`;
87 |
88 | let unitTest = task('unit', async function () {
89 | let testArgs = [];
90 | if (process.env.filter) {
91 | testArgs.push(process.env.filter);
92 | }
93 | else {
94 | testArgs.push('*.js');
95 | }
96 | let spawned = proc.spawn(`${PROJECT_DIR}/node_modules/.bin/mocha`, testArgs, {
97 | stdio: 'inherit'
98 | });
99 | });
100 |
101 | unitTest.directory = `${PROJECT_DIR}/test/unit`;
102 | });
103 |
104 | desc('Runs all tests');
105 | task('test', ['test:unit', 'test:integration']);
106 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_supports-color@5.5.0@supports-color/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | const os = require('os');
3 | const hasFlag = require('has-flag');
4 |
5 | const env = process.env;
6 |
7 | let forceColor;
8 | if (hasFlag('no-color') ||
9 | hasFlag('no-colors') ||
10 | hasFlag('color=false')) {
11 | forceColor = false;
12 | } else if (hasFlag('color') ||
13 | hasFlag('colors') ||
14 | hasFlag('color=true') ||
15 | hasFlag('color=always')) {
16 | forceColor = true;
17 | }
18 | if ('FORCE_COLOR' in env) {
19 | forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
20 | }
21 |
22 | function translateLevel(level) {
23 | if (level === 0) {
24 | return false;
25 | }
26 |
27 | return {
28 | level,
29 | hasBasic: true,
30 | has256: level >= 2,
31 | has16m: level >= 3
32 | };
33 | }
34 |
35 | function supportsColor(stream) {
36 | if (forceColor === false) {
37 | return 0;
38 | }
39 |
40 | if (hasFlag('color=16m') ||
41 | hasFlag('color=full') ||
42 | hasFlag('color=truecolor')) {
43 | return 3;
44 | }
45 |
46 | if (hasFlag('color=256')) {
47 | return 2;
48 | }
49 |
50 | if (stream && !stream.isTTY && forceColor !== true) {
51 | return 0;
52 | }
53 |
54 | const min = forceColor ? 1 : 0;
55 |
56 | if (process.platform === 'win32') {
57 | // Node.js 7.5.0 is the first version of Node.js to include a patch to
58 | // libuv that enables 256 color output on Windows. Anything earlier and it
59 | // won't work. However, here we target Node.js 8 at minimum as it is an LTS
60 | // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
61 | // release that supports 256 colors. Windows 10 build 14931 is the first release
62 | // that supports 16m/TrueColor.
63 | const osRelease = os.release().split('.');
64 | if (
65 | Number(process.versions.node.split('.')[0]) >= 8 &&
66 | Number(osRelease[0]) >= 10 &&
67 | Number(osRelease[2]) >= 10586
68 | ) {
69 | return Number(osRelease[2]) >= 14931 ? 3 : 2;
70 | }
71 |
72 | return 1;
73 | }
74 |
75 | if ('CI' in env) {
76 | if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
77 | return 1;
78 | }
79 |
80 | return min;
81 | }
82 |
83 | if ('TEAMCITY_VERSION' in env) {
84 | return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
85 | }
86 |
87 | if (env.COLORTERM === 'truecolor') {
88 | return 3;
89 | }
90 |
91 | if ('TERM_PROGRAM' in env) {
92 | const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
93 |
94 | switch (env.TERM_PROGRAM) {
95 | case 'iTerm.app':
96 | return version >= 3 ? 3 : 2;
97 | case 'Apple_Terminal':
98 | return 2;
99 | // No default
100 | }
101 | }
102 |
103 | if (/-256(color)?$/i.test(env.TERM)) {
104 | return 2;
105 | }
106 |
107 | if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
108 | return 1;
109 | }
110 |
111 | if ('COLORTERM' in env) {
112 | return 1;
113 | }
114 |
115 | if (env.TERM === 'dumb') {
116 | return min;
117 | }
118 |
119 | return min;
120 | }
121 |
122 | function getSupportLevel(stream) {
123 | const level = supportsColor(stream);
124 | return translateLevel(level);
125 | }
126 |
127 | module.exports = {
128 | supportsColor: getSupportLevel,
129 | stdout: getSupportLevel(process.stdout),
130 | stderr: getSupportLevel(process.stderr)
131 | };
132 |
--------------------------------------------------------------------------------
/nodejs/14web-ejs/node_modules/_balanced-match@1.0.0@balanced-match/README.md:
--------------------------------------------------------------------------------
1 | # balanced-match
2 |
3 | Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well!
4 |
5 | [](http://travis-ci.org/juliangruber/balanced-match)
6 | [](https://www.npmjs.org/package/balanced-match)
7 |
8 | [](https://ci.testling.com/juliangruber/balanced-match)
9 |
10 | ## Example
11 |
12 | Get the first matching pair of braces:
13 |
14 | ```js
15 | var balanced = require('balanced-match');
16 |
17 | console.log(balanced('{', '}', 'pre{in{nested}}post'));
18 | console.log(balanced('{', '}', 'pre{first}between{second}post'));
19 | console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'));
20 | ```
21 |
22 | The matches are:
23 |
24 | ```bash
25 | $ node example.js
26 | { start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
27 | { start: 3,
28 | end: 9,
29 | pre: 'pre',
30 | body: 'first',
31 | post: 'between{second}post' }
32 | { start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
33 | ```
34 |
35 | ## API
36 |
37 | ### var m = balanced(a, b, str)
38 |
39 | For the first non-nested matching pair of `a` and `b` in `str`, return an
40 | object with those keys:
41 |
42 | * **start** the index of the first match of `a`
43 | * **end** the index of the matching `b`
44 | * **pre** the preamble, `a` and `b` not included
45 | * **body** the match, `a` and `b` not included
46 | * **post** the postscript, `a` and `b` not included
47 |
48 | If there's no match, `undefined` will be returned.
49 |
50 | If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
51 |
52 | ### var r = balanced.range(a, b, str)
53 |
54 | For the first non-nested matching pair of `a` and `b` in `str`, return an
55 | array with indexes: `[ , ]`.
56 |
57 | If there's no match, `undefined` will be returned.
58 |
59 | If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
60 |
61 | ## Installation
62 |
63 | With [npm](https://npmjs.org) do:
64 |
65 | ```bash
66 | npm install balanced-match
67 | ```
68 |
69 | ## License
70 |
71 | (MIT)
72 |
73 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
74 |
75 | Permission is hereby granted, free of charge, to any person obtaining a copy of
76 | this software and associated documentation files (the "Software"), to deal in
77 | the Software without restriction, including without limitation the rights to
78 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
79 | of the Software, and to permit persons to whom the Software is furnished to do
80 | so, subject to the following conditions:
81 |
82 | The above copyright notice and this permission notice shall be included in all
83 | copies or substantial portions of the Software.
84 |
85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
86 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
87 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
88 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
89 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
90 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
91 | SOFTWARE.
92 |
--------------------------------------------------------------------------------