@yao-pkg/pkg 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +433 -0
- package/dictionary/angular-bridge.js +3 -0
- package/dictionary/any-promise.js +3 -0
- package/dictionary/async.js +3 -0
- package/dictionary/aws-sdk.js +7 -0
- package/dictionary/babel-core.js +3 -0
- package/dictionary/batch.js +3 -0
- package/dictionary/bcrypt.js +3 -0
- package/dictionary/better-sqlite3.js +3 -0
- package/dictionary/bignum.js +3 -0
- package/dictionary/bindings.js +3 -0
- package/dictionary/blessed.js +8 -0
- package/dictionary/body-parser.js +9 -0
- package/dictionary/browserify.js +7 -0
- package/dictionary/bson.js +3 -0
- package/dictionary/buffermaker.js +7 -0
- package/dictionary/bunyan.js +9 -0
- package/dictionary/busboy.js +7 -0
- package/dictionary/bytes.js +3 -0
- package/dictionary/callsites.js +3 -0
- package/dictionary/chokidar.js +3 -0
- package/dictionary/coffee-script.js +7 -0
- package/dictionary/colors.js +3 -0
- package/dictionary/compression.js +3 -0
- package/dictionary/compressjs.js +7 -0
- package/dictionary/connect-mongo.js +3 -0
- package/dictionary/connect-mongodb.js +3 -0
- package/dictionary/connect-redis.js +3 -0
- package/dictionary/connect.js +10 -0
- package/dictionary/consolidate.js +3 -0
- package/dictionary/cookie-parser.js +3 -0
- package/dictionary/cookie.js +3 -0
- package/dictionary/cors.js +3 -0
- package/dictionary/cron.js +3 -0
- package/dictionary/cross-env.js +11 -0
- package/dictionary/cross-spawn-async.js +3 -0
- package/dictionary/curve25519.js +3 -0
- package/dictionary/data-preflight.js +7 -0
- package/dictionary/debug.js +3 -0
- package/dictionary/denymount.js +3 -0
- package/dictionary/diff.js +3 -0
- package/dictionary/drivelist.js +22 -0
- package/dictionary/ed25519.js +3 -0
- package/dictionary/ejs.js +3 -0
- package/dictionary/elasticsearch.js +3 -0
- package/dictionary/electron.js +17 -0
- package/dictionary/emailjs.js +3 -0
- package/dictionary/engine.io.js +3 -0
- package/dictionary/epoll.js +3 -0
- package/dictionary/errorhandler.js +7 -0
- package/dictionary/errors.js +7 -0
- package/dictionary/eslint.js +7 -0
- package/dictionary/etcher-image-write.js +3 -0
- package/dictionary/exceljs.js +21 -0
- package/dictionary/exiftool.exe.js +13 -0
- package/dictionary/exiftool.pl.js +13 -0
- package/dictionary/express-load.js +12 -0
- package/dictionary/express-session.js +3 -0
- package/dictionary/express.js +14 -0
- package/dictionary/extender.js +11 -0
- package/dictionary/extsprintf.js +3 -0
- package/dictionary/faye-websocket.js +3 -0
- package/dictionary/feathers.js +3 -0
- package/dictionary/findup-sync.js +3 -0
- package/dictionary/floordate.js +3 -0
- package/dictionary/fmt.js +3 -0
- package/dictionary/formidable.js +3 -0
- package/dictionary/fs-extra.js +3 -0
- package/dictionary/fsevents.js +3 -0
- package/dictionary/geoip-lite.js +7 -0
- package/dictionary/github.js +7 -0
- package/dictionary/gm.js +3 -0
- package/dictionary/google-closure-compiler-java.js +13 -0
- package/dictionary/google-closure-compiler.js +13 -0
- package/dictionary/googleapis.js +7 -0
- package/dictionary/got.js +3 -0
- package/dictionary/graceful-fs.js +19 -0
- package/dictionary/grpc.js +11 -0
- package/dictionary/gulp.js +3 -0
- package/dictionary/hap-nodejs.js +3 -0
- package/dictionary/heapdump.js +3 -0
- package/dictionary/hoek.js +3 -0
- package/dictionary/homebridge.js +3 -0
- package/dictionary/http-proxy.js +3 -0
- package/dictionary/http-server.js +3 -0
- package/dictionary/image-size.js +3 -0
- package/dictionary/indexof.js +3 -0
- package/dictionary/inquirer.js +3 -0
- package/dictionary/j.js +16 -0
- package/dictionary/jade.js +3 -0
- package/dictionary/jsdom.js +3 -0
- package/dictionary/json-stringify-date.js +3 -0
- package/dictionary/json-stringify-safe.js +3 -0
- package/dictionary/jsonwebtoken.js +3 -0
- package/dictionary/kerberos.js +3 -0
- package/dictionary/knex.js +7 -0
- package/dictionary/later.js +7 -0
- package/dictionary/level.js +3 -0
- package/dictionary/leveldown.js +10 -0
- package/dictionary/levelup.js +3 -0
- package/dictionary/liftoff.js +12 -0
- package/dictionary/lodash.js +3 -0
- package/dictionary/log4js.js +7 -0
- package/dictionary/logform.js +7 -0
- package/dictionary/machinepack-urls.js +7 -0
- package/dictionary/markdown.js +3 -0
- package/dictionary/mdns.js +6 -0
- package/dictionary/method-override.js +3 -0
- package/dictionary/microjob.js +16 -0
- package/dictionary/mime-types.js +3 -0
- package/dictionary/mime.js +3 -0
- package/dictionary/minimatch.js +3 -0
- package/dictionary/minstache.js +3 -0
- package/dictionary/module-deps.js +3 -0
- package/dictionary/moment-timezone.js +3 -0
- package/dictionary/moment.js +7 -0
- package/dictionary/mongodb-core.js +22 -0
- package/dictionary/mongodb.js +7 -0
- package/dictionary/mongoose.js +7 -0
- package/dictionary/mongoskin.js +7 -0
- package/dictionary/ms.js +3 -0
- package/dictionary/msgpack.js +3 -0
- package/dictionary/multer.js +3 -0
- package/dictionary/muri.js +3 -0
- package/dictionary/native-or-bluebird.js +3 -0
- package/dictionary/natives.js +3 -0
- package/dictionary/nconf.js +7 -0
- package/dictionary/nedb.js +3 -0
- package/dictionary/negotiator.js +7 -0
- package/dictionary/newrelic.js +3 -0
- package/dictionary/nib.js +3 -0
- package/dictionary/nightmare.js +18 -0
- package/dictionary/node-forge.js +7 -0
- package/dictionary/node-libcurl.js +3 -0
- package/dictionary/node-notifier.js +30 -0
- package/dictionary/node-pre-gyp.js +7 -0
- package/dictionary/node-redis-pubsub.js +3 -0
- package/dictionary/node-sass.js +3 -0
- package/dictionary/node-uuid.js +3 -0
- package/dictionary/node-xlsx.js +3 -0
- package/dictionary/node-zookeeper-client.js +7 -0
- package/dictionary/nodegit.js +7 -0
- package/dictionary/nodemailer-sendmail-transport.js +3 -0
- package/dictionary/nodemailer.js +3 -0
- package/dictionary/npm-registry-client.js +7 -0
- package/dictionary/npm.js +7 -0
- package/dictionary/nssocket.js +3 -0
- package/dictionary/oauth2orize.js +7 -0
- package/dictionary/octobat.js +3 -0
- package/dictionary/open.js +13 -0
- package/dictionary/opn.js +4 -0
- package/dictionary/optimist.js +3 -0
- package/dictionary/passport-local.js +3 -0
- package/dictionary/passport.js +3 -0
- package/dictionary/pg-cursor.js +3 -0
- package/dictionary/pg-query-stream.js +3 -0
- package/dictionary/pg-types.js +7 -0
- package/dictionary/pg.js +7 -0
- package/dictionary/pg.js.js +7 -0
- package/dictionary/pgpass.js +7 -0
- package/dictionary/phantom.js +19 -0
- package/dictionary/phantomjs-prebuilt.js +16 -0
- package/dictionary/pkginfo.js +3 -0
- package/dictionary/pm2.js +7 -0
- package/dictionary/pmx.js +3 -0
- package/dictionary/pouchdb.js +3 -0
- package/dictionary/primus-emitter.js +3 -0
- package/dictionary/primus-spark-latency.js +3 -0
- package/dictionary/primus.js +3 -0
- package/dictionary/publicsuffixlist.js +15 -0
- package/dictionary/pug.js +3 -0
- package/dictionary/punt.js +3 -0
- package/dictionary/puppeteer.js +13 -0
- package/dictionary/pwd.js +3 -0
- package/dictionary/q.js +3 -0
- package/dictionary/raven.js +3 -0
- package/dictionary/rc.js +12 -0
- package/dictionary/readable-stream.js +3 -0
- package/dictionary/rechoir.js +3 -0
- package/dictionary/redis-parser.js +3 -0
- package/dictionary/redis.js +3 -0
- package/dictionary/regression.js +3 -0
- package/dictionary/reload.js +7 -0
- package/dictionary/request.js +3 -0
- package/dictionary/require-uncached.js +3 -0
- package/dictionary/require_optional.js +3 -0
- package/dictionary/s3.js +3 -0
- package/dictionary/safe_datejs.js +3 -0
- package/dictionary/sails.js +33 -0
- package/dictionary/sax.js +3 -0
- package/dictionary/scrypt.js +3 -0
- package/dictionary/semver.js +3 -0
- package/dictionary/sequelize.js +7 -0
- package/dictionary/serialport.js +3 -0
- package/dictionary/sha3.js +3 -0
- package/dictionary/sharp.js +11 -0
- package/dictionary/shelljs.js +7 -0
- package/dictionary/sinon.js +3 -0
- package/dictionary/socket.io-client.js +13 -0
- package/dictionary/socket.io.js +12 -0
- package/dictionary/sqip.js +7 -0
- package/dictionary/sqlite3.js +3 -0
- package/dictionary/steam-crypto.js +7 -0
- package/dictionary/steam-resources.js +19 -0
- package/dictionary/steam.js +3 -0
- package/dictionary/stripe-webhook-middleware.js +3 -0
- package/dictionary/stripe.js +3 -0
- package/dictionary/strong-globalize.js +3 -0
- package/dictionary/stylus.js +14 -0
- package/dictionary/supervisor.js +3 -0
- package/dictionary/svgo.js +8 -0
- package/dictionary/tabtab.js +3 -0
- package/dictionary/tesseract.js.js +7 -0
- package/dictionary/throng.js +3 -0
- package/dictionary/time.js +3 -0
- package/dictionary/tinify.js +7 -0
- package/dictionary/tiny-worker.js +7 -0
- package/dictionary/tmp.js +3 -0
- package/dictionary/transformers.js +3 -0
- package/dictionary/uglify-js.js +9 -0
- package/dictionary/umd.js +19 -0
- package/dictionary/underscore.js +3 -0
- package/dictionary/union.js +3 -0
- package/dictionary/update-notifier.js +3 -0
- package/dictionary/usage.js +7 -0
- package/dictionary/v8flags.js +13 -0
- package/dictionary/verror.js +3 -0
- package/dictionary/voc.js +3 -0
- package/dictionary/webdriverio.js +7 -0
- package/dictionary/winston-uber.js +7 -0
- package/dictionary/winston.js +7 -0
- package/dictionary/ws.js +3 -0
- package/dictionary/xlsx.js +16 -0
- package/dictionary/xml2js.js +3 -0
- package/dictionary/yargs.js +3 -0
- package/dictionary/zeromq.js +13 -0
- package/lib-es5/bin.js +19 -0
- package/lib-es5/chmod.js +15 -0
- package/lib-es5/common.js +235 -0
- package/lib-es5/compress_type.js +10 -0
- package/lib-es5/detector.js +420 -0
- package/lib-es5/fabricator.js +141 -0
- package/lib-es5/follow.js +91 -0
- package/lib-es5/help.js +53 -0
- package/lib-es5/index.d.ts +2 -0
- package/lib-es5/index.js +541 -0
- package/lib-es5/log.js +7 -0
- package/lib-es5/mach-o.js +61 -0
- package/lib-es5/packer.js +131 -0
- package/lib-es5/producer.js +343 -0
- package/lib-es5/refiner.js +87 -0
- package/lib-es5/types.js +9 -0
- package/lib-es5/walker.js +853 -0
- package/package.json +143 -0
- package/prelude/bootstrap.js +2256 -0
- package/prelude/diagnostic.js +136 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/* eslint-disable global-require */
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
/* global DICT */
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
function humanSize(bytes) {
|
|
8
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
9
|
+
|
|
10
|
+
if (bytes === 0) {
|
|
11
|
+
return 'n/a';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
15
|
+
|
|
16
|
+
if (i === 0) {
|
|
17
|
+
return `${bytes} ${sizes[i]}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return `${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]}`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
(function installDiagnostic() {
|
|
24
|
+
const fs = require('fs');
|
|
25
|
+
const path = require('path');
|
|
26
|
+
const win32 = process.platform === 'win32';
|
|
27
|
+
|
|
28
|
+
const sizeLimit = process.env.SIZE_LIMIT_PKG
|
|
29
|
+
? parseInt(process.env.SIZE_LIMIT_PKG, 10)
|
|
30
|
+
: 5 * 1024 * 1024;
|
|
31
|
+
const folderLimit = process.env.FOLDER_LIMIT_PKG
|
|
32
|
+
? parseInt(process.env.FOLDER_LIMIT_PKG, 10)
|
|
33
|
+
: 10 * 1024 * 1024;
|
|
34
|
+
|
|
35
|
+
if (process.env.DEBUG_PKG === '2') {
|
|
36
|
+
console.log(Object.entries(DICT));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const overSized = [];
|
|
40
|
+
|
|
41
|
+
function dumpLevel(filename, level, tree) {
|
|
42
|
+
let totalSize = 0;
|
|
43
|
+
const d = fs.readdirSync(filename);
|
|
44
|
+
for (let j = 0; j < d.length; j += 1) {
|
|
45
|
+
const f = path.join(filename, d[j]);
|
|
46
|
+
const realPath = fs.realpathSync(f);
|
|
47
|
+
const isSymbolicLink2 = f !== realPath;
|
|
48
|
+
|
|
49
|
+
const s = fs.statSync(f);
|
|
50
|
+
|
|
51
|
+
if (s.isDirectory() && !isSymbolicLink2) {
|
|
52
|
+
const tree1 = [];
|
|
53
|
+
const startIndex = overSized.length;
|
|
54
|
+
const folderSize = dumpLevel(f, level + 1, tree1);
|
|
55
|
+
totalSize += folderSize;
|
|
56
|
+
const str =
|
|
57
|
+
(' '.padStart(level * 2, ' ') + d[j]).padEnd(40, ' ') +
|
|
58
|
+
(humanSize(folderSize).padStart(10, ' ') +
|
|
59
|
+
(isSymbolicLink2 ? `=> ${realPath}` : ' '));
|
|
60
|
+
tree.push(str);
|
|
61
|
+
tree1.forEach((x) => tree.push(x));
|
|
62
|
+
|
|
63
|
+
if (folderSize > folderLimit) {
|
|
64
|
+
overSized.splice(startIndex, 0, str);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
totalSize += s.size;
|
|
68
|
+
const str =
|
|
69
|
+
(' '.padStart(level * 2, ' ') + d[j]).padEnd(40, ' ') +
|
|
70
|
+
(humanSize(s.size).padStart(10, ' ') +
|
|
71
|
+
(isSymbolicLink2 ? `=> ${realPath}` : ' '));
|
|
72
|
+
|
|
73
|
+
if (s.size > sizeLimit) {
|
|
74
|
+
overSized.push(str);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
tree.push(str);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return totalSize;
|
|
81
|
+
}
|
|
82
|
+
function wrap(obj, name) {
|
|
83
|
+
const f = fs[name];
|
|
84
|
+
obj[name] = (...args) => {
|
|
85
|
+
const args1 = Object.values(args);
|
|
86
|
+
console.log(
|
|
87
|
+
`fs.${name}`,
|
|
88
|
+
args1.filter((x) => typeof x === 'string'),
|
|
89
|
+
);
|
|
90
|
+
return f.apply(this, args1);
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (process.env.DEBUG_PKG) {
|
|
94
|
+
console.log('------------------------------- virtual file system');
|
|
95
|
+
const startFolder = win32 ? 'C:\\snapshot' : '/snapshot';
|
|
96
|
+
console.log(startFolder);
|
|
97
|
+
|
|
98
|
+
const tree = [];
|
|
99
|
+
const totalSize = dumpLevel(startFolder, 1, tree);
|
|
100
|
+
console.log(tree.join('\n'));
|
|
101
|
+
|
|
102
|
+
console.log('Total size = ', humanSize(totalSize));
|
|
103
|
+
|
|
104
|
+
if (overSized.length > 0) {
|
|
105
|
+
console.log('------------------------------- oversized files');
|
|
106
|
+
console.log(overSized.join('\n'));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (process.env.DEBUG_PKG === '2') {
|
|
110
|
+
wrap(fs, 'openSync');
|
|
111
|
+
wrap(fs, 'open');
|
|
112
|
+
wrap(fs, 'readSync');
|
|
113
|
+
wrap(fs, 'read');
|
|
114
|
+
wrap(fs, 'writeSync');
|
|
115
|
+
wrap(fs, 'write');
|
|
116
|
+
wrap(fs, 'closeSync');
|
|
117
|
+
wrap(fs, 'readFileSync');
|
|
118
|
+
wrap(fs, 'close');
|
|
119
|
+
wrap(fs, 'readFile');
|
|
120
|
+
wrap(fs, 'readdirSync');
|
|
121
|
+
wrap(fs, 'readdir');
|
|
122
|
+
wrap(fs, 'realpathSync');
|
|
123
|
+
wrap(fs, 'realpath');
|
|
124
|
+
wrap(fs, 'statSync');
|
|
125
|
+
wrap(fs, 'stat');
|
|
126
|
+
wrap(fs, 'lstatSync');
|
|
127
|
+
wrap(fs, 'lstat');
|
|
128
|
+
wrap(fs, 'fstatSync');
|
|
129
|
+
wrap(fs, 'fstat');
|
|
130
|
+
wrap(fs, 'existsSync');
|
|
131
|
+
wrap(fs, 'exists');
|
|
132
|
+
wrap(fs, 'accessSync');
|
|
133
|
+
wrap(fs, 'access');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
})();
|