Full Code of vercel/pkg for AI

main 9066ceeb391d cached
1427 files
1.2 MB
213.0k tokens
310 symbols
1 requests
Download .txt
Showing preview only (1,536K chars total). Download the full file or copy to clipboard to get everything.
Repository: vercel/pkg
Branch: main
Commit: 9066ceeb391d
Files: 1427
Total size: 1.2 MB

Directory structure:
gitextract_v7367qf3/

├── .eslintignore
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── 01_bug_report.yml
│   │   ├── 02_regression.yml
│   │   └── config.yml
│   └── workflows/
│       ├── ci.yml
│       └── close-stale.yml
├── .gitignore
├── .prettierignore
├── .yarnrc
├── LICENSE
├── README.md
├── dictionary/
│   ├── .eslintrc.json
│   ├── angular-bridge.js
│   ├── any-promise.js
│   ├── async.js
│   ├── aws-sdk.js
│   ├── babel-core.js
│   ├── batch.js
│   ├── bcrypt.js
│   ├── better-sqlite3.js
│   ├── bignum.js
│   ├── bindings.js
│   ├── blessed.js
│   ├── body-parser.js
│   ├── browserify.js
│   ├── bson.js
│   ├── buffermaker.js
│   ├── bunyan.js
│   ├── busboy.js
│   ├── bytes.js
│   ├── callsites.js
│   ├── chokidar.js
│   ├── coffee-script.js
│   ├── colors.js
│   ├── compression.js
│   ├── compressjs.js
│   ├── connect-mongo.js
│   ├── connect-mongodb.js
│   ├── connect-redis.js
│   ├── connect.js
│   ├── consolidate.js
│   ├── cookie-parser.js
│   ├── cookie.js
│   ├── cors.js
│   ├── cron.js
│   ├── cross-env.js
│   ├── cross-spawn-async.js
│   ├── curve25519.js
│   ├── data-preflight.js
│   ├── debug.js
│   ├── denymount.js
│   ├── diff.js
│   ├── drivelist.js
│   ├── ed25519.js
│   ├── ejs.js
│   ├── elasticsearch.js
│   ├── electron.js
│   ├── emailjs.js
│   ├── engine.io.js
│   ├── epoll.js
│   ├── errorhandler.js
│   ├── errors.js
│   ├── eslint.js
│   ├── etcher-image-write.js
│   ├── exceljs.js
│   ├── exiftool.exe.js
│   ├── exiftool.pl.js
│   ├── express-load.js
│   ├── express-session.js
│   ├── express.js
│   ├── extender.js
│   ├── extsprintf.js
│   ├── faye-websocket.js
│   ├── feathers.js
│   ├── findup-sync.js
│   ├── floordate.js
│   ├── fmt.js
│   ├── formidable.js
│   ├── fs-extra.js
│   ├── fsevents.js
│   ├── geoip-lite.js
│   ├── github.js
│   ├── gm.js
│   ├── google-closure-compiler-java.js
│   ├── google-closure-compiler.js
│   ├── googleapis.js
│   ├── got.js
│   ├── graceful-fs.js
│   ├── grpc.js
│   ├── gulp.js
│   ├── hap-nodejs.js
│   ├── heapdump.js
│   ├── hoek.js
│   ├── homebridge.js
│   ├── http-proxy.js
│   ├── http-server.js
│   ├── image-size.js
│   ├── indexof.js
│   ├── inquirer.js
│   ├── j.js
│   ├── jade.js
│   ├── jsdom.js
│   ├── json-stringify-date.js
│   ├── json-stringify-safe.js
│   ├── jsonwebtoken.js
│   ├── kerberos.js
│   ├── knex.js
│   ├── later.js
│   ├── level.js
│   ├── leveldown.js
│   ├── levelup.js
│   ├── liftoff.js
│   ├── lodash.js
│   ├── log4js.js
│   ├── logform.js
│   ├── machinepack-urls.js
│   ├── markdown.js
│   ├── mdns.js
│   ├── method-override.js
│   ├── microjob.js
│   ├── mime-types.js
│   ├── mime.js
│   ├── minimatch.js
│   ├── minstache.js
│   ├── module-deps.js
│   ├── moment-timezone.js
│   ├── moment.js
│   ├── mongodb-core.js
│   ├── mongodb.js
│   ├── mongoose.js
│   ├── mongoskin.js
│   ├── ms.js
│   ├── msgpack.js
│   ├── multer.js
│   ├── muri.js
│   ├── native-or-bluebird.js
│   ├── natives.js
│   ├── nconf.js
│   ├── nedb.js
│   ├── negotiator.js
│   ├── newrelic.js
│   ├── nib.js
│   ├── nightmare.js
│   ├── node-forge.js
│   ├── node-libcurl.js
│   ├── node-notifier.js
│   ├── node-pre-gyp.js
│   ├── node-redis-pubsub.js
│   ├── node-sass.js
│   ├── node-uuid.js
│   ├── node-xlsx.js
│   ├── node-zookeeper-client.js
│   ├── nodegit.js
│   ├── nodemailer-sendmail-transport.js
│   ├── nodemailer.js
│   ├── npm-registry-client.js
│   ├── npm.js
│   ├── nssocket.js
│   ├── oauth2orize.js
│   ├── octobat.js
│   ├── open.js
│   ├── opn.js
│   ├── optimist.js
│   ├── passport-local.js
│   ├── passport.js
│   ├── pg-cursor.js
│   ├── pg-query-stream.js
│   ├── pg-types.js
│   ├── pg.js
│   ├── pg.js.js
│   ├── pgpass.js
│   ├── phantom.js
│   ├── phantomjs-prebuilt.js
│   ├── pkginfo.js
│   ├── pm2.js
│   ├── pmx.js
│   ├── pouchdb.js
│   ├── primus-emitter.js
│   ├── primus-spark-latency.js
│   ├── primus.js
│   ├── publicsuffixlist.js
│   ├── pug.js
│   ├── punt.js
│   ├── puppeteer.js
│   ├── pwd.js
│   ├── q.js
│   ├── raven.js
│   ├── rc.js
│   ├── readable-stream.js
│   ├── rechoir.js
│   ├── redis-parser.js
│   ├── redis.js
│   ├── regression.js
│   ├── reload.js
│   ├── request.js
│   ├── require-uncached.js
│   ├── require_optional.js
│   ├── s3.js
│   ├── safe_datejs.js
│   ├── sails.js
│   ├── sax.js
│   ├── scrypt.js
│   ├── semver.js
│   ├── sequelize.js
│   ├── serialport.js
│   ├── sha3.js
│   ├── sharp.js
│   ├── shelljs.js
│   ├── sinon.js
│   ├── socket.io-client.js
│   ├── socket.io.js
│   ├── sqip.js
│   ├── sqlite3.js
│   ├── steam-crypto.js
│   ├── steam-resources.js
│   ├── steam.js
│   ├── stripe-webhook-middleware.js
│   ├── stripe.js
│   ├── strong-globalize.js
│   ├── stylus.js
│   ├── supervisor.js
│   ├── svgo.js
│   ├── tabtab.js
│   ├── tesseract.js.js
│   ├── throng.js
│   ├── time.js
│   ├── tinify.js
│   ├── tiny-worker.js
│   ├── tmp.js
│   ├── transformers.js
│   ├── uglify-js.js
│   ├── umd.js
│   ├── underscore.js
│   ├── union.js
│   ├── update-notifier.js
│   ├── usage.js
│   ├── v8flags.js
│   ├── verror.js
│   ├── voc.js
│   ├── webdriverio.js
│   ├── winston-uber.js
│   ├── winston.js
│   ├── ws.js
│   ├── xlsx.js
│   ├── xml2js.js
│   ├── yargs.js
│   └── zeromq.js
├── examples/
│   ├── .eslintrc.json
│   └── express/
│       ├── index.js
│       ├── package.json
│       ├── readme.md
│       └── views/
│           ├── index.html
│           └── lib/
│               └── sakura.css
├── lib/
│   ├── bin.ts
│   ├── chmod.ts
│   ├── common.ts
│   ├── compress_type.ts
│   ├── detector.ts
│   ├── fabricator.ts
│   ├── follow.ts
│   ├── help.ts
│   ├── index.ts
│   ├── log.js
│   ├── mach-o.ts
│   ├── packer.ts
│   ├── producer.ts
│   ├── refiner.ts
│   ├── types.ts
│   └── walker.ts
├── package.json
├── prelude/
│   ├── .eslintrc.json
│   ├── bootstrap.js
│   └── diagnostic.js
├── test/
│   ├── .eslintrc.json
│   ├── .gitignore
│   ├── test-42-fetch-all/
│   │   └── main.js
│   ├── test-42-path-related-values/
│   │   ├── main.js
│   │   └── project/
│   │       ├── app.js
│   │       └── module.js
│   ├── test-46-input/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-js/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-output-js/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-js-exe/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-target/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-output-target-js/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-target-js-exe/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-targets-many/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-output-targets-many-2/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-output-targets-many-3/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-targets-many-4/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-targets-many-5/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-targets-many-6/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-package-json/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-package-json-dir/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-package-json-dir-scope/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-package-json-outputdir/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-package-json-target/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-target/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-target-js/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-target-js-exe/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-targets-many/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-targets-many-2/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-targets-many-3/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-targets-many-4/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-targets-many-5/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-targets-many-6/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-multi-arch/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-multi-arch-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-outpath/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-outpath-target/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-outpath-targets-many/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-48-common/
│   │   └── main.js
│   ├── test-50-api/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-arguments/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-ast-parsing/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-data.txt
│   ├── test-50-ast-parsing-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery-3/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery-4/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery-fetch/
│   │   └── main.js
│   ├── test-50-can-include-addon/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── time.node
│   ├── test-50-cannot-css-script/
│   │   ├── assets/
│   │   │   └── animate.css
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-50-cannot-include-df/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-chdir-env-var/
│   │   ├── main.js
│   │   └── source/
│   │       └── test-x-index.js
│   ├── test-50-class-to-string/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-config-log/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-console-trace/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-corrupt-executable/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-debug/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-error-source-position/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-extensions/
│   │   ├── .eslintrc.json
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-esnext.js
│   │   └── test-z-sub.js
│   ├── test-50-for-await-of/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-fs-runtime-layer/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   ├── test-x1-index.js
│   │   ├── test-x2-index.js
│   │   ├── test-x3-index.js
│   │   ├── test-z-asset-A.css
│   │   └── test-z-asset-B.css
│   ├── test-50-fs-runtime-layer-2/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-asset.css
│   ├── test-50-fs-runtime-layer-3/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-asset.css
│   ├── test-50-global-object/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve-A.js
│   │   └── test-y-resolve-B.js
│   ├── test-50-inspect/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-invalid/
│   │   └── main.js
│   ├── test-50-invalid-package-json/
│   │   └── main.js
│   ├── test-50-invalid-package-json-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-invalid-package-json-bin/
│   │   ├── main.js
│   │   └── package.json
│   ├── test-50-invalid-package-json-bin-2/
│   │   ├── main.js
│   │   └── package.json
│   ├── test-50-invalid-unknown-token/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-many-arrow-functions/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-creator.js
│   ├── test-50-many-callbacks/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-creator.js
│   ├── test-50-may-exclude/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-may-exclude-must-exclude/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-index.js
│   ├── test-50-module-parent/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-fish-A.js
│   │   ├── test-y-fish-B.js
│   │   └── test-y-fish-C.js
│   ├── test-50-mountpoints/
│   │   ├── main.js
│   │   ├── plugins-C-int/
│   │   │   └── test-y-require-C.js
│   │   ├── plugins-D-ext/
│   │   │   └── test-y-require-D.js
│   │   ├── test-x-index.js
│   │   └── test-y-common.js
│   ├── test-50-native-addon/
│   │   ├── lib/
│   │   │   └── time.node
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-native-addon-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-native-addon-3/
│   │   ├── lib/
│   │   │   ├── community/
│   │   │   │   ├── test-y-index.js
│   │   │   │   └── time-y.node
│   │   │   ├── enterprise/
│   │   │   │   ├── test-z-index.js
│   │   │   │   └── time-z.node
│   │   │   ├── test-x-index.js
│   │   │   └── time-x.node
│   │   └── main.js
│   ├── test-50-native-addon-4/
│   │   ├── lib/
│   │   │   └── time.node
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-no-signature/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-no-super-in-constructor/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-node-modules-tree/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-fish-A.js
│   │   ├── test-y-fish-B.js
│   │   ├── test-y-fish-E
│   │   ├── test-y-fish-F
│   │   ├── test-y-fish-G
│   │   ├── test-y-fish-H
│   │   ├── test-y-fish-I
│   │   ├── test-y-fish-J
│   │   ├── test-y-fish-M
│   │   ├── test-y-fish-N
│   │   ├── test-y-fish-O
│   │   └── test-y-fish-P
│   ├── test-50-non-ascii/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-$$.js
│   ├── test-50-not-found-wording/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-not-found-wording-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-object-spread/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-observe-snapshot-root/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-observe-snapshot-root-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-odd-entrypoint/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-a-binary/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve-A.js
│   │   ├── test-y-resolve-B.txt
│   │   └── test-y-resolve-C.json
│   ├── test-50-package-json-2/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   └── test-x-index.js
│   │   └── test-y-data.json
│   ├── test-50-package-json-3/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   └── test-y-data.json
│   ├── test-50-package-json-4/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-5/
│   │   └── main.js
│   ├── test-50-package-json-6/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-6b/
│   │   └── main.js
│   ├── test-50-package-json-6c/
│   │   ├── beta/
│   │   │   ├── alpha.js
│   │   │   ├── beta.js
│   │   │   └── package.json
│   │   └── main.js
│   ├── test-50-package-json-6d/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-7/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-50-package-json-7p/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-50-package-json-8/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   ├── sub/
│   │   │   │   └── test-y-require.js
│   │   │   ├── test-x-index.js
│   │   │   └── test-z-require.js
│   │   └── test-z-data.css
│   ├── test-50-package-json-8b/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   ├── sub/
│   │   │   │   └── test-y-require.js
│   │   │   ├── test-x-index.js
│   │   │   └── test-z-require.js
│   │   └── test-z-data.css
│   ├── test-50-package-json-8p/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   ├── sub/
│   │   │   │   └── test-y-require.js
│   │   │   ├── test-x-index.js
│   │   │   └── test-z-require.js
│   │   └── test-z-data.css
│   ├── test-50-package-json-9/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-9p/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-A/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-50-path-as-buffer/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-asset.css
│   ├── test-50-path-separators/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   ├── test-y-require-C.js
│   │   │   └── test-y-require-D.js
│   │   └── test-x-index.js
│   ├── test-50-promisify/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-public-packages/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-reproducible/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-require-edge-cases/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-x1-content.js
│   │   ├── test-x2-require-false.js
│   │   └── test-x3-empty-file.js
│   ├── test-50-require-main-parent/
│   │   ├── main.js
│   │   ├── sub/
│   │   │   ├── test-y-require-C.js
│   │   │   └── test-y-require-D.js
│   │   ├── test-x-index.js
│   │   ├── test-y-require-A.js
│   │   └── test-y-require-B.js
│   ├── test-50-require-resolve/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve.any
│   │   ├── test-z-require-code-1.js
│   │   ├── test-z-require-code-2.js
│   │   ├── test-z-require-code-3.js
│   │   ├── test-z-require-code-4.js
│   │   ├── test-z-require-content.css
│   │   ├── test-z-require-json-1.json
│   │   ├── test-z-require-json-2.json
│   │   ├── test-z-require-json-3.json
│   │   ├── test-z-require-json-4.json
│   │   └── test-z-require-json-5.json
│   ├── test-50-require-resolve-2/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve-A.txt
│   │   ├── test-y-resolve-B.txt
│   │   ├── test-y-resolve-C.txt
│   │   ├── test-y-resolve-D.txt
│   │   ├── test-y-resolve-E.txt
│   │   ├── test-y-resolve-F.txt
│   │   ├── test-y-resolve-G.txt
│   │   ├── test-y-resolve-H.txt
│   │   ├── test-z-require-code-I.js
│   │   ├── test-z-require-code-J.js
│   │   ├── test-z-require-content-K.txt
│   │   ├── test-z-require-content-L.txt
│   │   ├── test-z-require-content-M.txt
│   │   └── test-z-require-content-N.txt
│   ├── test-50-require-with-config/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve-A.txt
│   │   ├── test-y-resolve-B.txt
│   │   ├── test-y-resolve-C.txt
│   │   ├── test-y-resolve-D.txt
│   │   ├── test-y-resolve-E.txt
│   │   ├── test-y-resolve-F.txt
│   │   ├── test-y-resolve-G.txt
│   │   ├── test-y-resolve-H.txt
│   │   ├── test-z-require-code-I.js
│   │   ├── test-z-require-code-J.js
│   │   ├── test-z-require-content-K.txt
│   │   ├── test-z-require-content-L.txt
│   │   ├── test-z-require-content-M.txt
│   │   └── test-z-require-content-N.txt
│   ├── test-50-resolve-and-nearby/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-fish
│   ├── test-50-should-disclose-package/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-signature/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-sigusr1/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-spawn/
│   │   ├── main.js
│   │   ├── test-cluster-child.js
│   │   ├── test-cluster.js
│   │   ├── test-cpfork-a-1.js
│   │   ├── test-cpfork-a-2.js
│   │   ├── test-cpfork-a-child.js
│   │   ├── test-cpfork-b-1.js
│   │   ├── test-cpfork-b-2.js
│   │   ├── test-cpfork-b-child.js
│   │   ├── test-exec-1.js
│   │   ├── test-exec-2.js
│   │   ├── test-exec-3.js
│   │   ├── test-exec-child.js
│   │   ├── test-execFile-child.js
│   │   ├── test-execFile.js
│   │   ├── test-execFileSync-child.js
│   │   ├── test-execFileSync.js
│   │   ├── test-execSync-1.js
│   │   ├── test-execSync-2.js
│   │   ├── test-execSync-3.js
│   │   ├── test-execSync-child.js
│   │   ├── test-node.js
│   │   ├── test-spawn-a-1.js
│   │   ├── test-spawn-a-2.js
│   │   ├── test-spawn-a-3.js
│   │   ├── test-spawn-a-4.js
│   │   ├── test-spawn-a-5.js
│   │   ├── test-spawn-a-child.js
│   │   ├── test-spawn-b-child.js
│   │   ├── test-spawn-b.js
│   │   ├── test-spawn-c-child.js
│   │   ├── test-spawn-c.js
│   │   ├── test-spawn-d-child.js
│   │   ├── test-spawn-d.js
│   │   ├── test-spawnSync-child.js
│   │   └── test-spawnSync.js
│   ├── test-50-symlink/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-tamper-core/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-undo-patch/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-index.js
│   ├── test-77-compare-dicts-and-tests/
│   │   └── main.js
│   ├── test-78-verify-pkg-version/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-79-npm/
│   │   ├── angular-bridge/
│   │   │   ├── angular-bridge.js
│   │   │   └── package.json
│   │   ├── any-promise/
│   │   │   ├── any-promise.js
│   │   │   ├── any-promise.meta.js
│   │   │   └── package.json
│   │   ├── async/
│   │   │   ├── async.js
│   │   │   └── package.json
│   │   ├── aws-sdk/
│   │   │   ├── aws-sdk.js
│   │   │   └── package.json
│   │   ├── babel-core/
│   │   │   ├── babel-core.js
│   │   │   ├── babel-core.txt
│   │   │   ├── babel-core@4.7.16.js
│   │   │   └── package.json
│   │   ├── batch/
│   │   │   ├── batch.js
│   │   │   └── package.json
│   │   ├── bcrypt/
│   │   │   ├── bcrypt.js
│   │   │   └── package.json
│   │   ├── better-sqlite3/
│   │   │   ├── .gitignore
│   │   │   ├── better-sqlite3.js
│   │   │   ├── better-sqlite3.meta.js
│   │   │   └── package.json
│   │   ├── bignum/
│   │   │   ├── bignum.js
│   │   │   ├── bignum.meta.js
│   │   │   └── package.json
│   │   ├── bindings/
│   │   │   ├── bindings.js
│   │   │   └── package.json
│   │   ├── blessed/
│   │   │   ├── blessed.js
│   │   │   └── package.json
│   │   ├── body-parser/
│   │   │   ├── body-parser.js
│   │   │   ├── body-parser@1.10.2.js
│   │   │   └── package.json
│   │   ├── browserify/
│   │   │   ├── browserify.js
│   │   │   ├── browserify.meta.js
│   │   │   └── package.json
│   │   ├── bson/
│   │   │   ├── bson.js
│   │   │   ├── bson@0.2.22.js
│   │   │   ├── bson@0.2.22.meta.js
│   │   │   ├── bson@0.4.0.js
│   │   │   ├── bson@0.4.0.meta.js
│   │   │   ├── bson@1.0.0.js
│   │   │   └── package.json
│   │   ├── buffermaker/
│   │   │   ├── buffermaker.js
│   │   │   └── package.json
│   │   ├── bunyan/
│   │   │   ├── bunyan.js
│   │   │   └── package.json
│   │   ├── busboy/
│   │   │   ├── busboy.js
│   │   │   └── package.json
│   │   ├── bytes/
│   │   │   ├── bytes.js
│   │   │   ├── bytes@2.5.0.js
│   │   │   └── package.json
│   │   ├── callsites/
│   │   │   ├── callsites.js
│   │   │   └── package.json
│   │   ├── checklist.htm
│   │   ├── checklist.js
│   │   ├── chokidar/
│   │   │   ├── chokidar.js
│   │   │   └── package.json
│   │   ├── coffee-script/
│   │   │   ├── coffee-script-example.coffee
│   │   │   ├── coffee-script.js
│   │   │   └── package.json
│   │   ├── colors/
│   │   │   ├── colors.js
│   │   │   └── package.json
│   │   ├── compression/
│   │   │   ├── compression.js
│   │   │   └── package.json
│   │   ├── compressjs/
│   │   │   ├── compressjs.js
│   │   │   └── package.json
│   │   ├── connect/
│   │   │   ├── connect.js
│   │   │   ├── connect@2.3.9.js
│   │   │   └── package.json
│   │   ├── connect-mongo/
│   │   │   ├── connect-mongo.js
│   │   │   ├── connect-mongo.meta.js
│   │   │   ├── connect-mongo@0.8.2.js
│   │   │   ├── connect-mongo@0.8.2.meta.js
│   │   │   └── package.json
│   │   ├── connect-mongodb/
│   │   │   ├── connect-mongodb.js
│   │   │   ├── connect-mongodb.meta.js
│   │   │   └── package.json
│   │   ├── connect-redis/
│   │   │   ├── connect-redis.js
│   │   │   ├── connect-redis.meta.js
│   │   │   ├── connect-redis@2.5.1.js
│   │   │   ├── connect-redis@2.5.1.meta.js
│   │   │   └── package.json
│   │   ├── consolidate/
│   │   │   ├── consolidate.js
│   │   │   └── package.json
│   │   ├── cookie/
│   │   │   ├── cookie.js
│   │   │   └── package.json
│   │   ├── cookie-parser/
│   │   │   ├── cookie-parser.js
│   │   │   └── package.json
│   │   ├── cors/
│   │   │   ├── cors.js
│   │   │   └── package.json
│   │   ├── cron/
│   │   │   ├── cron.js
│   │   │   └── package.json
│   │   ├── cross-env/
│   │   │   ├── cross-env.js
│   │   │   └── package.json
│   │   ├── cross-spawn-async/
│   │   │   ├── cross-spawn-async.js
│   │   │   ├── fixture.js
│   │   │   └── package.json
│   │   ├── curve25519/
│   │   │   ├── package.json
│   │   │   └── see.hap-nodejs.meta.js
│   │   ├── data-preflight/
│   │   │   ├── data-preflight.js
│   │   │   ├── data-preflight.meta.js
│   │   │   └── package.json
│   │   ├── debug/
│   │   │   ├── debug.js
│   │   │   └── package.json
│   │   ├── denymount/
│   │   │   ├── denymount.js
│   │   │   └── package.json
│   │   ├── diff/
│   │   │   ├── diff.js
│   │   │   └── package.json
│   │   ├── drivelist/
│   │   │   ├── drivelist.js
│   │   │   ├── drivelist.meta.js
│   │   │   ├── drivelist@3.0.0.js
│   │   │   ├── drivelist@3.0.0.meta.js
│   │   │   └── package.json
│   │   ├── ed25519/
│   │   │   ├── ed25519.js
│   │   │   ├── ed25519.meta.js
│   │   │   └── package.json
│   │   ├── ejs/
│   │   │   ├── ejs.js
│   │   │   ├── ejs@0.8.8.js
│   │   │   └── package.json
│   │   ├── elasticsearch/
│   │   │   ├── elasticsearch.js
│   │   │   └── package.json
│   │   ├── electron/
│   │   │   ├── electron.js
│   │   │   ├── electron.meta.js
│   │   │   └── package.json
│   │   ├── emailjs/
│   │   │   ├── emailjs.js
│   │   │   └── package.json
│   │   ├── engine.io/
│   │   │   ├── engine.io.js
│   │   │   ├── engine.io@1.8.0.js
│   │   │   └── package.json
│   │   ├── epoll/
│   │   │   ├── epoll.js
│   │   │   ├── epoll.meta.js
│   │   │   └── package.json
│   │   ├── errorhandler/
│   │   │   ├── errorhandler.js
│   │   │   └── package.json
│   │   ├── errors/
│   │   │   ├── errors.js
│   │   │   └── package.json
│   │   ├── eslint/
│   │   │   ├── eslint.js
│   │   │   ├── eslint.meta.js
│   │   │   └── package.json
│   │   ├── etcher-image-write/
│   │   │   ├── etcher-image-write.js
│   │   │   ├── etcher-image-write.meta.js
│   │   │   └── package.json
│   │   ├── exceljs/
│   │   │   ├── exceljs.js
│   │   │   └── package.json
│   │   ├── exiftool.pl/
│   │   │   ├── exiftool.pl.js
│   │   │   ├── exiftool.pl.meta.js
│   │   │   └── package.json
│   │   ├── express/
│   │   │   ├── express.js
│   │   │   ├── express@3.5.3.js
│   │   │   └── package.json
│   │   ├── express-load/
│   │   │   ├── controllers/
│   │   │   │   └── fixture.js
│   │   │   ├── express-load.config.json
│   │   │   ├── express-load.js
│   │   │   ├── package.json
│   │   │   └── routes/
│   │   │       └── fixture.js
│   │   ├── express-session/
│   │   │   ├── express-session.js
│   │   │   └── package.json
│   │   ├── express-with-jade/
│   │   │   ├── express.config.json
│   │   │   ├── express.js
│   │   │   ├── express.meta.js
│   │   │   ├── express@3.0.6.config.json
│   │   │   ├── express@3.0.6.js
│   │   │   ├── express@3.0.6.meta.js
│   │   │   ├── express@3.21.2.config.json
│   │   │   ├── express@3.21.2.js
│   │   │   ├── express@3.21.2.meta.js
│   │   │   ├── package.json
│   │   │   └── views/
│   │   │       └── fixture.jade
│   │   ├── extender/
│   │   │   ├── extender.js
│   │   │   └── package.json
│   │   ├── extsprintf/
│   │   │   ├── extsprintf.js
│   │   │   └── package.json
│   │   ├── faye-websocket/
│   │   │   ├── faye-websocket.js
│   │   │   └── package.json
│   │   ├── feathers/
│   │   │   ├── feathers.js
│   │   │   └── package.json
│   │   ├── findup-sync/
│   │   │   ├── findup-sync.js
│   │   │   └── package.json
│   │   ├── floordate/
│   │   │   ├── floordate.js
│   │   │   └── package.json
│   │   ├── fmt/
│   │   │   ├── fmt.js
│   │   │   └── package.json
│   │   ├── formidable/
│   │   │   ├── formidable.js
│   │   │   └── package.json
│   │   ├── fs-extra/
│   │   │   ├── fs-extra.js
│   │   │   ├── fs-extra@0.20.1.js
│   │   │   └── package.json
│   │   ├── fsevents/
│   │   │   ├── fsevents.js
│   │   │   ├── fsevents.meta.js
│   │   │   └── package.json
│   │   ├── geoip-lite/
│   │   │   ├── geoip-lite.js
│   │   │   └── package.json
│   │   ├── github/
│   │   │   ├── github.js
│   │   │   └── package.json
│   │   ├── gm/
│   │   │   ├── gm.js
│   │   │   ├── gm.meta.js
│   │   │   └── package.json
│   │   ├── google-closure-compiler/
│   │   │   ├── google-closure-compiler.js
│   │   │   ├── google-closure-compiler.meta.js
│   │   │   ├── google-closure-compiler@20180610.0.2.js
│   │   │   ├── google-closure-compiler@20180610.0.2.meta.js
│   │   │   └── package.json
│   │   ├── google-closure-compiler-java/
│   │   │   ├── google-closure-compiler-java.js
│   │   │   ├── google-closure-compiler-java.meta.js
│   │   │   └── package.json
│   │   ├── googleapis/
│   │   │   ├── googleapis.js
│   │   │   └── package.json
│   │   ├── got/
│   │   │   ├── got.js
│   │   │   └── package.json
│   │   ├── graceful-fs/
│   │   │   ├── graceful-fs.js
│   │   │   ├── graceful-fs@3.0.8.js
│   │   │   └── package.json
│   │   ├── grpc/
│   │   │   ├── grpc.js
│   │   │   ├── grpc.meta.js
│   │   │   └── package.json
│   │   ├── gulp/
│   │   │   ├── gulp-concat-01.txt
│   │   │   ├── gulp-concat-02.txt
│   │   │   ├── gulp.js
│   │   │   ├── gulp.meta.js
│   │   │   ├── gulpfile.js
│   │   │   └── package.json
│   │   ├── hap-nodejs/
│   │   │   ├── hap-nodejs.js
│   │   │   ├── hap-nodejs.meta.js
│   │   │   └── package.json
│   │   ├── heapdump/
│   │   │   ├── heapdump.js
│   │   │   ├── heapdump.meta.js
│   │   │   └── package.json
│   │   ├── hoek/
│   │   │   ├── hoek.js
│   │   │   ├── hoek.meta.js
│   │   │   ├── hoek@0.9.1.js
│   │   │   └── package.json
│   │   ├── home.js
│   │   ├── homebridge/
│   │   │   ├── homebridge.js
│   │   │   ├── homebridge.meta.js
│   │   │   └── package.json
│   │   ├── http-proxy/
│   │   │   ├── http-proxy.js
│   │   │   └── package.json
│   │   ├── http-server/
│   │   │   ├── http-server.js
│   │   │   └── package.json
│   │   ├── image-size/
│   │   │   ├── image-size.js
│   │   │   └── package.json
│   │   ├── indexof/
│   │   │   ├── indexof.js
│   │   │   └── package.json
│   │   ├── inquirer/
│   │   │   ├── inquirer.js
│   │   │   └── package.json
│   │   ├── j/
│   │   │   ├── j.js
│   │   │   ├── package.json
│   │   │   └── registry.xls
│   │   ├── jade/
│   │   │   ├── jade.js
│   │   │   └── package.json
│   │   ├── jsdom/
│   │   │   ├── jsdom.js
│   │   │   ├── jsdom.meta.js
│   │   │   ├── jsdom@8.5.0.js
│   │   │   ├── jsdom@8.5.0.meta.js
│   │   │   └── package.json
│   │   ├── json-stringify-date/
│   │   │   ├── json-stringify-date.js
│   │   │   └── package.json
│   │   ├── json-stringify-safe/
│   │   │   ├── json-stringify-safe.js
│   │   │   ├── json-stringify-safe@4.0.0.js
│   │   │   └── package.json
│   │   ├── jsonwebtoken/
│   │   │   ├── jsonwebtoken.js
│   │   │   └── package.json
│   │   ├── kerberos/
│   │   │   ├── kerberos.js
│   │   │   ├── kerberos.meta.js
│   │   │   ├── kerberos@0.0.10.js
│   │   │   ├── kerberos@0.0.10.meta.js
│   │   │   └── package.json
│   │   ├── knex/
│   │   │   ├── knex.js
│   │   │   └── package.json
│   │   ├── later/
│   │   │   ├── later.js
│   │   │   └── package.json
│   │   ├── level/
│   │   │   ├── level.js
│   │   │   └── package.json
│   │   ├── leveldown/
│   │   │   ├── leveldown.js
│   │   │   ├── leveldown.meta.js
│   │   │   └── package.json
│   │   ├── levelup/
│   │   │   ├── levelup.js
│   │   │   ├── levelup.meta.js
│   │   │   └── package.json
│   │   ├── liftoff/
│   │   │   ├── liftoff.js
│   │   │   └── package.json
│   │   ├── lodash/
│   │   │   ├── lodash.js
│   │   │   └── package.json
│   │   ├── log4js/
│   │   │   ├── log4js.js
│   │   │   ├── log4js@0.5.8.js
│   │   │   ├── log4js@0.6.34.js
│   │   │   ├── log4js@1.1.1.js
│   │   │   └── package.json
│   │   ├── logform/
│   │   │   ├── logform.js
│   │   │   └── package.json
│   │   ├── machinepack-urls/
│   │   │   ├── machinepack-urls.js
│   │   │   ├── machinepack-urls@5.0.0.js
│   │   │   └── package.json
│   │   ├── main.js
│   │   ├── markdown/
│   │   │   ├── markdown.js
│   │   │   └── package.json
│   │   ├── mdns/
│   │   │   ├── mdns.js
│   │   │   ├── mdns.meta.js
│   │   │   └── package.json
│   │   ├── method-override/
│   │   │   ├── method-override.js
│   │   │   └── package.json
│   │   ├── microjob/
│   │   │   ├── microjob.js
│   │   │   └── package.json
│   │   ├── mime/
│   │   │   ├── mime.js
│   │   │   ├── mime@1.4.1.js
│   │   │   └── package.json
│   │   ├── mime-types/
│   │   │   ├── mime-types.js
│   │   │   └── package.json
│   │   ├── minimatch/
│   │   │   ├── minimatch.js
│   │   │   └── package.json
│   │   ├── minstache/
│   │   │   ├── minstache.js
│   │   │   └── package.json
│   │   ├── module-deps/
│   │   │   ├── module-deps.js
│   │   │   └── package.json
│   │   ├── moment/
│   │   │   ├── moment.js
│   │   │   └── package.json
│   │   ├── moment-timezone/
│   │   │   ├── moment-timezone.js
│   │   │   └── package.json
│   │   ├── mongodb/
│   │   │   ├── mongodb.js
│   │   │   ├── mongodb.meta.js
│   │   │   └── package.json
│   │   ├── mongodb-core/
│   │   │   ├── mongodb-core.js
│   │   │   ├── mongodb-core@1.0.5.js
│   │   │   ├── mongodb-core@1.0.5.meta.js
│   │   │   └── package.json
│   │   ├── mongoose/
│   │   │   ├── mongoose.js
│   │   │   ├── mongoose.meta.js
│   │   │   ├── mongoose@3.9.7.js
│   │   │   ├── mongoose@3.9.7.meta.js
│   │   │   ├── mongoose@4.0.8.js
│   │   │   ├── mongoose@4.0.8.meta.js
│   │   │   ├── mongoose@4.1.12.js
│   │   │   ├── mongoose@4.1.12.meta.js
│   │   │   └── package.json
│   │   ├── mongoskin/
│   │   │   ├── mongoskin@2.0.3.js
│   │   │   ├── mongoskin@2.0.3.meta.js
│   │   │   └── package.json
│   │   ├── ms/
│   │   │   ├── ms.js
│   │   │   └── package.json
│   │   ├── msgpack/
│   │   │   ├── msgpack.js
│   │   │   ├── msgpack.meta.js
│   │   │   └── package.json
│   │   ├── multer/
│   │   │   ├── multer.js
│   │   │   └── package.json
│   │   ├── muri/
│   │   │   ├── muri.js
│   │   │   └── package.json
│   │   ├── native-or-bluebird/
│   │   │   ├── native-or-bluebird.js
│   │   │   └── package.json
│   │   ├── natives/
│   │   │   ├── natives.js
│   │   │   └── package.json
│   │   ├── nconf/
│   │   │   ├── nconf.js
│   │   │   └── package.json
│   │   ├── nedb/
│   │   │   ├── nedb.js
│   │   │   └── package.json
│   │   ├── negotiator/
│   │   │   ├── negotiator.js
│   │   │   ├── negotiator@0.4.9.js
│   │   │   └── package.json
│   │   ├── newrelic/
│   │   │   ├── newrelic.js
│   │   │   └── package.json
│   │   ├── nib/
│   │   │   ├── nib.js
│   │   │   └── package.json
│   │   ├── nightmare/
│   │   │   ├── nightmare.config.json
│   │   │   ├── nightmare.js
│   │   │   ├── nightmare.meta.js
│   │   │   └── package.json
│   │   ├── node-forge/
│   │   │   ├── node-forge.js
│   │   │   └── package.json
│   │   ├── node-libcurl/
│   │   │   ├── node-libcurl.js
│   │   │   ├── node-libcurl.meta.js
│   │   │   └── package.json
│   │   ├── node-notifier/
│   │   │   ├── node-notifier.js
│   │   │   ├── node-notifier.meta.js
│   │   │   └── package.json
│   │   ├── node-pre-gyp/
│   │   │   ├── node-pre-gyp.js
│   │   │   └── package.json
│   │   ├── node-redis-pubsub/
│   │   │   ├── node-redis-pubsub.js
│   │   │   └── package.json
│   │   ├── node-sass/
│   │   │   ├── node-sass.js
│   │   │   └── package.json
│   │   ├── node-uuid/
│   │   │   ├── node-uuid.js
│   │   │   └── package.json
│   │   ├── node-xlsx/
│   │   │   ├── ffc.ods
│   │   │   ├── node-xlsx.js
│   │   │   ├── node-xlsx.meta.js
│   │   │   ├── node-xlsx@0.6.0.js
│   │   │   ├── package.json
│   │   │   └── registry.xls
│   │   ├── node-zookeeper-client/
│   │   │   ├── node-zookeeper-client.js
│   │   │   └── package.json
│   │   ├── nodegit/
│   │   │   ├── nodegit.js
│   │   │   ├── nodegit.meta.js
│   │   │   └── package.json
│   │   ├── nodemailer/
│   │   │   ├── nodemailer.js
│   │   │   └── package.json
│   │   ├── nodemailer-sendmail-transport/
│   │   │   ├── nodemailer-sendmail-transport.js
│   │   │   └── package.json
│   │   ├── npm/
│   │   │   ├── npm.meta.js
│   │   │   └── package.json
│   │   ├── npm-registry-client/
│   │   │   ├── npm-registry-client.js
│   │   │   ├── npm-registry-client@6.0.7.js
│   │   │   └── package.json
│   │   ├── nssocket/
│   │   │   ├── nssocket.js
│   │   │   ├── nssocket@0.5.3.js
│   │   │   └── package.json
│   │   ├── oauth2orize/
│   │   │   ├── oauth2orize.js
│   │   │   └── package.json
│   │   ├── octobat/
│   │   │   ├── octobat.js
│   │   │   └── package.json
│   │   ├── open/
│   │   │   ├── open.js
│   │   │   ├── open.meta.js
│   │   │   └── package.json
│   │   ├── opn/
│   │   │   ├── opn.js
│   │   │   ├── opn.meta.js
│   │   │   └── package.json
│   │   ├── optimist/
│   │   │   ├── optimist.js
│   │   │   └── package.json
│   │   ├── passport/
│   │   │   ├── package.json
│   │   │   ├── passport.js
│   │   │   └── passport@0.2.2.js
│   │   ├── passport-local/
│   │   │   ├── package.json
│   │   │   ├── passport-local.js
│   │   │   └── passport-local@0.1.6.js
│   │   ├── pg/
│   │   │   ├── package.json
│   │   │   ├── pg.js
│   │   │   ├── pg@3.6.3.js
│   │   │   ├── pg@4.0.0.js
│   │   │   └── pg@6.4.1.js
│   │   ├── pg-cursor/
│   │   │   ├── package.json
│   │   │   ├── pg-cursor.js
│   │   │   └── pg-cursor.meta.js
│   │   ├── pg-query-stream/
│   │   │   ├── package.json
│   │   │   ├── pg-query-stream.js
│   │   │   ├── pg-query-stream.meta.js
│   │   │   ├── pg-query-stream@1.0.0.js
│   │   │   └── pg-query-stream@1.0.0.meta.js
│   │   ├── pg-types/
│   │   │   ├── package.json
│   │   │   ├── pg-types.js
│   │   │   └── pg-types@1.0.0.js
│   │   ├── pg.js/
│   │   │   ├── package.json
│   │   │   ├── pg.js.js
│   │   │   ├── pg.js@3.6.2.js
│   │   │   └── pg.js@4.1.0.js
│   │   ├── pgpass/
│   │   │   ├── package.json
│   │   │   └── pgpass.js
│   │   ├── phantom/
│   │   │   ├── package.json
│   │   │   ├── phantom.js
│   │   │   └── phantom.meta.js
│   │   ├── phantomjs-prebuilt/
│   │   │   ├── package.json
│   │   │   ├── phantomjs-prebuilt.js
│   │   │   └── phantomjs-prebuilt.meta.js
│   │   ├── pkginfo/
│   │   │   ├── package.json
│   │   │   ├── pkginfo.js
│   │   │   └── pkginfo@0.2.1.js
│   │   ├── pm2/
│   │   │   ├── package.json
│   │   │   └── test.it.manually.meta.js
│   │   ├── pmx/
│   │   │   ├── package.json
│   │   │   ├── pmx.js
│   │   │   └── pmx@0.5.9.js
│   │   ├── pouchdb/
│   │   │   ├── package.json
│   │   │   ├── pouchdb.js
│   │   │   └── pouchdb.meta.js
│   │   ├── primus/
│   │   │   ├── package.json
│   │   │   └── primus.js
│   │   ├── primus-emitter/
│   │   │   ├── package.json
│   │   │   └── primus-emitter.js
│   │   ├── primus-spark-latency/
│   │   │   ├── package.json
│   │   │   └── primus-spark-latency.js
│   │   ├── publicsuffixlist/
│   │   │   ├── package.json
│   │   │   └── publicsuffixlist.js
│   │   ├── pug/
│   │   │   ├── package.json
│   │   │   └── pug.js
│   │   ├── punt/
│   │   │   ├── package.json
│   │   │   ├── punt.js
│   │   │   └── punt@1.0.1.js
│   │   ├── puppeteer/
│   │   │   ├── package.json
│   │   │   ├── puppeteer.js
│   │   │   └── puppeteer.meta.js
│   │   ├── pwd/
│   │   │   ├── package.json
│   │   │   ├── pwd.js
│   │   │   └── pwd@0.0.4.js
│   │   ├── q/
│   │   │   ├── package.json
│   │   │   └── q.js
│   │   ├── raven/
│   │   │   ├── package.json
│   │   │   └── raven.js
│   │   ├── rc/
│   │   │   ├── .fixture.for.rc
│   │   │   ├── package.json
│   │   │   ├── rc.config.json
│   │   │   └── rc.js
│   │   ├── readable-stream/
│   │   │   ├── package.json
│   │   │   └── readable-stream.js
│   │   ├── rechoir/
│   │   │   ├── fixture.coffee
│   │   │   ├── package.json
│   │   │   ├── rechoir.config.json
│   │   │   ├── rechoir.js
│   │   │   └── rechoir.meta.js
│   │   ├── redis/
│   │   │   ├── package.json
│   │   │   ├── redis.js
│   │   │   ├── redis@1.0.0.js
│   │   │   ├── redis@2.0.1.js
│   │   │   ├── redis@2.1.0.js
│   │   │   ├── redis@2.2.5.js
│   │   │   ├── redis@2.3.1.js
│   │   │   └── redis@2.4.2.js
│   │   ├── redis-parser/
│   │   │   ├── package.json
│   │   │   └── redis-parser.js
│   │   ├── redis-with-hiredis/
│   │   │   ├── package.json
│   │   │   ├── redis.js
│   │   │   ├── redis.meta.js
│   │   │   ├── redis@1.0.0.js
│   │   │   ├── redis@1.0.0.meta.js
│   │   │   ├── redis@2.0.1.js
│   │   │   ├── redis@2.0.1.meta.js
│   │   │   ├── redis@2.1.0.js
│   │   │   ├── redis@2.1.0.meta.js
│   │   │   ├── redis@2.2.5.js
│   │   │   ├── redis@2.2.5.meta.js
│   │   │   ├── redis@2.3.1.js
│   │   │   ├── redis@2.3.1.meta.js
│   │   │   ├── redis@2.4.2.js
│   │   │   └── redis@2.4.2.meta.js
│   │   ├── regression/
│   │   │   ├── package.json
│   │   │   ├── regression.js
│   │   │   └── regression@1.4.0.js
│   │   ├── reload/
│   │   │   ├── package.json
│   │   │   ├── reload.js
│   │   │   ├── reload.meta.js
│   │   │   ├── reload@2.1.0.js
│   │   │   └── reload@2.1.0.meta.js
│   │   ├── request/
│   │   │   ├── package.json
│   │   │   └── request.js
│   │   ├── require-uncached/
│   │   │   ├── package.json
│   │   │   └── require-uncached.js
│   │   ├── require_optional/
│   │   │   ├── package.json
│   │   │   ├── require_optional.config.json
│   │   │   └── require_optional.js
│   │   ├── s3/
│   │   │   ├── package.json
│   │   │   └── s3.js
│   │   ├── safe_datejs/
│   │   │   ├── package.json
│   │   │   └── safe_datejs.js
│   │   ├── sails/
│   │   │   ├── package.json
│   │   │   ├── sails.js
│   │   │   └── sails.meta.js
│   │   ├── sax/
│   │   │   ├── package.json
│   │   │   └── sax.js
│   │   ├── scrypt/
│   │   │   ├── package.json
│   │   │   ├── scrypt.js
│   │   │   ├── scrypt.meta.js
│   │   │   ├── scrypt@5.4.1.js
│   │   │   └── scrypt@5.4.1.meta.js
│   │   ├── semver/
│   │   │   ├── package.json
│   │   │   └── semver.js
│   │   ├── sequelize/
│   │   │   ├── package.json
│   │   │   ├── sequelize.config.json
│   │   │   ├── sequelize.js
│   │   │   ├── sequelize.meta.js
│   │   │   ├── sequelize@3.30.4.config.json
│   │   │   ├── sequelize@3.30.4.js
│   │   │   └── sequelize@3.30.4.meta.js
│   │   ├── serialport/
│   │   │   ├── package.json
│   │   │   ├── serialport.js
│   │   │   └── serialport.meta.js
│   │   ├── sha3/
│   │   │   ├── package.json
│   │   │   ├── sha3.js
│   │   │   └── sha3.meta.js
│   │   ├── sharp/
│   │   │   ├── package.json
│   │   │   ├── sharp.js
│   │   │   └── sharp.meta.js
│   │   ├── shelljs/
│   │   │   ├── package.json
│   │   │   ├── shelljs.js
│   │   │   ├── shelljs@0.1.4.js
│   │   │   ├── shelljs@0.6.0.js
│   │   │   └── shelljs@0.7.6.js
│   │   ├── sinon/
│   │   │   ├── package.json
│   │   │   ├── sinon.js
│   │   │   └── sinon@1.1.0.js
│   │   ├── socket.io/
│   │   │   ├── package.json
│   │   │   ├── socket.io.js
│   │   │   ├── socket.io@1.4.8.js
│   │   │   ├── socket.io@1.6.0.js
│   │   │   └── socket.io@1.7.0.js
│   │   ├── socket.io-client/
│   │   │   ├── package.json
│   │   │   ├── socket.io-client.js
│   │   │   ├── socket.io-client@0.9.17.js
│   │   │   ├── socket.io-client@1.0.6.js
│   │   │   └── socket.io-client@1.7.0.js
│   │   ├── sqip/
│   │   │   ├── package.json
│   │   │   └── sqip.js
│   │   ├── sqlite3/
│   │   │   ├── package.json
│   │   │   ├── sqlite3.js
│   │   │   └── sqlite3.meta.js
│   │   ├── stamp.js
│   │   ├── steam/
│   │   │   ├── package.json
│   │   │   ├── steam.js
│   │   │   └── steam.meta.js
│   │   ├── steam-crypto/
│   │   │   ├── package.json
│   │   │   └── steam-crypto.js
│   │   ├── stripe/
│   │   │   ├── package.json
│   │   │   ├── stripe.js
│   │   │   └── stripe@3.9.0.js
│   │   ├── stripe-webhook-middleware/
│   │   │   ├── package.json
│   │   │   └── stripe-webhook-middleware.js
│   │   ├── strong-globalize/
│   │   │   ├── package.json
│   │   │   └── strong-globalize.js
│   │   ├── stylus/
│   │   │   ├── external.css
│   │   │   ├── package.json
│   │   │   ├── stylus.config.json
│   │   │   └── stylus.js
│   │   ├── supervisor/
│   │   │   ├── fixture.js
│   │   │   ├── package.json
│   │   │   ├── supervisor.js
│   │   │   └── supervisor.meta.js
│   │   ├── svgo/
│   │   │   ├── package.json
│   │   │   └── svgo.js
│   │   ├── tabtab/
│   │   │   ├── package.json
│   │   │   └── tabtab.js
│   │   ├── tesseract.js/
│   │   │   ├── package.json
│   │   │   ├── tesseract.js.js
│   │   │   └── tesseract.js.meta.js
│   │   ├── throng/
│   │   │   ├── package.json
│   │   │   ├── throng.js
│   │   │   └── throng.meta.js
│   │   ├── time/
│   │   │   ├── package.json
│   │   │   ├── time.js
│   │   │   └── time.meta.js
│   │   ├── times.js
│   │   ├── tinify/
│   │   │   ├── package.json
│   │   │   └── tinify.js
│   │   ├── tiny-worker/
│   │   │   ├── fixture.js
│   │   │   ├── package.json
│   │   │   └── tiny-worker.js
│   │   ├── tmp/
│   │   │   ├── package.json
│   │   │   └── tmp.js
│   │   ├── transformers/
│   │   │   ├── package.json
│   │   │   └── transformers.js
│   │   ├── uglify-js/
│   │   │   ├── package.json
│   │   │   ├── uglify-js.js
│   │   │   └── uglify-js@2.7.5.js
│   │   ├── umd/
│   │   │   ├── package.json
│   │   │   ├── umd.js
│   │   │   └── umd@2.1.0.js
│   │   ├── underscore/
│   │   │   ├── package.json
│   │   │   └── underscore.js
│   │   ├── union/
│   │   │   ├── package.json
│   │   │   └── union.js
│   │   ├── update-notifier/
│   │   │   ├── package.json
│   │   │   ├── update-notifier.js
│   │   │   └── update-notifier.meta.js
│   │   ├── usage/
│   │   │   ├── package.json
│   │   │   ├── usage.js
│   │   │   └── usage.meta.js
│   │   ├── v8flags/
│   │   │   ├── package.json
│   │   │   ├── v8flags.js
│   │   │   └── v8flags@2.1.1.js
│   │   ├── verror/
│   │   │   ├── package.json
│   │   │   └── verror.js
│   │   ├── voc/
│   │   │   ├── package.json
│   │   │   └── voc.js
│   │   ├── webdriverio/
│   │   │   ├── package.json
│   │   │   └── webdriverio.js
│   │   ├── winston/
│   │   │   ├── package.json
│   │   │   └── winston.js
│   │   ├── winston-uber/
│   │   │   ├── package.json
│   │   │   └── winston-uber.js
│   │   ├── ws/
│   │   │   ├── package.json
│   │   │   ├── ws.js
│   │   │   └── ws@0.5.0.js
│   │   ├── xlsx/
│   │   │   ├── ffc.ods
│   │   │   ├── package.json
│   │   │   ├── registry.xls
│   │   │   └── xlsx.js
│   │   ├── xml2js/
│   │   │   ├── package.json
│   │   │   └── xml2js.js
│   │   ├── yargs/
│   │   │   ├── package.json
│   │   │   └── yargs.js
│   │   └── zeromq/
│   │       ├── package.json
│   │       ├── zeromq.js
│   │       └── zeromq.meta.js
│   ├── test-80-compression/
│   │   ├── .gitignore
│   │   ├── main.js
│   │   ├── test-empty.js
│   │   └── test-x.js
│   ├── test-80-compression-node-opcua/
│   │   ├── .gitignore
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-empty.js
│   │   ├── test-x.js
│   │   └── test-y.js
│   ├── test-80-compression-various-file-access/
│   │   ├── main.js
│   │   ├── myfile.txt
│   │   ├── package.json
│   │   ├── test.js
│   │   └── test_with_new_fs_promises.js
│   ├── test-99-#1120-mkdir-mountpoints/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-99-#1121-regexp-mountpoints/
│   │   ├── main.js
│   │   ├── plugins-D-ext/
│   │   │   └── test-y-require-D.js
│   │   └── test-x-index.js
│   ├── test-99-#1130/
│   │   ├── .gitignore
│   │   ├── files/
│   │   │   ├── a.js
│   │   │   └── b.js
│   │   ├── main.js
│   │   ├── package.json
│   │   └── read.js
│   ├── test-99-#1135/
│   │   ├── .gitignore
│   │   ├── index.js
│   │   ├── main.js
│   │   └── package.json
│   ├── test-99-#1191/
│   │   ├── .gitignore
│   │   ├── index.js
│   │   ├── main.js
│   │   └── package.json
│   ├── test-99-#1192/
│   │   ├── .gitignore
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── public/
│   │   │   └── views/
│   │   │       └── index.pug
│   │   └── src/
│   │       └── index.js
│   ├── test-99-#1207/
│   │   ├── .gitignore
│   │   ├── index.js
│   │   └── main.js
│   ├── test-99-#1505/
│   │   ├── .gitignore
│   │   ├── files/
│   │   │   └── test.txt
│   │   ├── main.js
│   │   ├── package.json
│   │   └── stat.js
│   ├── test-99-#1861/
│   │   ├── index.js
│   │   ├── launch.bat
│   │   └── main.js
│   ├── test-99-#420-copy-from-snapshot/
│   │   ├── .gitignore
│   │   ├── copy.js
│   │   ├── input/
│   │   │   └── test.json
│   │   ├── main.js
│   │   └── package.json
│   ├── test-99-#775/
│   │   ├── a.js
│   │   ├── b.js
│   │   ├── main.js
│   │   └── package.json
│   ├── test-99-#938-withfiletypes/
│   │   ├── .gitignore
│   │   ├── main.js
│   │   ├── package.json
│   │   └── read.js
│   ├── test.js
│   └── utils.js
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .eslintignore
================================================
lib-es5
node_modules
dist


================================================
FILE: .eslintrc
================================================
{
  "extends": ["airbnb-base", "prettier"],
  "rules": {
    "no-bitwise": "off",
    "no-continue": "off",
    "no-await-in-loop": "off",
    "no-constant-condition": "off",
    "no-param-reassign": "off",
    "consistent-return": "off",
    "no-restricted-syntax": "off",
    "import/prefer-default-export": "off",
    "camelcase": "off"
  },
  "overrides": [
    {
      "files": ["*.ts"],
      "extends": [
        "airbnb-typescript/base",
        "plugin:@typescript-eslint/recommended",
        "prettier"
      ],
      "parser": "@typescript-eslint/parser",
      "parserOptions": {
        "project": "./tsconfig.json"
      },
      "rules": {
        "@typescript-eslint/explicit-module-boundary-types": "off",
        "consistent-return": "off",
        "import/prefer-default-export": "off",
        "no-await-in-loop": "off",
        "no-bitwise": "off",
        "no-constant-condition": "off",
        "no-continue": "off",
        "no-param-reassign": "off",
        "no-restricted-syntax": "off"
      }
    },
    {
      "files": ["prelude/**/*"],
      "rules": {
        "strict": "off"
      }
    },
    {
      "files": ["test/**/*"],
      "rules": {
        "array-callback-return": "off",
        "func-names": "off",
        "global-require": "off",
        "guard-for-in": "off",
        "import/extensions": "off",
        "import/no-dynamic-require": "off",
        "import/no-extraneous-dependencies": "off",
        "import/newline-after-import": "off",
        "import/no-unresolved": "off",
        "import/no-useless-path-segments": "off",
        "import/order": "off",
        "no-console": "off",
        "no-lonely-if": "off",
        "no-multi-assign": "off",
        "no-undef": "off",
        "no-else-return": "off",
        "no-use-before-define": "off",
        "object-shorthand": "off",
        "one-var": "off",
        "prefer-arrow-callback": "off",
        "prefer-destructuring": "off",
        "prefer-object-spread": "off",
        "prefer-template": "off",
        "strict": ["error", "global"]
      }
    }
  ]
}


================================================
FILE: .github/ISSUE_TEMPLATE/01_bug_report.yml
================================================
name: 🐞 Bug Report
description: Create a bug report for pkg
labels: 'template: bug'
body:
  - type: markdown
    attributes:
      value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
  - type: markdown
    attributes:
      value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Question" section.
  - type: markdown
    attributes:
      value: 'Please first search the repository for similar issues and discussions.'
  - type: input
    attributes:
      label: What version of pkg are you using?
      description: '`pkg --version` - For example: 5.4.1'
    validations:
      required: true
  - type: input
    attributes:
      label: What version of Node.js are you using?
      description: '`node --version` - For example: 16.0.0'
    validations:
      required: true
  - type: input
    attributes:
      label: What operating system are you using?
      description: 'For example: macOS, Windows, Ubuntu 20.04'
    validations:
      required: true
  - type: input
    attributes:
      label: What CPU architecture are you using?
      description: 'For example: x86_64, arm64, armv7, Intel 12900K, Apple M1'
    validations:
      required: true
  - type: input
    attributes:
      label: What Node versions, OSs and CPU architectures are you building for?
      description: 'For example: default, node18, node18-linux-x64, node16-win-arm64'
    validations:
      required: true
  - type: textarea
    attributes:
      label: Describe the Bug
      description: A clear and concise description of what the bug is.
    validations:
      required: true
  - type: textarea
    attributes:
      label: Expected Behavior
      description: A clear and concise description of what you expected to happen.
    validations:
      required: true
  - type: textarea
    attributes:
      label: To Reproduce
      description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below.
    validations:
      required: true
  - type: markdown
    attributes:
      value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear.
  - type: markdown
    attributes:
      value: Contributors should be able to follow the steps provided in order to reproduce the bug.
  - type: markdown
    attributes:
      value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance!


================================================
FILE: .github/ISSUE_TEMPLATE/02_regression.yml
================================================
name: ⏮️ Regression report
description: Report a bug not seen in an earlier version of pkg
labels: 'template: regression'
body:
  - type: markdown
    attributes:
      value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
  - type: markdown
    attributes:
      value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Question" section.
  - type: markdown
    attributes:
      value: 'Please first search the repository for similar issues and discussions.'
  - type: input
    attributes:
      label: What version of pkg are you using?
      description: '`pkg --version` - For example: 5.4.1'
    validations:
      required: true
  - type: input
    attributes:
      label: Which version(s) of pkg work for you?
      description: '`pkg --version` - For example: < 5.4.1, 5.3.0, 4.5.0'
    validations:
      required: true
  - type: input
    attributes:
      label: What version of Node.js are you using?
      description: '`node --version` - For example: 16.0.0'
    validations:
      required: true
  - type: input
    attributes:
      label: What operating system are you using?
      description: 'For example: macOS, Windows, Ubuntu 20.04'
    validations:
      required: true
  - type: input
    attributes:
      label: What CPU architecture are you using?
      description: 'For example: x86_64, arm64, armv7, Intel 12900K, Apple M1'
    validations:
      required: true
  - type: input
    attributes:
      label: What Node versions, OSs and CPU architectures are you building for?
      description: 'For example: default, node18, node18-linux-x64, node16-win-arm64'
    validations:
      required: true
  - type: textarea
    attributes:
      label: Describe the Bug
      description: A clear and concise description of what the bug is.
    validations:
      required: true
  - type: textarea
    attributes:
      label: Expected Behavior
      description: A clear and concise description of what you expected to happen.
    validations:
      required: true
  - type: textarea
    attributes:
      label: To Reproduce
      description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below.
    validations:
      required: true
  - type: markdown
    attributes:
      value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear.
  - type: markdown
    attributes:
      value: Contributors should be able to follow the steps provided in order to reproduce the bug.
  - type: markdown
    attributes:
      value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance!


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
contact_links:
  - name: 💡 Feature Request
    url: https://github.com/vercel/pkg/discussions/new
    about: Share ideas for new features
  - name: ❓ Question
    url: https://github.com/vercel/pkg/discussions/new
    about: General questions

================================================
FILE: .github/workflows/ci.yml
================================================
name: CI

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  test:
    strategy:
      fail-fast: false # prevent test to stop if one fails
      matrix:
        node-version: [14.x, 16.x, 18.x]
        os: [ubuntu-latest, windows-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
      - uses: actions/cache@v3
        with:
          path: ~/.pkg-cache/
          key: ${{ matrix.os }}-${{ matrix.node-version }}

      - run: yarn install
      - if: matrix['node-version'] == '18.x' && matrix['os'] == 'ubuntu-latest'
        run: yarn lint
      - run: yarn build
      - run: yarn test


================================================
FILE: .github/workflows/close-stale.yml
================================================
name: 'Close stale issues'
on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v3
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label'
          close-issue-message: 'This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.'
          stale-pr-message: 'This pull-request is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this pull-request entirely you can add the no-stale label'
          close-pr-message: 'This pull-request is now closed due to inactivity, you can of course reopen or reference this pull-request if you see fit.'
          days-before-stale: 90
          days-before-close: 5
          exempt-issue-labels: 'no-stale,enhancement'
          exempt-pr-labels: 'no-stale'


================================================
FILE: .gitignore
================================================
# build output
/lib-es5

# dependencies
/node_modules

# logs
npm-debug.log

# General macOS
.DS_Store
examples/.DS_Store

# Example pkg'd application
examples/express/express-example

# Example dependencies
examples/express/node_modules

# Editors
.vscode/
yarn-error.log
tsconfig.tsbuildinfo

================================================
FILE: .prettierignore
================================================
lib-es5/

================================================
FILE: .yarnrc
================================================
save-prefix ""


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2021 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# `pkg`

> [!IMPORTANT]  
> `pkg` has been deprecated with `5.8.1` as the last release. There are a number of successful forked versions of `pkg` already with various feature additions. Further, we’re excited about Node.js 21’s support for [single executable applications](https://nodejs.org/api/single-executable-applications.html). Thank you for the support and contributions over the years. The repository will remain open and archived.

This command line interface enables you to package your Node.js project into an executable that can be run even on devices without Node.js installed.

## Use Cases

- Make a commercial version of your application without sources
- Make a demo/evaluation/trial version of your app without sources
- Instantly make executables for other platforms (cross-compilation)
- Make some kind of self-extracting archive or installer
- No need to install Node.js and npm to run the packaged application
- No need to download hundreds of files via `npm install` to deploy
  your application. Deploy it as a single file
- Put your assets inside the executable to make it even more portable
- Test your app against new Node.js version without installing it

## Usage

```sh
npm install -g pkg
```

After installing it, run `pkg --help` without arguments to see list of options:

```console
pkg [options] <input>

  Options:

    -h, --help           output usage information
    -v, --version        output pkg version
    -t, --targets        comma-separated list of targets (see examples)
    -c, --config         package.json or any json file with top-level config
    --options            bake v8 options into executable to run with them on
    -o, --output         output file name or template for several files
    --out-path           path to save output one or more executables
    -d, --debug          show more information during packaging process [off]
    -b, --build          don't download prebuilt base binaries, build them
    --public             speed up and disclose the sources of top-level project
    --public-packages    force specified packages to be considered public
    --no-bytecode        skip bytecode generation and include source files as plain js
    --no-native-build    skip native addons build
    --no-signature       skip signature of the final executable on macos
    --no-dict            comma-separated list of packages names to ignore dictionaries. Use --no-dict * to disable all dictionaries
    -C, --compress       [default=None] compression algorithm = Brotli or GZip

  Examples:

  – Makes executables for Linux, macOS and Windows
    $ pkg index.js
  – Takes package.json from cwd and follows 'bin' entry
    $ pkg .
  – Makes executable for particular target machine
    $ pkg -t node16-win-arm64 index.js
  – Makes executables for target machines of your choice
    $ pkg -t node16-linux,node18-linux,node16-win index.js
  – Bakes '--expose-gc' and '--max-heap-size=34' into executable
    $ pkg --options "expose-gc,max-heap-size=34" index.js
  – Consider packageA and packageB to be public
    $ pkg --public-packages "packageA,packageB" index.js
  – Consider all packages to be public
    $ pkg --public-packages "*" index.js
  – Bakes '--expose-gc' into executable
    $ pkg --options expose-gc index.js
  – reduce size of the data packed inside the executable with GZip
    $ pkg --compress GZip index.js
```

The entrypoint of your project is a mandatory CLI argument. It may be:

- Path to entry file. Suppose it is `/path/app.js`, then
  packaged app will work the same way as `node /path/app.js`
- Path to `package.json`. `Pkg` will follow `bin` property of
  the specified `package.json` and use it as entry file.
- Path to directory. `Pkg` will look for `package.json` in
  the specified directory. See above.

### Targets

`pkg` can generate executables for several target machines at a
time. You can specify a comma-separated list of targets via `--targets`
option. A canonical target consists of 3 elements, separated by
dashes, for example `node18-macos-x64` or `node14-linux-arm64`:

- **nodeRange** (node8), node10, node12, node14, node16 or latest
- **platform** alpine, linux, linuxstatic, win, macos, (freebsd)
- **arch** x64, arm64, (armv6, armv7)

(element) is unsupported, but you may try to compile yourself.

You may omit any element (and specify just `node14` for example).
The omitted elements will be taken from current platform or
system-wide Node.js installation (its version and arch).
There is also an alias `host`, that means that all 3 elements
are taken from current platform/Node.js. By default targets are
`linux,macos,win` for current Node.js version and arch.

If you want to generate executable for different architectures,
note that by default `pkg` has to run the executable of the
**target** arch to generate bytecodes:

- Linux: configure binfmt with [QEMU](https://wiki.debian.org/QemuUserEmulation).
- macOS: possible to build `x64` on `arm64` with `Rosetta 2` but not opposite.
- Windows: possible to build `x64` on `arm64` with `x64 emulation` but not opposite.
- or, disable bytecode generation with `--no-bytecode --public-packages "*" --public`.

`macos-arm64` is experimental. Be careful about the [mandatory code signing requirement](https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-universal-apps-release-notes).
The final executable has to be signed (ad-hoc signature is sufficient) with `codesign`
utility of macOS (or `ldid` utility on Linux). Otherwise, the executable will be killed
by kernel and the end-user has no way to permit it to run at all. `pkg` tries to ad-hoc
sign the final executable. If necessary, you can replace this signature with your own
trusted Apple Developer ID.

To be able to generate executables for all supported architectures and platforms, run
`pkg` on a Linux host with binfmt (`QEMU` emulation) configured and `ldid` installed.

### Config

During packaging process `pkg` parses your sources, detects
calls to `require`, traverses the dependencies of your project
and includes them into executable. In most cases you
don't need to specify anything manually.

However your code may have `require(variable)` calls (so called non-literal
argument to `require`) or use non-javascript files (for
example views, css, images etc).

```js
require('./build/' + cmd + '.js');
path.join(__dirname, 'views/' + viewName);
```

Such cases are not handled by `pkg`. So you must specify the
files - scripts and assets - manually in `pkg` property of
your `package.json` file.

```json
  "pkg": {
    "scripts": "build/**/*.js",
    "assets": "views/**/*",
    "targets": [ "node14-linux-arm64" ],
    "outputPath": "dist"
  }
```

The above example will include everything in `assets/` and
every .js file in `build/`, build only for `node14-linux-arm64`,
and place the executable inside `dist/`.

You may also specify arrays of globs:

```
    "assets": [ "assets/**/*", "images/**/*" ]
```

Just be sure to call `pkg package.json` or `pkg .` to make
use of `package.json` configuration.

### Scripts

`scripts` is a [glob](https://github.com/sindresorhus/globby)
or list of globs. Files specified as `scripts` will be compiled
using `v8::ScriptCompiler` and placed into executable without
sources. They must conform to the JS standards of those Node.js versions
you target (see [Targets](#targets)), i.e. be already transpiled.

### Assets

`assets` is a [glob](https://github.com/sindresorhus/globby)
or list of globs. Files specified as `assets` will be packaged
into executable as raw content without modifications. Javascript
files may also be specified as `assets`. Their sources will
not be stripped as it improves execution performance of the
files and simplifies debugging.

See also
[Detecting assets in source code](#detecting-assets-in-source-code) and
[Snapshot filesystem](#snapshot-filesystem).

### Options

Node.js application can be called with runtime options
(belonging to Node.js or V8). To list them type `node --help` or `node --v8-options`.

You can "bake" these runtime options into packaged application. The app will always run with the options
turned on. Just remove `--` from option name.

You can specify multiple options by joining them in a single string, comma (`,`) separated:

```sh
pkg app.js --options expose-gc
pkg app.js --options max_old_space_size=4096
pkg app.js --options max-old-space-size=1024,tls-min-v1.0,expose-gc
```

### Output

You may specify `--output` if you create only one executable
or `--out-path` to place executables for multiple targets.

### Debug

Pass `--debug` to `pkg` to get a log of packaging process.
If you have issues with some particular file (seems not packaged
into executable), it may be useful to look through the log.

### Bytecode (reproducibility)

By default, your source code is precompiled to v8 bytecode before being written
to the output file. To disable this feature, pass `--no-bytecode` to `pkg`.

#### Why would you want to do this?

If you need a reproducible build
process where your executable hashes (e.g. md5, sha1, sha256, etc.) are the
same value between builds. Because compiling bytecode is not deterministic
(see [here](https://ui.adsabs.harvard.edu/abs/2019arXiv191003478C/abstract) or
[here](https://medium.com/dailyjs/understanding-v8s-bytecode-317d46c94775)) it
results in executables with differing hashed values. Disabling bytecode
compilation allows a given input to always have the same output.

#### Why would you NOT want to do this?

While compiling to bytecode does not make your source code 100% secure, it does
add a small layer of security/privacy/obscurity to your source code. Turning
off bytecode compilation causes the raw source code to be written directly to
the executable file. If you're on \*nix machine and would like an example, run
`pkg` with the `--no-bytecode` flag, and use the GNU strings tool on the
output. You then should be able to grep your source code.

#### Other considerations

Specifying `--no-bytecode` will fail if there are any packages in your project that aren't explicitly marked
as public by the `license` in their `package.json`.
By default, `pkg` will check the license of each package and make sure that stuff that isn't meant for the public will
only be included as bytecode.

If you do require building pkg binaries for other architectures and/or depend on a package with a broken
`license` in its `package.json`, you can override this behaviour by either explicitly whitelisting packages to be public
using `--public-packages "packageA,packageB"` or setting all packages to public using `--public-packages "*"`

### Build

`pkg` has so called "base binaries" - they are actually same
`node` executables but with some patches applied. They are
used as a base for every executable `pkg` creates. `pkg`
downloads precompiled base binaries before packaging your
application. If you prefer to compile base binaries from
source instead of downloading them, you may pass `--build`
option to `pkg`. First ensure your computer meets the
requirements to compile original Node.js:
[BUILDING.md](https://github.com/nodejs/node/blob/HEAD/BUILDING.md)

See [pkg-fetch](https://github.com/vercel/pkg-fetch) for more info.

### Compression

Pass `--compress Brotli` or `--compress GZip` to `pkg` to compress further the content of the files store in the exectable.

This option can reduce the size of the embedded file system by up to 60%.

The startup time of the application might be reduced slightly.

`-C` can be used as a shortcut for `--compress `.

### Environment

| Var            | Description                                                                               |
| -------------- | ----------------------------------------------------------------------------------------- |
| PKG_CACHE_PATH | Used to specify a custom path for node binaries cache folder. Default is `~/.pkg-cache`   |
| PKG_IGNORE_TAG | Allows to ignore additional folder created on `PKG_CACHE_PATH` matching pkg-fetch version |
| MAKE_JOB_COUNT | Allow configuring number of processes used for compiling                                  |

Examples

```bash
# 1 - Using export
export PKG_CACHE_PATH=/my/cache
pkg app.js

# 2 - Passing it before the script
PKG_CACHE_PATH=/my/cache pkg app.js
```

## Usage of packaged app

Command line call to packaged app `./app a b` is equivalent
to `node app.js a b`

## Snapshot filesystem

During packaging process `pkg` collects project files and places
them into executable. It is called a snapshot. At run time the
packaged application has access to snapshot filesystem where all
that files reside.

Packaged files have `/snapshot/` prefix in their paths (or
`C:\snapshot\` in Windows). If you used `pkg /path/app.js` command line,
then `__filename` value will be likely `/snapshot/path/app.js`
at run time. `__dirname` will be `/snapshot/path` as well. Here is
the comparison table of path-related values:

| value                         | with `node`     | packaged                 | comments                       |
| ----------------------------- | --------------- | ------------------------ | ------------------------------ |
| \_\_filename                  | /project/app.js | /snapshot/project/app.js |
| \_\_dirname                   | /project        | /snapshot/project        |
| process.cwd()                 | /project        | /deploy                  | suppose the app is called ...  |
| process.execPath              | /usr/bin/nodejs | /deploy/app-x64          | `app-x64` and run in `/deploy` |
| process.argv[0]               | /usr/bin/nodejs | /deploy/app-x64          |
| process.argv[1]               | /project/app.js | /snapshot/project/app.js |
| process.pkg.entrypoint        | undefined       | /snapshot/project/app.js |
| process.pkg.defaultEntrypoint | undefined       | /snapshot/project/app.js |
| require.main.filename         | /project/app.js | /snapshot/project/app.js |

Hence, in order to make use of a file collected at packaging
time (`require` a javascript file or serve an asset) you should
take `__filename`, `__dirname`, `process.pkg.defaultEntrypoint`
or `require.main.filename` as a base for your path calculations.
For javascript files you can just `require` or `require.resolve`
because they use current `__dirname` by default. For assets use
`path.join(__dirname, '../path/to/asset')`. Learn more about
`path.join` in
[Detecting assets in source code](#detecting-assets-in-source-code).

On the other hand, in order to access real file system at run time
(pick up a user's external javascript plugin, json configuration or
even get a list of user's directory) you should take `process.cwd()`
or `path.dirname(process.execPath)`.

## Detecting assets in source code

When `pkg` encounters `path.join(__dirname, '../path/to/asset')`,
it automatically packages the file specified as an asset. See
[Assets](#assets). Pay attention that `path.join` must have two
arguments and the last one must be a string literal.

This way you may even avoid creating `pkg` config for your project.

## Native addons

Native addons (`.node` files) use is supported. When `pkg` encounters
a `.node` file in a `require` call, it will package this like an asset.
In some cases (like with the `bindings` package), the module path is generated
dynamicaly and `pkg` won't be able to detect it. In this case, you should
add the `.node` file directly in the `assets` field in `package.json`.

The way Node.js requires native addon is different from a classic JS
file. It needs to have a file on disk to load it, but `pkg` only generates
one file. To circumvent this, `pkg` will create a temporary file on the
disk. These files will stay on the disk after the process has exited
and will be used again on the next process launch.

When a package, that contains a native module, is being installed,
the native module is compiled against current system-wide Node.js
version. Then, when you compile your project with `pkg`, pay attention
to `--target` option. You should specify the same Node.js version
as your system-wide Node.js to make compiled executable compatible
with `.node` files.

Note that fully static Node binaries are not capable of loading native
bindings, so you may not use Node bindings with `linuxstatic`.

## API

`const { exec } = require('pkg')`

`exec(args)` takes an array of command line arguments and returns
a promise. For example:

```js
await exec(['app.js', '--target', 'host', '--output', 'app.exe']);
// do something with app.exe, run, test, upload, deploy, etc
```

## Troubleshooting

### Error: ENOENT: no such file or directory, uv_chdir

This error can be caused by deleting the directory the application is
run from. Or, generally, deleting `process.cwd()` directory when the
application is running.

### Error: ERR_INSPECTOR_NOT_AVAILABLE

This error can be caused by using `NODE_OPTIONS` variable to force to
run `node` with the debug mode enabled. Debugging options are disallowed
, as **pkg** executables are usually used for production environments.
If you do need to use inspector, you can [build a debuggable Node.js](https://github.com/vercel/pkg/issues/93#issuecomment-301210543) yourself.

### Error: require(...).internalModuleStat is not a function

This error can be caused by using `NODE_OPTIONS` variable with some
bootstrap or `node` options causing conflicts with **pkg**. Some
IDEs, such as **VS Code**, may add this env variable automatically.

You could check on **Unix systems** (Linux/macOS) in `bash`:

```bash
$ printenv | grep NODE
```

## Advanced

### exploring virtual file system embedded in debug mode

When you are using the `--debug` flag when building your executable,
`pkg` add the ability to display the content of the virtual file system
and the symlink table on the console, when the application starts,
providing that the environement variable DEBUG_PKG is set.
This feature can be useful to inspect if symlinks are correctly handled,
and check that all the required files for your application are properly
incorporated to the final executable.

    $ pkg --debug app.js -o output
    $ DEBUG_PKG=1 output

or

    C:\> pkg --debug app.js -o output.exe
    C:\> set DEBUG_PKG=1
    C:\> output.exe

Note: make sure not to use --debug flag in production.


================================================
FILE: dictionary/.eslintrc.json
================================================
{
  "parserOptions": {
    "sourceType": "script"
  }
}


================================================
FILE: dictionary/angular-bridge.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/any-promise.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/async.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/aws-sdk.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['apis/*.json', 'lib/services/*.js'],
  },
};


================================================
FILE: dictionary/babel-core.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/batch.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/bcrypt.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/better-sqlite3.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/bignum.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/bindings.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/blessed.js
================================================
'use strict';

// https://github.com/chjj/blessed/issues/298
module.exports = {
  pkg: {
    scripts: ['lib/widgets/*.js'],
  },
};


================================================
FILE: dictionary/body-parser.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: [
      'lib/types/*.js', // for 1.4-1.13
    ],
  },
};


================================================
FILE: dictionary/browserify.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['bin/*.txt'],
  },
};


================================================
FILE: dictionary/bson.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/buffermaker.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/*.js'],
  },
};


================================================
FILE: dictionary/bunyan.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/bunyan.js': ["mv = require('mv' + '');", "mv = require('mv');"],
    },
  },
};


================================================
FILE: dictionary/busboy.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/types/*.js'],
  },
};


================================================
FILE: dictionary/bytes.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/callsites.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/chokidar.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/coffee-script.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/coffee-script/*.js'],
  },
};


================================================
FILE: dictionary/colors.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/compression.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/compressjs.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/*.js'],
  },
};


================================================
FILE: dictionary/connect-mongo.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/connect-mongodb.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/connect-redis.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/connect.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/middleware/*.js'],
    assets: [
      'lib/public/**/*', // for connect@2.3
    ],
  },
};


================================================
FILE: dictionary/consolidate.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/cookie-parser.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/cookie.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/cors.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/cron.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/cross-env.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      // author is mistaken to point package.json.main to
      // src/index.js (that is es6) instead of dist/index.js (es5)
      'src/index.js': [{ do: 'erase' }, ''],
    },
  },
};


================================================
FILE: dictionary/cross-spawn-async.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/curve25519.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/data-preflight.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['src/view/**/*', 'src/js/view/**/*'],
  },
};


================================================
FILE: dictionary/debug.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/denymount.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/diff.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/drivelist.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'build/scripts.js': [
        "path.join(__dirname, '..', 'scripts')",
        "path.join(path.dirname(process.execPath), 'drivelist')",
      ],
      'lib/scripts.js': [
        "path.join(__dirname, '..', 'scripts')",
        "path.join(path.dirname(process.execPath), 'drivelist')", // for 4.0.0
      ],
    },
    deployFiles: [
      ['build/Release/drivelist.node', 'drivelist.node'],
      ['scripts/darwin.sh', 'drivelist/darwin.sh'],
      ['scripts/linux.sh', 'drivelist/linux.sh'],
      ['scripts/win32.bat', 'drivelist/win32.bat'],
    ],
  },
};


================================================
FILE: dictionary/ed25519.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/ejs.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/elasticsearch.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/electron.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'index.js': [
        'path.join(__dirname, fs',
        "path.join(path.dirname(process.execPath), 'electron', fs",
      ],
    },
    deployFiles: [
      ['dist', 'electron/dist', 'directory'],
      ['../sliced/index.js', 'node_modules/sliced/index.js'],
      ['../deep-defaults/lib/index.js', 'node_modules/deep-defaults/index.js'],
    ],
  },
};


================================================
FILE: dictionary/emailjs.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/engine.io.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/epoll.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/errorhandler.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['public/**/*'],
  },
};


================================================
FILE: dictionary/errors.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['lib/static/*'],
  },
};


================================================
FILE: dictionary/eslint.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/rules/*.js', 'lib/formatters/*.js'],
  },
};


================================================
FILE: dictionary/etcher-image-write.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/exceljs.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: [
      // TODO look at exceljs and implement as
      // many __dirname use cases as possible
      'lib/**/*.xml',
    ],
    patches: {
      'lib/stream/xlsx/workbook-writer.js': [
        "require.resolve('../../xlsx/xml/theme1.xml')",
        "require('path').join(__dirname, '../../xlsx/xml/theme1.xml')",
      ],
      'lib/xlsx/xlsx.js': [
        "require.resolve('./xml/theme1.xml')",
        "require('path').join(__dirname, './xml/theme1.xml')",
      ],
    },
  },
};


================================================
FILE: dictionary/exiftool.exe.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'index.js': [
        "path.join(__dirname, 'vendor', 'exiftool.exe')",
        "path.join(path.dirname(process.execPath), 'exiftool.exe')",
      ],
    },
    deployFiles: [['vendor/exiftool.exe', 'exiftool.exe']],
  },
};


================================================
FILE: dictionary/exiftool.pl.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'index.js': [
        "path.join(__dirname, 'vendor', 'exiftool')",
        "path.join(path.dirname(process.execPath), 'exiftool')",
      ],
    },
    deployFiles: [['vendor/exiftool', 'exiftool']],
  },
};


================================================
FILE: dictionary/express-load.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/express-load.js': [
        'entity = path.resolve(',
        'entity = process.pkg.path.resolve(',
      ],
    },
  },
};


================================================
FILE: dictionary/express-session.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/express.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/view.js': [
        'path = join(this.root, path)',
        'path = process.pkg.path.resolve(this.root, path)', // for 3.x
        'loc = resolve(root, name)',
        'loc = process.pkg.path.resolve(root, name)', // for 4.x
      ],
    },
  },
};


================================================
FILE: dictionary/extender.js
================================================
'use strict';

module.exports = {
  // в declare.js грязный хак.
  // если в тексте(!) функции есть подстрока "super"
  // (см SUPER_REGEXP), то её надо оборачивать особым
  // способом (см functionWrapper). поэтому все пакеты,
  // которые зависят от declare.js - надо проработать.
  // хотя бы те файлы, функции в которых попадают в
  // functionWrapper
};


================================================
FILE: dictionary/extsprintf.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/faye-websocket.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/feathers.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/findup-sync.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/floordate.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/fmt.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/formidable.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/fs-extra.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/fsevents.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/geoip-lite.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['data/*'],
  },
};


================================================
FILE: dictionary/github.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['lib/routes.json'],
  },
};


================================================
FILE: dictionary/gm.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/google-closure-compiler-java.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'index.js': [
        "require.resolve('./compiler.jar')",
        "require('path').join(require('path').dirname(process.execPath), 'compiler/compiler.jar')",
      ],
    },
    deployFiles: [['compiler.jar', 'compiler/compiler.jar']],
  },
};


================================================
FILE: dictionary/google-closure-compiler.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/node/closure-compiler.js': [
        "require.resolve('../../compiler.jar')",
        "require('path').join(require('path').dirname(process.execPath), 'compiler/compiler.jar')",
      ],
    },
    deployFiles: [['compiler.jar', 'compiler/compiler.jar']],
  },
};


================================================
FILE: dictionary/googleapis.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['apis/**/*.js'],
  },
};


================================================
FILE: dictionary/got.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/graceful-fs.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'graceful-fs.js': [
        { do: 'prepend' },
        'if ((function() {\n' +
          "  var version = require('./package.json').version;\n" +
          "  var major = parseInt(version.split('.')[0]);\n" +
          '  if (major < 4) {\n' +
          "    module.exports = require('fs');\n" +
          '    return true;\n' +
          '  }\n' +
          '})()) return;\n',
      ],
    },
  },
};


================================================
FILE: dictionary/grpc.js
================================================
'use strict';

module.exports = {
  pkg: {
    files: [
      // suppress because hundreds of
      // C++ files go inside executable
    ],
    assets: ['etc/*.pem', 'deps/grpc/etc/*.pem'],
  },
};


================================================
FILE: dictionary/gulp.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/hap-nodejs.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/heapdump.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/hoek.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/homebridge.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/http-proxy.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/http-server.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/image-size.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/indexof.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/inquirer.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/j.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'j.js': [
        "require('xl'+'sx')",
        "require('xlsx')",
        "require('xl'+'sjs')",
        "require('xlsjs')",
        "require('ha'+'rb')",
        "require('harb')",
      ],
    },
  },
};


================================================
FILE: dictionary/jade.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/jsdom.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/json-stringify-date.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/json-stringify-safe.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/jsonwebtoken.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/kerberos.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/knex.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js'],
  },
};


================================================
FILE: dictionary/later.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['later.js'],
  },
};


================================================
FILE: dictionary/level.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/leveldown.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'binding.js': ['__dirname', "require('path').dirname(process.execPath)"],
    },
    deployFiles: [['prebuilds', 'prebuilds', 'directory']],
  },
};


================================================
FILE: dictionary/levelup.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/liftoff.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'index.js': [
        'resolve.sync(this.moduleName, {basedir: configBase || cwd, paths: paths})',
        'resolve.sync(this.moduleName, {basedir: configBase || require.main.filename, paths: paths})',
      ],
    },
  },
};


================================================
FILE: dictionary/lodash.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/log4js.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/appenders/*.js'],
  },
};


================================================
FILE: dictionary/logform.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['*.js'],
  },
};


================================================
FILE: dictionary/machinepack-urls.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['machines/*.js'],
  },
};


================================================
FILE: dictionary/markdown.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/mdns.js
================================================
'use strict';

module.exports = {
  // хоть bindings и объявлен в
  // dependencies, но не используется
};


================================================
FILE: dictionary/method-override.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/microjob.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'dist/worker-pool.js': [
        'error.stack = message.error.stack;',
        'error.stack = message.error.stack;\n' +
          'if (error.stack.indexOf("SyntaxError") >= 0) {' +
          'error.stack = "Pkg: Try to specify your ' +
          "javascript file in 'assets' in config.\\n\" + error.stack;" +
          '};',
      ],
    },
  },
};


================================================
FILE: dictionary/mime-types.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/mime.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/minimatch.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/minstache.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/module-deps.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/moment-timezone.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/moment.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['locale/*.js'],
  },
};


================================================
FILE: dictionary/mongodb-core.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/error.js': [
        'return err;',
        'if (err.message.indexOf("SyntaxError") >= 0) {' +
          'err.message = "Pkg: Try to specify your ' +
          "javascript file in 'assets' in config. \" + err.message;" +
          '};\n' +
          'return err;',
        'if (Error.captureStackTrace) {',
        'if (this.message.indexOf("SyntaxError") >= 0) {' +
          'this.message = "Pkg: Try to specify your ' +
          "javascript file in 'assets' in config. \" + this.message;" +
          '};\n' +
          'if (Error.captureStackTrace) {',
      ],
    },
  },
};


================================================
FILE: dictionary/mongodb.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/mongodb/**/*.js'],
  },
};


================================================
FILE: dictionary/mongoose.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/drivers/node-mongodb-native/*.js'],
  },
};


================================================
FILE: dictionary/mongoskin.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js'],
  },
};


================================================
FILE: dictionary/ms.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/msgpack.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/multer.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/muri.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/native-or-bluebird.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/natives.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/nconf.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/nconf/stores/*.js'],
  },
};


================================================
FILE: dictionary/nedb.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/negotiator.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/*.js'],
  },
};


================================================
FILE: dictionary/newrelic.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/nib.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/nightmare.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/nightmare.js': [
        "path.join(__dirname, 'runner.js')",
        "path.join(path.dirname(process.execPath), 'nightmare/runner.js')",
      ],
    },
    deployFiles: [
      ['lib/runner.js', 'nightmare/runner.js'],
      ['lib/frame-manager.js', 'nightmare/frame-manager.js'],
      ['lib/ipc.js', 'nightmare/ipc.js'],
      ['lib/preload.js', 'nightmare/preload.js'],
    ],
  },
};


================================================
FILE: dictionary/node-forge.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['js/*.js', 'lib/*.js'],
  },
};


================================================
FILE: dictionary/node-libcurl.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/node-notifier.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'notifiers/balloon.js': [
        "__dirname, '../vendor/notifu/notifu'",
        "path.dirname(process.execPath), 'notifier/notifu'",
      ],
      'notifiers/notificationcenter.js': [
        "__dirname,\n  '../vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier'",
        "path.dirname(process.execPath), 'notifier/terminal-notifier'",
      ],
      'notifiers/toaster.js': [
        "__dirname, '../vendor/snoreToast/snoretoast'",
        "path.dirname(process.execPath), 'notifier/snoretoast'",
      ],
    },
    deployFiles: [
      ['vendor/notifu/notifu.exe', 'notifier/notifu.exe'],
      ['vendor/notifu/notifu64.exe', 'notifier/notifu64.exe'],
      [
        'vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier',
        'notifier/terminal-notifier',
      ],
      ['vendor/snoreToast/snoretoast-x64.exe', 'notifier/snoretoast-x64.exe'],
      ['vendor/snoreToast/snoretoast-x86.exe', 'notifier/snoretoast-x86.exe'],
    ],
  },
};


================================================
FILE: dictionary/node-pre-gyp.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/*.js'],
  },
};


================================================
FILE: dictionary/node-redis-pubsub.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/node-sass.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/node-uuid.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/node-xlsx.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/node-zookeeper-client.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['lib/jute/specification.json'],
  },
};


================================================
FILE: dictionary/nodegit.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['dist/**/*.js'],
  },
};


================================================
FILE: dictionary/nodemailer-sendmail-transport.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/nodemailer.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/npm-registry-client.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js'],
  },
};


================================================
FILE: dictionary/npm.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/*.js'],
  },
};


================================================
FILE: dictionary/nssocket.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/oauth2orize.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js'],
  },
};


================================================
FILE: dictionary/octobat.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/open.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'index.js': [
        "path.join(__dirname, 'xdg-open')",
        "path.join(path.dirname(process.execPath), 'xdg-open')",
      ],
    },
    deployFiles: [['xdg-open', 'xdg-open']],
  },
};


================================================
FILE: dictionary/opn.js
================================================
'use strict';

// compatibility with 'open'
module.exports = require('./open.js');


================================================
FILE: dictionary/optimist.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/passport-local.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/passport.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/pg-cursor.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/pg-query-stream.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/pg-types.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/arrayParser.js'],
  },
};


================================================
FILE: dictionary/pg.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js'],
  },
};


================================================
FILE: dictionary/pg.js.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js'],
  },
};


================================================
FILE: dictionary/pgpass.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/helper.js'],
  },
};


================================================
FILE: dictionary/phantom.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/phantom.js': [
        "__dirname + '/shim/index.js'",
        "_path2.default.join(_path2.default.dirname(process.execPath), 'phantom/index.js')",
      ],
    },
    deployFiles: [
      ['lib/shim/index.js', 'phantom/index.js'],
      [
        'lib/shim/function_bind_polyfill.js',
        'phantom/function_bind_polyfill.js',
      ],
    ],
  },
};


================================================
FILE: dictionary/phantomjs-prebuilt.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/phantomjs.js': [
        '__dirname, location.location',
        "path.dirname(process.execPath), 'phantom', path.basename(location.location)",
      ],
    },
    deployFiles: [
      ['lib/phantom/bin/phantomjs', 'phantom/phantomjs'],
      ['lib/phantom/bin/phantomjs.exe', 'phantom/phantomjs.exe'],
    ],
  },
};


================================================
FILE: dictionary/pkginfo.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/pm2.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/ProcessContainerFork.js'],
  },
};


================================================
FILE: dictionary/pmx.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/pouchdb.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/primus-emitter.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/primus-spark-latency.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/primus.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/publicsuffixlist.js
================================================
'use strict';

module.exports = {
  dependencies: {
    gulp: undefined,
    'gulp-di': undefined,
    'gulp-istanbul': undefined,
    'gulp-jshint': undefined,
    'gulp-mocha': undefined,
    mocha: undefined,
  },
  pkg: {
    assets: ['effective_tld_names.dat'],
  },
};


================================================
FILE: dictionary/pug.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/punt.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/puppeteer.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'utils/ChromiumDownloader.js': [
        "path.join(__dirname, '..', '.local-chromium')",
        "path.join(path.dirname(process.execPath), 'puppeteer')",
      ],
    },
    deployFiles: [['.local-chromium', 'puppeteer', 'directory']],
  },
};


================================================
FILE: dictionary/pwd.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/q.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/raven.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/rc.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/utils.js': [
        'process.cwd()',
        "require('path').dirname(require.main.filename)",
      ],
    },
  },
};


================================================
FILE: dictionary/readable-stream.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/rechoir.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/redis-parser.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/redis.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/regression.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/reload.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/reload-server.js'],
  },
};


================================================
FILE: dictionary/request.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/require-uncached.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/require_optional.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/s3.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/safe_datejs.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/sails.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js'],
    patches: {
      'lib/hooks/moduleloader/index.js': [
        "require('coffee-script/register')",
        '',
      ],
      'lib/app/configuration/index.js': [
        'hook = require(hookBundled);',
        'hook = require(hookBundled);' +
          // force to take the whole package
          "require('sails-hook-sockets');",
      ],
      'lib/hooks/grunt/index.js': [
        'var child = ChildProcess.fork(',
        '\n' +
          "sails.log.warn('*******************************************************************');\n" +
          "sails.log.warn('** Pkg: Grunt hook is temporarily disabled in pkg-ed app         **');\n" +
          "sails.log.warn('** Instead it should be run before compilation to prepare files  **');\n" +
          "sails.log.warn('*******************************************************************');\n" +
          "sails.emit('hook:grunt:done');\n" +
          'return cb_afterTaskStarted();(',
      ],
      'lib/hooks/orm/backwards-compatibility/upgrade-datastore.js': [
        'if (!fs.existsSync(modulePath)) {',
        'try { require(modulePath); } catch (e) {',
      ],
    },
  },
};


================================================
FILE: dictionary/sax.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/scrypt.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/semver.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/sequelize.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js'],
  },
};


================================================
FILE: dictionary/serialport.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/sha3.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/sharp.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/*.js'],
    deployFiles: [
      ['build/Release', 'sharp/build/Release', 'directory'],
      ['vendor/lib', 'sharp/vendor/lib', 'directory'],
    ],
  },
};


================================================
FILE: dictionary/shelljs.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['src/*.js'],
  },
};


================================================
FILE: dictionary/sinon.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/socket.io-client.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: [
      'lib/**/*.js', // for 0.9.17
    ],
    assets: [
      'socket.io.js',
      'dist/**/*', // for 0.9.17
    ],
  },
};


================================================
FILE: dictionary/socket.io.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/index.js': [
        "require.resolve('socket.io-client/dist/socket.io.js.map')",
        "require.resolve('socket.io-client/dist/socket.io.js.map', 'must-exclude')",
      ],
    },
  },
};


================================================
FILE: dictionary/sqip.js
================================================
'use strict';

/**
 * primitive Binaries must be installed on the system.
 * e.g. go get -u github.com/fogleman/primitive
 */
module.exports = {};


================================================
FILE: dictionary/sqlite3.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/steam-crypto.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['public.pub'],
  },
};


================================================
FILE: dictionary/steam-resources.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['steam_language/**/*'],
    patches: {
      'steam_language_parser/index.js': [
        'process.chdir',
        '// process.chdir',
        "'steammsg.steamd'",
        "require('path').join(__dirname, '../steam_language', 'steammsg.steamd')",
      ],
      'steam_language_parser/parser/token_analyzer.js': [
        'text.value',
        "require('path').join(__dirname, '../../steam_language', text.value)",
      ],
    },
  },
};


================================================
FILE: dictionary/steam.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/stripe-webhook-middleware.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/stripe.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/strong-globalize.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/stylus.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['lib/**/*.styl'],
    log: function (log, opts) {
      log.warn(
        'Add { paths: [ __dirname ] } to ' +
          'stylus options to resolve imports',
        [opts.packagePath]
      );
    },
  },
};


================================================
FILE: dictionary/supervisor.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/svgo.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/**/*.js', 'plugins/*.js'],
    assets: ['.svgo.yml'],
  },
};


================================================
FILE: dictionary/tabtab.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/tesseract.js.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['src/worker-script/node/index.js'],
  },
};


================================================
FILE: dictionary/throng.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/time.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/tinify.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['lib/data/cacert.pem'],
  },
};


================================================
FILE: dictionary/tiny-worker.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: ['lib/noop.js'],
  },
};


================================================
FILE: dictionary/tmp.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/transformers.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/uglify-js.js
================================================
'use strict';

module.exports = {
  pkg: {
    // assets, not scripts because of custom
    // load_global (readFileSync + runInContext)
    assets: ['lib/**/*.js', 'tools/*.js'],
  },
};


================================================
FILE: dictionary/umd.js
================================================
'use strict';

module.exports = {
  pkg: {
    assets: [
      'template.js', // for 2.1.0
    ],
    patches: {
      'index.js': [
        "var rfile = require('rfile');",
        'var rfile = function(f) { ' +
          "require('fs').readFileSync(" + // for 2.1.0
          'require.resolve(f)' +
          '); ' +
          '};',
      ],
    },
  },
};


================================================
FILE: dictionary/underscore.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/union.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/update-notifier.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/usage.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/providers/*.js'],
  },
};


================================================
FILE: dictionary/v8flags.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'index.js': [
        "execFile(process.execPath, ['--v8-options'],",
        "execFile(process.execPath, ['--v8-options'], " +
          "{ env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' } },",
      ],
    },
  },
};


================================================
FILE: dictionary/verror.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/voc.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/webdriverio.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['build/**/*.js'],
  },
};


================================================
FILE: dictionary/winston-uber.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/winston/transports/*.js'],
  },
};


================================================
FILE: dictionary/winston.js
================================================
'use strict';

module.exports = {
  pkg: {
    scripts: ['lib/winston/transports/*.js'],
  },
};


================================================
FILE: dictionary/ws.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/xlsx.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'xlsx.js': [
        "require('js'+'zip')",
        "require('jszip')",
        "require('./js'+'zip')",
        "require('./jszip')",
        "require('./od' + 's')",
        "require('./ods')",
      ],
    },
  },
};


================================================
FILE: dictionary/xml2js.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/yargs.js
================================================
'use strict';

module.exports = {};


================================================
FILE: dictionary/zeromq.js
================================================
'use strict';

module.exports = {
  pkg: {
    patches: {
      'lib/native.js': [
        'path.join(__dirname, "..")',
        'path.dirname(process.execPath)',
      ],
    },
    deployFiles: [['prebuilds', 'prebuilds', 'directory']],
  },
};


================================================
FILE: examples/.eslintrc.json
================================================
{
  "parserOptions": {
    "sourceType": "script"
  },
  "rules": {
    "no-path-concat": "off",
    "no-var": "off"
  }
}


================================================
FILE: examples/express/index.js
================================================
'use strict';

var express = require('express');
var app = express();
var Server = require('http').Server;
var server = new Server(app);

server.listen(8080);

// __dirname is used here along with package.json.pkg.assets
// see https://github.com/zeit/pkg#config and
// https://github.com/zeit/pkg#snapshot-filesystem
app.use('/', express.static(__dirname + '/views'));

app.get('/', function (req, res) {
  res.sendFile(__dirname + '/views/index.html');
});


================================================
FILE: examples/express/package.json
================================================
{
  "name": "express-example",
  "license": "ISC",
  "bin": "index.js",
  "dependencies": {
    "express": "4.15.2"
  },
  "pkg": {
    "assets": [
      "views/**/*"
    ],
    "targets": [
      "node8"
    ]
  }
}


================================================
FILE: examples/express/readme.md
================================================
# Express-Example

> This example illustrates using `pkg` on a simple Express based app

## Instructions

1. Run `npm install`
2. Run `pkg .`

That's it!

## Post Success Notes

- Upon success, `pkg` will create an executable named "express-example". This file can be found at the root of the example project directory.
- To see the app in action, run the executable then navigate to http://localhost:8080/ in your browser.


================================================
FILE: examples/express/views/index.html
================================================
<html>
  <head>
    <link rel="stylesheet" href="lib/sakura.css" type="text/css" />
  </head>
  <body>
    Hello, world!
  </body>
</html>


================================================
FILE: examples/express/views/lib/sakura.css
================================================
/* Sakura.css v1.0.0
 * ================
 * Minimal css theme.
 * Project: https://github.com/oxalorg/sakura
 */
/* Body */
html {
  font-size: 62.5%;
  font-family: serif;
}

body {
  font-size: 1.8rem;
  line-height: 1.618;
  max-width: 38em;
  margin: auto;
  color: #4a4a4a;
  background-color: #f9f9f9;
  padding: 13px;
}

@media (max-width: 684px) {
  body {
    font-size: 1.53rem;
  }
}
@media (max-width: 382px) {
  body {
    font-size: 1.35rem;
  }
}
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.1;
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 700;
  overflow-wrap: break-word;
  word-wrap: break-word;
  -ms-word-break: break-all;
  word-break: break-word;
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

h1 {
  font-size: 2.35em;
}

h2 {
  font-size: 2em;
}

h3 {
  font-size: 1.75em;
}

h4 {
  font-size: 1.5em;
}

h5 {
  font-size: 1.25em;
}

h6 {
  font-size: 1em;
}

small,
sub,
sup {
  font-size: 75%;
}

hr {
  border-color: #2c8898;
}

a {
  text-decoration: none;
  color: #2c8898;
}
a:hover {
  color: #982c61;
  border-bottom: 2px solid #4a4a4a;
}

ul {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.4em;
}

blockquote {
  font-style: italic;
  margin-left: 1.5em;
  padding-left: 1em;
  border-left: 3px solid #2c8898;
}

img {
  max-width: 100%;
}

/* Pre and Code */
pre {
  background-color: #f1f1f1;
  display: block;
  padding: 1em;
  overflow-x: auto;
}

code {
  font-size: 0.9em;
  padding: 0 0.5em;
  background-color: #f1f1f1;
  white-space: pre-wrap;
}

pre > code {
  padding: 0;
  background-color: transparent;
  white-space: pre;
}

/* Tables */
table {
  text-align: justify;
  width: 100%;
  border-collapse: collapse;
}

td,
th {
  padding: 0.5em;
  border-bottom: 1px solid #f1f1f1;
}

/* Buttons, forms and input */
input,
textarea {
  border: 1px solid #4a4a4a;
}
input:focus,
textarea:focus {
  border: 1px solid #2c8898;
}

textarea {
  width: 100%;
}

.button,
button,
input[type='submit'],
input[type='reset'],
input[type='button'] {
  display: inline-block;
  padding: 5px 10px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  background-color: #2c8898;
  color: #f9f9f9;
  border-radius: 1px;
  border: 1px solid #2c8898;
  cursor: pointer;
  box-sizing: border-box;
}
.button[disabled],
button[disabled],
input[type='submit'][disabled],
input[type='reset'][disabled],
input[type='button'][disabled] {
  cursor: default;
  opacity: 0.5;
}
.button:focus,
.button:hover,
button:focus,
button:hover,
input[type='submit']:focus,
input[type='submit']:hover,
input[type='reset']:focus,
input[type='reset']:hover,
input[type='button']:focus,
input[type='button']:hover {
  background-color: #982c61;
  border-color: #982c61;
  color: #f9f9f9;
  outline: 0;
}

textarea,
select,
input[type] {
  color: #4a4a4a;
  padding: 6px 10px;
  /* The 6px vertically centers text on FF, ignored by Webkit */
  margin-bottom: 10px;
  background-color: #f1f1f1;
  border: 1px solid #f1f1f1;
  border-radius: 4px;
  box-shadow: none;
  box-sizing: border-box;
}
textarea:focus,
select:focus,
input[type]:focus {
  border: 1px solid #2c8898;
  outline: 0;
}

label,
legend,
fieldset {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}


================================================
FILE: lib/bin.ts
================================================
#!/usr/bin/env node

import { exec } from './index';
import { log } from './log';

async function main() {
  if (process.env.CHDIR && process.env.CHDIR !== process.cwd()) {
    // allow to override cwd by CHDIR env var
    // https://github.com/resin-io/etcher/pull/1713
    process.chdir(process.env.CHDIR);
  }

  await exec(process.argv.slice(2));
}

main().catch((error) => {
  if (!error.wasReported) log.error(error);
  process.exit(2);
});


================================================
FILE: lib/chmod.ts
================================================
import { chmod, stat } from 'fs-extra';

export async function plusx(file: string) {
  const s = await stat(file);
  const newMode = s.mode | 64 | 8 | 1;

  if (s.mode === newMode) {
    return;
  }

  const base8 = newMode.toString(8).slice(-3);
  await chmod(file, base8);
}


================================================
FILE: lib/common.ts
================================================
import assert from 'assert';
import fs from 'fs';
import path from 'path';

export const STORE_BLOB = 0;
export const STORE_CONTENT = 1;
export const STORE_LINKS = 2;
export const STORE_STAT = 3;
export const ALIAS_AS_RELATIVE = 0; // require("./file.js") // file or directory
export const ALIAS_AS_RESOLVABLE = 1; // require("package")

const win32 = process.platform === 'win32';
const hasURL = typeof URL !== 'undefined';

function uppercaseDriveLetter(f: string) {
  if (f.slice(1, 3) !== ':\\') return f;
  return f[0].toUpperCase() + f.slice(1);
}

function removeTrailingSlashes(f: string) {
  if (f === '/') {
    return f; // dont remove from "/"
  }

  if (f.slice(1) === ':\\') {
    return f; // dont remove from "D:\"
  }

  let last = f.length - 1;

  while (true) {
    const char = f.charAt(last);

    if (char === '\\') {
      f = f.slice(0, -1);
      last -= 1;
    } else if (char === '/') {
      f = f.slice(0, -1);
      last -= 1;
    } else {
      break;
    }
  }
  return f;
}

const isUrl = (p: unknown): p is URL => hasURL && p instanceof URL;

function pathToString(p: string | URL | Buffer, win: boolean): string {
  let result: string;

  if (Buffer.isBuffer(p)) {
    result = p.toString();
  } else if (isUrl(p)) {
    result = win ? p.pathname.replace(/^\//, '') : p.pathname;
  } else {
    result = p;
  }

  return result;
}

export function isRootPath(p: string | URL | Buffer) {
  let file = pathToString(p, false);

  if (file === '.') {
    file = path.resolve(file);
  }

  return path.dirname(file) === p;
}

export function normalizePath(f: string | URL | Buffer) {
  let file = pathToString(f, win32);

  if (!/^.:$/.test(file)) {
    file = path.normalize(file);
  } // 'c:' -> 'c:.'

  if (win32) {
    file = uppercaseDriveLetter(file);
  }

  return removeTrailingSlashes(file);
}

export function isPackageJson(file: string) {
  return path.basename(file) === 'package.json';
}

export function isDotJS(file: string) {
  return path.extname(file) === '.js';
}

export function isDotJSON(file: string) {
  return path.extname(file) === '.json';
}

export function isDotNODE(file: string) {
  return path.extname(file) === '.node';
}

function replaceSlashes(file: string, slash: string) {
  if (/^.:\\/.test(file)) {
    if (slash === '/') {
      return file.slice(2).replace(/\\/g, '/');
    }
  } else if (/^\//.test(file)) {
    if (slash === '\\') {
      return `C:${file.replace(/\//g, '\\')}`;
    }
  }

  return file;
}

function injectSnapshot(file: string) {
  if (/^.:\\/.test(file)) {
    // C:\path\to
    if (file.length === 3) {
      // C:\
      file = file.slice(0, -1);
    }
    // by convention, on windows we use C:\\snapshot
    return `C:\\snapshot${file.slice(2)}`;
  }

  if (/^\//.test(file)) {
    // /home/user/project
    if (file.length === 1) {
      // /
      file = file.slice(0, -1);
    }

    return `/snapshot${file}`;
  }

  return file;
}

function longestCommonLength(s1: string, s2: string) {
  const length = Math.min(s1.length, s2.length);

  for (let i = 0; i < length; i += 1) {
    if (s1.charCodeAt(i) !== s2.charCodeAt(i)) {
      return i;
    }
  }

  return length;
}

function withoutNodeModules(file: string) {
  return file.split(`${path.sep}node_modules${path.sep}`)[0];
}

export function retrieveDenominator(files: string[]) {
  assert(files.length > 0);

  let s1 = withoutNodeModules(files[0]) + path.sep;

  for (let i = 1; i < files.length; i += 1) {
    const s2 = withoutNodeModules(files[i]) + path.sep;
    s1 = s1.slice(0, longestCommonLength(s1, s2));
  }

  if (s1 === '') {
    return win32 ? 2 : 0;
  }

  return s1.lastIndexOf(path.sep);
}

export function substituteDenominator(f: string, denominator: number) {
  const rootLength = win32 ? 2 : 0;
  return f.slice(0, rootLength) + f.slice(denominator);
}

export function snapshotify(file: string, slash: string) {
  return injectSnapshot(replaceSlashes(file, slash));
}

export function insideSnapshot(f: Buffer | string | URL) {
  f = pathToString(f, win32);

  if (typeof f !== 'string') {
    return false;
  }

  if (win32) {
    const slice112 = f.slice(1, 12);

    return (
      slice112 === ':\\snapshot\\' ||
      slice112 === ':/snapshot\\' ||
      slice112 === ':\\snapshot/' ||
      slice112 === ':/snapshot/' ||
      slice112 === ':\\snapshot' ||
      slice112 === ':/snapshot'
    );
  }

  const slice010 = f.slice(0, 10);

  return slice010 === '/snapshot/' || slice010 === '/snapshot';
}

export function stripSnapshot(f: string) {
  const file = normalizePath(f);

  if (/^.:\\snapshot$/.test(file)) {
    return `${file[0]}:\\**\\`;
  }

  if (/^.:\\snapshot\\/.test(file)) {
    return `${file[0]}:\\**${file.slice(11)}`;
  }

  if (/^\/snapshot$/.test(file)) {
    return '/**/';
  }

  if (/^\/snapshot\//.test(file)) {
    return `/**${file.slice(9)}`;
  }

  return f; // not inside
}

export function removeUplevels(f: string) {
  if (win32) {
    while (true) {
      if (f.slice(0, 3) === '..\\') {
        f = f.slice(3);
      } else if (f === '..') {
        f = '.';
      } else {
        break;
      }
    }

    return f;
  }

  while (true) {
    if (f.slice(0, 3) === '../') {
      f = f.slice(3);
    } else if (f === '..') {
      f = '.';
    } else {
      break;
    }
  }

  return f;
}

export function toNormalizedRealPath(requestPath: string) {
  const file = normalizePath(requestPath);

  if (fs.existsSync(file)) {
    return fs.realpathSync(file);
  }

  return file;
}


================================================
FILE: lib/compress_type.ts
================================================
export enum CompressType {
  None = 0,
  GZip = 1,
  Brotli = 2,
}


================================================
FILE: lib/detector.ts
================================================
import * as babelTypes from '@babel/types';
import * as babel from '@babel/parser';
import generate from '@babel/generator';
import { log } from './log';

import { ALIAS_AS_RELATIVE, ALIAS_AS_RESOLVABLE } from './common';

function isLiteral(node: babelTypes.Node): node is babelTypes.Literal {
  if (node == null) {
    return false;
  }

  if (!node.type.endsWith('Literal')) {
    return false;
  }

  if (node.type === 'TemplateLiteral' && node.expressions.length !== 0) {
    return false;
  }

  return true;
}

function getLiteralValue(node: babelTypes.Literal) {
  if (node.type === 'TemplateLiteral') {
    return node.quasis[0].value.raw;
  }

  if (node.type === 'NullLiteral') {
    throw new Error('Unexpected null in require expression');
  }

  if (node.type === 'RegExpLiteral') {
    throw new Error('Unexpected regexp in require expression');
  }

  return node.value;
}

function reconstructSpecifiers(
  specs: (
    | babelTypes.ImportDefaultSpecifier
    | babelTypes.ImportNamespaceSpecifier
    | babelTypes.ImportSpecifier
  )[]
) {
  if (!specs || !specs.length) {
    return '';
  }

  const defaults = [];

  for (const spec of specs) {
    if (babelTypes.isImportDefaultSpecifier(spec)) {
      defaults.push(spec.local.name);
    }
  }

  const nonDefaults = [];

  for (const spec of specs) {
    if (babelTypes.isImportSpecifier(spec)) {
      const importedName = babelTypes.isIdentifier(spec.imported)
        ? spec.imported.name
        : spec.imported.value;

      if (spec.local.name === importedName) {
        nonDefaults.push(spec.local.name);
      } else {
        nonDefaults.push(`${importedName} as ${spec.local.name}`);
      }
    }
  }

  if (nonDefaults.length) {
    defaults.push(`{ ${nonDefaults.join(', ')} }`);
  }

  return defaults.join(', ');
}

function reconstruct(node: babelTypes.Node) {
  let v = generate(node, { comments: false }).code.replace(/\n/g, '');
  let v2;

  while (true) {
    v2 = v.replace(/\[ /g, '[').replace(/ \]/g, ']').replace(/ {2}/g, ' ');

    if (v2 === v) {
      break;
    }

    v = v2;
  }

  return v2;
}

interface Was {
  v1: string | number | boolean;
  v2?: string | number | boolean | null;
  v3?: string;
}

function forge(pattern: string, was: Was) {
  return pattern
    .replace('{c1}', ', ')
    .replace('{v1}', `"${was.v1}"`)
    .replace('{c2}', was.v2 ? ', ' : '')
    .replace('{v2}', was.v2 ? `"${was.v2}"` : '')
    .replace('{c3}', was.v3 ? ' from ' : '')
    .replace('{v3}', was.v3 ? was.v3 : '');
}

function valid2(v2?: Was['v2']) {
  return (
    v2 === undefined ||
    v2 === null ||
    v2 === 'must-exclude' ||
    v2 === 'may-exclude'
  );
}

function visitorRequireResolve(n: babelTypes.Node) {
  if (!babelTypes.isCallExpression(n)) {
    return null;
  }

  if (!babelTypes.isMemberExpression(n.callee)) {
    return null;
  }

  const ci =
    n.callee.object.type === 'Identifier' &&
    n.callee.object.name === 'require' &&
    n.callee.property.type === 'Identifier' &&
    n.callee.property.name === 'resolve';

  if (!ci) {
    return null;
  }

  if (!n.arguments || !isLiteral(n.arguments[0])) {
    return null;
  }

  return {
    v1: getLiteralValue(n.arguments[0]),
    v2: isLiteral(n.arguments[1]) ? getLiteralValue(n.arguments[1]) : null,
  };
}

function visitorRequire(n: babelTypes.Node) {
  if (!babelTypes.isCallExpression(n)) {
    return null;
  }

  if (!babelTypes.isIdentifier(n.callee)) {
    return null;
  }

  if (n.callee.name !== 'require') {
    return null;
  }

  if (!n.arguments || !isLiteral(n.arguments[0])) {
    return null;
  }

  return {
    v1: getLiteralValue(n.arguments[0]),
    v2: isLiteral(n.arguments[1]) ? getLiteralValue(n.arguments[1]) : null,
  };
}

function visitorImport(n: babelTypes.Node) {
  if (!babelTypes.isImportDeclaration(n)) {
    return null;
  }

  return { v1: n.source.value, v3: reconstructSpecifiers(n.specifiers) };
}

function visitorPathJoin(n: babelTypes.Node) {
  if (!babelTypes.isCallExpression(n)) {
    return null;
  }

  if (!babelTypes.isMemberExpression(n.callee)) {
    return null;
  }

  const ci =
    n.callee.object &&
    n.callee.object.type === 'Identifier' &&
    n.callee.object.name === 'path' &&
    n.callee.property &&
    n.callee.property.type === 'Identifier' &&
    n.callee.property.name === 'join';

  if (!ci) {
    return null;
  }

  const dn =
    n.arguments[0] &&
    n.arguments[0].type === 'Identifier' &&
    n.arguments[0].name === '__dirname';

  if (!dn) {
    return null;
  }

  const f =
    n.arguments && isLiteral(n.arguments[1]) && n.arguments.length === 2; // TODO concat them

  if (!f) {
    return null;
  }

  return { v1: getLiteralValue(n.arguments[1] as babelTypes.StringLiteral) };
}

export function visitorSuccessful(node: babelTypes.Node, test = false) {
  let was: Was | null = visitorRequireResolve(node);

  if (was) {
    if (test) {
      return forge('require.resolve({v1}{c2}{v2})', was);
    }

    if (!valid2(was.v2)) {
      return null;
    }

    return {
      alias: was.v1,
      aliasType: ALIAS_AS_RESOLVABLE,
      mustExclude: was.v2 === 'must-exclude',
      mayExclude: was.v2 === 'may-exclude',
    };
  }

  was = visitorRequire(node);

  if (was) {
    if (test) {
      return forge('require({v1}{c2}{v2})', was);
    }

    if (!valid2(was.v2)) {
      return null;
    }

    return {
      alias: was.v1,
      aliasType: ALIAS_AS_RESOLVABLE,
      mustExclude: was.v2 === 'must-exclude',
      mayExclude: was.v2 === 'may-exclude',
    };
  }

  was = visitorImport(node);

  if (was) {
    if (test) {
      return forge('import {v3}{c3}{v1}', was);
    }

    return { alias: was.v1, aliasType: ALIAS_AS_RESOLVABLE };
  }

  was = visitorPathJoin(node);

  if (was) {
    if (test) {
      return forge('path.join(__dirname{c1}{v1})', was);
    }

    return { alias: was.v1, aliasType: ALIAS_AS_RELATIVE, mayExclude: false };
  }

  return null;
}

function nonLiteralRequireResolve(n: babelTypes.Node) {
  if (!babelTypes.isCallExpression(n)) {
    return null;
  }

  if (!babelTypes.isMemberExpression(n.callee)) {
    return null;
  }

  const ci =
    n.callee.object.type === 'Identifier' &&
    n.callee.object.name === 'require' &&
    n.callee.property.type === 'Identifier' &&
    n.callee.property.name === 'resolve';

  if (!ci) {
    return null;
  }

  if (isLiteral(n.arguments[0])) {
    return null;
  }

  const m = n.arguments[1];

  if (!m) {
    return { v1: reconstruct(n.arguments[0]) };
  }

  if (!isLiteral(n.arguments[1])) {
    return null;
  }

  return {
    v1: reconstruct(n.arguments[0]),
    v2: getLiteralValue(n.arguments[1]),
  };
}

function nonLiteralRequire(n: babelTypes.Node) {
  if (!babelTypes.isCallExpression(n)) {
    return null;
  }

  if (!babelTypes.isIdentifier(n.callee)) {
    return null;
  }

  if (n.callee.name !== 'require') {
    return null;
  }

  if (isLiteral(n.arguments[0])) {
    return null;
  }

  const m = n.arguments[1];

  if (!m) {
    return { v1: reconstruct(n.arguments[0]) };
  }

  if (!isLiteral(n.arguments[1])) {
    return null;
  }

  return {
    v1: reconstruct(n.arguments[0]),
    v2: getLiteralValue(n.arguments[1]),
  };
}

export function visitorNonLiteral(n: babelTypes.Node) {
  const was = nonLiteralRequireResolve(n) || nonLiteralRequire(n);

  if (was) {
    if (!valid2(was.v2)) {
      return null;
    }

    return {
      alias: was.v1,
      mustExclude: was.v2 === 'must-exclude',
      mayExclude: was.v2 === 'may-exclude',
    };
  }

  return null;
}

function isRequire(n: babelTypes.Node) {
  if (!babelTypes.isCallExpression(n)) {
    return null;
  }

  if (!babelTypes.isIdentifier(n.callee)) {
    return null;
  }

  if (n.callee.name !== 'require') {
    return null;
  }

  const f = n.arguments && n.arguments[0];

  if (!f) {
    return null;
  }

  return { v1: reconstruct(n.arguments[0]) };
}

function isRequireResolve(n: babelTypes.Node) {
  if (!babelTypes.isCallExpression(n)) {
    return null;
  }

  if (!babelTypes.isMemberExpression(n.callee)) {
    return null;
  }

  const ci =
    n.callee.object.type === 'Identifier' &&
    n.callee.object.name === 'require' &&
    n.callee.property.type === 'Identifier' &&
    n.callee.property.name === 'resolve';

  if (!ci) {
    return null;
  }

  const f = n.type === 'CallExpression' && n.arguments && n.arguments[0];

  if (!f) {
    return null;
  }

  return { v1: reconstruct(n.arguments[0]) };
}

export function visitorMalformed(n: babelTypes.Node) {
  const was = isRequireResolve(n) || isRequire(n);

  if (was) {
    return { alias: was.v1 };
  }

  return null;
}

export function visitorUseSCWD(n: babelTypes.Node) {
  if (!babelTypes.isCallExpression(n)) {
    return null;
  }

  if (!babelTypes.isMemberExpression(n.callee)) {
    return null;
  }

  const ci =
    n.callee.object.type === 'Identifier' &&
    n.callee.object.name === 'path' &&
    n.callee.property.type === 'Identifier' &&
    n.callee.property.name === 'resolve';

  if (!ci) {
    return null;
  }

  const was = { v1: n.arguments.map(reconstruct).join(', ') };

  if (was) {
    return { alias: was.v1 };
  }

  return null;
}

type VisitorFunction = (node: babelTypes.Node, trying?: boolean) => boolean;

function traverse(ast: babelTypes.File, visitor: VisitorFunction) {
  // modified esprima-walk to support
  // visitor return value and "trying" flag
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const stack: Array<[any, boolean]> = [[ast, false]];

  for (let i = 0; i < stack.length; i += 1) {
    const item = stack[i];
    const [node] = item;

    if (node) {
      const trying = item[1] || babelTypes.isTryStatement(node);

      if (visitor(node, trying)) {
        for (const key in node) {
          if (node[key as keyof babelTypes.File]) {
            const child = node[key as keyof babelTypes.File];

            if (child instanceof Array) {
              for (let j = 0; j < child.length; j += 1) {
                stack.push([child[j], trying]);
              }
            } else if (child && typeof child.type === 'string') {
              stack.push([child, trying]);
            }
          }
        }
      }
    }
  }
}

export function parse(body: string) {
  return babel.parse(body, {
    allowImportExportEverywhere: true,
    allowReturnOutsideFunction: true,
  });
}

export function detect(body: string, visitor: VisitorFunction) {
  let json;

  try {
    json = parse(body);
  } catch (error) {
    log.warn(`Babel parse has failed: ${(error as Error).message}`);
  }

  if (!json) {
    return;
  }

  traverse(json, visitor);
}


================================================
FILE: lib/fabricator.ts
================================================
import { spawn, ChildProcessByStdio } from 'child_process';
import { Readable, Writable } from 'stream';
import { log } from './log';
import { Target } from './types';

const script = `
  var vm = require('vm');
  var module = require('module');
  var stdin = Buffer.alloc(0);
  process.stdin.on('data', function (data) {
    stdin = Buffer.concat([ stdin, data ]);
    if (stdin.length >= 4) {
      var sizeOfSnap = stdin.readInt32LE(0);
      if (stdin.length >= 4 + sizeOfSnap + 4) {
        var sizeOfBody = stdin.readInt32LE(4 + sizeOfSnap);
        if (stdin.length >= 4 + sizeOfSnap + 4 + sizeOfBody) {
          var snap = stdin.toString('utf8', 4, 4 + sizeOfSnap);
          var body = Buffer.alloc(sizeOfBody);
          var startOfBody = 4 + sizeOfSnap + 4;
          stdin.copy(body, 0, startOfBody, startOfBody + sizeOfBody);
          stdin = Buffer.alloc(0);
          var code = module.wrap(body);
          var s = new vm.Script(code, {
            filename: snap,
            produceCachedData: true,
            sourceless: true
          });
          if (!s.cachedDataProduced) {
            console.error('Pkg: Cached data not produced.');
            process.exit(2);
          }
          var h = Buffer.alloc(4);
          var b = s.cachedData;
          h.writeInt32LE(b.length, 0);
          process.stdout.write(h);
          process.stdout.write(b);
        }
      }
    }
  });
  process.stdin.resume();
`;

const children: Record<
  string,
  ChildProcessByStdio<Writable, Readable, null>
> = {};

export function fabricate(
  bakes: string[],
  fabricator: Target,
  snap: string,
  body: Buffer,
  cb: (error?: Error, buffer?: Buffer) => void
) {
  const activeBakes = bakes.filter((bake) => {
    // list of bakes that don't influence the bytecode
    const bake2 = bake.replace(/_/g, '-');

    return !['--prof', '--v8-options', '--trace-opt', '--trace-deopt'].includes(
      bake2
    );
  });

  const cmd = fabricator.binaryPath;
  const key = JSON.stringify([cmd, activeBakes]);
  let child = children[key];

  if (!child) {
    const stderr = log.debugMode ? process.stdout : 'ignore';
    children[key] = spawn(cmd, activeBakes.concat('-e', script), {
      stdio: ['pipe', 'pipe', stderr],
      env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },
    });
    child = children[key];
  }

  function kill() {
    delete children[key];
    child.kill();
  }

  let stdout = Buffer.alloc(0);

  function onError(error: Error) {
    // eslint-disable-next-line @typescript-eslint/no-use-before-define
    removeListeners();
    kill();
    cb(
      new Error(
        `Failed to make bytecode ${fabricator.nodeRange}-${fabricator.arch} for file ${snap} error (${error.message})`
      )
    );
  }

  function onClose(code: number) {
    // eslint-disable-next-line @typescript-eslint/no-use-before-define
    removeListeners();
    kill();
    if (code !== 0) {
      return cb(
        new Error(
          `Failed to make bytecode ${fabricator.nodeRange}-${fabricator.arch} for file ${snap}`
        )
      );
    }

    // eslint-disable-next-line no-console
    console.log(stdout.toString());
    return cb(new Error(`${cmd} closed unexpectedly`));
  }

  function onData(data: Buffer) {
    stdout = Buffer.concat([stdout, data]);
    if (stdout.length >= 4) {
      const sizeOfBlob = stdout.readInt32LE(0);
      if (stdout.length >= 4 + sizeOfBlob) {
        const blob = Buffer.alloc(sizeOfBlob);
        stdout.copy(blob, 0, 4, 4 + sizeOfBlob);
        // eslint-disable-next-line @typescript-eslint/no-use-before-define
        removeListeners();
        return cb(undefined, blob);
      }
    }
  }

  function removeListeners() {
    child.removeListener('error', onError);
    child.removeListener('close', onClose);
    child.stdin.removeListener('error', onError);
    child.stdout.removeListener('error', onError);
    child.stdout.removeListener('data', onData);
  }

  child.on('error', onError);
  child.on('close', onClose);
  child.stdin.on('error', onError);
  child.stdout.on('error', onError);
  child.stdout.on('data', onData);

  const h = Buffer.alloc(4);
  let b = Buffer.from(snap);
  h.writeInt32LE(b.length, 0);
  child.stdin.write(h);
  child.stdin.write(b);
  b = body;
  h.writeInt32LE(b.length, 0);
  child.stdin.write(h);
  child.stdin.write(b);
}

export function fabricateTwice(
  bakes: string[],
  fabricator: Target,
  snap: string,
  body: Buffer,
  cb: (error?: Error, buffer?: Buffer) => void
) {
  fabricate(bakes, fabricator, snap, body, (error, buffer) => {
    // node0 can not produce second time, even if first time produced fine,
    // probably because of 'filename' cache. also, there are weird cases
    // when node4 can not compile as well, for example file 'lib/js-yaml/dumper.js'
    // of package js-yaml@3.9.0 does not get bytecode second time on node4-win-x64
    if (error) return fabricate(bakes, fabricator, snap, body, cb);
    cb(undefined, buffer);
  });
}

export function shutdown() {
  for (const key in children) {
    if (children[key]) {
      const child = children[key];
      delete children[key];
      child.kill();
    }
  }
}


================================================
FILE: lib/follow.ts
================================================
import { sync, SyncOpts } from 'resolve';
import fs from 'fs';
import path from 'path';
import { toNormalizedRealPath } from './common';

import type { PackageJson } from './types';

const PROOF = 'a-proof-that-main-is-captured.js';

function parentDirectoriesContain(parent: string, directory: string) {
  let currentParent = parent;

  while (true) {
    if (currentParent === directory) {
      return true;
    }

    const newParent = path.dirname(currentParent);

    if (newParent === currentParent) {
      return false;
    }

    currentParent = newParent;
  }
}

interface FollowOptions extends Pick<SyncOpts, 'basedir' | 'extensions'> {
  ignoreFile?: string;
  catchReadFile?: (file: string) => void;
  catchPackageFilter?: (config: PackageJson, base: string, dir: string) => void;
}

export function follow(x: string, opts: FollowOptions) {
  // TODO async version
  return new Promise<string>((resolve) => {
    resolve(
      sync(x, {
        basedir: opts.basedir,
        extensions: opts.extensions,
        isFile: (file) => {
          if (
            opts.ignoreFile &&
            path.join(path.dirname(opts.ignoreFile), PROOF) === file
          ) {
            return true;
          }

          let stat;

          try {
            stat = fs.statSync(file);
          } catch (e) {
            const ex = e as NodeJS.ErrnoException;

            if (ex && (ex.code === 'ENOENT' || ex.code === 'ENOTDIR'))
              return false;

            throw ex;
          }

          return stat.isFile() || stat.isFIFO();
        },
        isDirectory: (directory) => {
          if (
            opts.ignoreFile &&
            parentDirectoriesContain(opts.ignoreFile, directory)
          ) {
            return false;
          }

          let stat;

          try {
            stat = fs.statSync(directory);
          } catch (e) {
            const ex = e as NodeJS.ErrnoException;

            if (ex && (ex.code === 'ENOENT' || ex.code === 'ENOTDIR')) {
              return false;
            }

            throw ex;
          }

          return stat.isDirectory();
        },
        readFileSync: (file) => {
          if (opts.ignoreFile && opts.ignoreFile === file) {
            return Buffer.from(`{"main":"${PROOF}"}`);
          }

          if (opts.catchReadFile) {
            opts.catchReadFile(file);
          }

          return fs.readFileSync(file);
        },
        packageFilter: (config, base, dir) => {
          if (opts.catchPackageFilter) {
            opts.catchPackageFilter(config, base, dir);
          }

          return config;
        },

        /** function to synchronously resolve a potential symlink to its real path */
        // realpathSync?: (file: string) => string;
        realpathSync: (file) => {
          const file2 = toNormalizedRealPath(file);
          return file2;
        },
      })
    );
  });
}


================================================
FILE: lib/help.ts
================================================
import chalk from 'chalk';

export default function help() {
  // eslint-disable-next-line no-console
  console.log(`
  ${chalk.bold('pkg')} [options] <input>

  ${chalk.dim('Options:')}

    -h, --help           output usage information
    -v, --version        output pkg version
    -t, --targets        comma-separated list of targets (see examples)
    -c, --config         package.json or any json file with top-level config
    --options            bake v8 options into executable to run with them on
    -o, --output         output file name or template for several files
    --out-path           path to save output one or more executables
    -d, --debug          show more information during packaging process [off]
    -b, --build          don't download prebuilt base binaries, build them
    --public             speed up and disclose the sources of top-level project
    --public-packages    force specified packages to be considered public
    --no-bytecode        skip bytecode generation and include source files as plain js
    --no-native-build    skip native addons build
    --no-dict            comma-separated list of packages names to ignore dictionaries. Use --no-dict * to disable all dictionaries
    -C, --compress       [default=None] compression algorithm = Brotli or GZip

  ${chalk.dim('Examples:')}

  ${chalk.gray('–')} Makes executables for Linux, macOS and Windows
    ${chalk.cyan('$ pkg index.js')}
  ${chalk.gray('–')} Takes package.json from cwd and follows 'bin' entry
    ${chalk.cyan('$ pkg .')}
  ${chalk.gray('–')} Makes executable for particular target machine
    ${chalk.cyan('$ pkg -t node14-win-arm64 index.js')}
  ${chalk.gray('–')} Makes executables for target machines of your choice
    ${chalk.cyan('$ pkg -t node16-linux,node18-linux,node18-win index.js')}
  ${chalk.gray(
    '–'
  )} Bakes '--expose-gc' and '--max-heap-size=34' into executable
    ${chalk.cyan('$ pkg --options "expose-gc,max-heap-size=34" index.js')}
  ${chalk.gray('–')} Consider packageA and packageB to be public
    ${chalk.cyan('$ pkg --public-packages "packageA,packageB" index.js')}
  ${chalk.gray('–')} Consider all packages to be public
    ${chalk.cyan('$ pkg --public-packages "*" index.js')}
  ${chalk.gray('–')} Bakes '--expose-gc' into executable
    ${chalk.cyan('$ pkg --options expose-gc index.js')}
  ${chalk.gray(
    '–'
  )} reduce size of the data packed inside the executable with GZip
    ${chalk.cyan('$ pkg --compress GZip index.js')}
`);
}


================================================
FILE: lib/index.ts
================================================
/* eslint-disable require-atomic-updates */

import assert from 'assert';
import {
  existsSync,
  mkdirp,
  readFile,
  remove,
  stat,
  readFileSync,
  writeFileSync,
  copyFileSync,
} from 'fs-extra';
import minimist from 'minimist';
import { need, system } from 'pkg-fetch';
import path from 'path';

import { log, wasReported } from './log';
import help from './help';
import { isPackageJson } from './common';
import packer from './packer';
import { plusx } from './chmod';
import producer from './producer';
import refine from './refiner';
import { shutdown } from './fabricator';
import walk, { Marker, WalkerParams } from './walker';
import { Target, NodeTarget, SymLinks } from './types';
import { CompressType } from './compress_type';
import { patchMachOExecutable, signMachOExecutable } from './mach-o';

const { version } = JSON.parse(
  readFileSync(path.join(__dirname, '../package.json'), 'utf-8')
);

function isConfiguration(file: string) {
  return isPackageJson(file) || file.endsWith('.config.json');
}

// http://www.openwall.com/lists/musl/2012/12/08/4

const {
  hostArch,
  hostPlatform,
  isValidNodeRange,
  knownArchs,
  knownPlatforms,
  toFancyArch,
  toFancyPlatform,
} = system;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const hostNodeRange = `node${process.version.match(/^v(\d+)/)![1]}`;

function parseTargets(items: string[]): NodeTarget[] {
  // [ 'node6-macos-x64', 'node6-linux-x64' ]
  const targets: NodeTarget[] = [];

  for (const item of items) {
    const target = {
      nodeRange: hostNodeRange,
      platform: hostPlatform,
      arch: hostArch,
    };

    if (item !== 'host') {
      for (const token of item.split('-')) {
        if (!token) {
          continue;
        }

        if (isValidNodeRange(token)) {
          target.nodeRange = token;
          continue;
        }

        const p = toFancyPlatform(token);

        if (knownPlatforms.indexOf(p) >= 0) {
          target.platform = p;
          continue;
        }
        const a = toFancyArch(token);

        if (knownArchs.indexOf(a) >= 0) {
          target.arch = a;
          continue;
        }

        throw wasReported(`Unknown token '${token}' in '${item}'`);
      }
    }

    targets.push(target as NodeTarget);
  }

  return targets;
}

function stringifyTarget(target: NodeTarget) {
  const { nodeRange, platform, arch } = target;
  return `${nodeRange}-${platform}-${arch}`;
}

interface DifferentResult {
  nodeRange?: boolean;
  platform?: boolean;
  arch?: boolean;
}

function differentParts(targets: NodeTarget[]): DifferentResult {
  const nodeRanges: Record<string, boolean> = {};
  const platforms: Record<string, boolean> = {};
  const archs: Record<string, boolean> = {};

  for (const target of targets) {
    nodeRanges[target.nodeRange] = true;
    platforms[target.platform] = true;
    archs[target.arch] = true;
  }

  const result: DifferentResult = {};

  if (Object.keys(nodeRanges).length > 1) {
    result.nodeRange = true;
  }

  if (Object.keys(platforms).length > 1) {
    result.platform = true;
  }

  if (Object.keys(archs).length > 1) {
    result.arch = true;
  }

  return result;
}

function stringifyTargetForOutput(
  output: string,
  target: NodeTarget,
  different: DifferentResult
) {
  const a = [output];

  if (different.nodeRange) {
    a.push(target.nodeRange);
  }

  if (different.platform) {
    a.push(target.platform);
  }

  if (different.arch) {
    a.push(target.arch);
  }

  return a.join('-');
}

function fabricatorForTarget({ nodeRange, arch }: NodeTarget) {
  let fabPlatform = hostPlatform;

  if (
    hostArch !== arch &&
    (hostPlatform === 'linux' || hostPlatform === 'alpine')
  ) {
    // With linuxstatic, it is possible to generate bytecode for different
    // arch with simple QEMU configuration instead of the entire sysroot.
    fabPlatform = 'linuxstatic';
  }

  return {
    nodeRange,
    platform: fabPlatform,
    arch,
  };
}

const dryRunResults: Record<string, boolean> = {};

async function needWithDryRun({
  forceBuild,
  nodeRange,
  platform,
  arch,
}: NodeTarget) {
  const result = await need({
    dryRun: true,
    forceBuild,
    nodeRange,
    platform,
    arch,
  });
  assert(['exists', 'fetched', 'built'].indexOf(result) >= 0);
  dryRunResults[result] = true;
}

const targetsCache: Record<string, string> = {};

async function needViaCache(target: NodeTarget) {
  const s = stringifyTarget(target);
  let c = targetsCache[s];

  if (c) {
    return c;
  }

  const { forceBuild, nodeRange, platform, arch } = target;

  c = await need({
    forceBuild,
    nodeRange,
    platform,
    arch,
  });

  targetsCache[s] = c;

  return c;
}

export async function exec(argv2: string[]) {
  const argv = minimist(argv2, {
    boolean: [
      'b',
      'build',
      'bytecode',
      'native-build',
      'd',
      'debug',
      'h',
      'help',
      'public',
      'v',
      'version',
      'signature',
    ],
    string: [
      '_',
      'c',
      'config',
      'o',
      'options',
      'output',
      'outdir',
      'out-dir',
      'out-path',
      'public-packages',
      'no-dict',
      't',
      'target',
      'targets',
      'C',
      'compress',
    ],
    default: { bytecode: true, 'native-build': true, signature: true },
  });

  if (argv.h || argv.help) {
    help();
    return;
  }

  // version

  if (argv.v || argv.version) {
    // eslint-disable-next-line no-console
    console.log(version);
    return;
  }

  log.info(`pkg@${version}`);

  // debug

  log.debugMode = argv.d || argv.debug;

  // forceBuild

  const forceBuild = argv.b || argv.build;

  // doCompress
  const algo = argv.C || argv.compress || 'None';

  let doCompress: CompressType = CompressType.None;
  switch (algo.toLowerCase()) {
    case 'brotli':
    case 'br':
      doCompress = CompressType.Brotli;
      break;
    case 'gzip':
    case 'gz':
      doCompress = CompressType.GZip;
      break;
    case 'none':
      break;
    default:
      throw wasReported(
        `Invalid compression algorithm ${algo} ( should be None, Brotli or Gzip)`
      );
  }
  if (doCompress !== CompressType.None) {
    // eslint-disable-next-line no-console
    console.log('compression: ', CompressType[doCompress]);
  }

  // _

  if (!argv._.length) {
    throw wasReported('Entry file/directory is expected', [
      'Pass --help to see usage information',
    ]);
  }

  if (argv._.length > 1) {
    throw wasReported('Not more than one entry file/directory is expected');
  }

  // input

  let input = path.resolve(argv._[0]);

  if (!existsSync(input)) {
    throw wasReported('Input file does not exist', [input]);
  }

  if ((await stat(input)).isDirectory()) {
    input = path.join(input, 'package.json');
    if (!existsSync(input)) {
      throw wasReported('Input file does not exist', [input]);
    }
  }

  // inputJson

  let inputJson;
  let inputJsonName;

  if (isConfiguration(input)) {
    inputJson = JSON.parse(await readFile(input, 'utf-8'));
    inputJsonName = inputJson.name;

    if (inputJsonName) {
      inputJsonName = inputJsonName.split('/').pop(); // @org/foo
    }
  }

  // inputBin

  let inputBin;

  if (inputJson) {
    let { bin } = inputJson;

    if (bin) {
      if (typeof bin === 'object') {
        if (bin[inputJsonName]) {
          bin = bin[inputJsonName];
        } else {
          bin = bin[Object.keys(bin)[0]]; // TODO multiple inputs to pkg them all?
        }
      }
      inputBin = path.resolve(path.dirname(input), bin);
      if (!existsSync(inputBin)) {
        throw wasReported(
          'Bin file does not exist (taken from package.json ' +
            "'bin' property)",
          [inputBin]
        );
      }
    }
  }

  if (inputJson && !inputBin) {
    throw wasReported("Property 'bin' does not exist in", [input]);
  }

  // inputFin

  const inputFin = inputBin || input;

  // config

  let config = argv.c || argv.config;

  if (inputJson && config) {
    throw wasReported("Specify either 'package.json' or config. Not both");
  }

  // configJson

  let configJson;

  if (config) {
    config = path.resolve(config);
    if (!existsSync(config)) {
      throw wasReported('Config file does not exist', [config]);
    }

    // eslint-disable-next-line import/no-dynamic-require, global-require
    configJson = require(config); // may be either json or js

    if (
      !configJson.name &&
      !configJson.files &&
      !configJson.dependencies &&
      !configJson.pkg
    ) {
      // package.json not detected
      configJson = { pkg: configJson };
    }
  }

  // output, outputPath

  let output = argv.o || argv.output;
  let outputPath = argv['out-path'] || argv.outdir || argv['out-dir'];
  let autoOutput = false;

  if (output && outputPath) {
    throw wasReported("Specify either 'output' or 'out-path'. Not both");
  }

  if (!output) {
    let name;

    if (inputJson) {
      name = inputJsonName;

      if (!name) {
        throw wasReported("Property 'name' does not exist in", [argv._[0]]);
      }
    } else if (configJson) {
      name = configJson.name;
    }

    if (!name) {
      name = path.basename(inputFin);
    }

    if (!outputPath) {
      if (inputJson && inputJson.pkg) {
        outputPath = inputJson.pkg.outputPath;
      } else if (configJson && configJson.pkg) {
        outputPath = configJson.pkg.outputPath;
      }

      outputPath = outputPath || '';
    }

    autoOutput = true;
    const ext = path.extname(name);
    output = name.slice(0, -ext.length || undefined);
    output = path.resolve(outputPath || '', output);
  } else {
    output = path.resolve(output);
  }

  // targets

  const sTargets = argv.t || argv.target || argv.targets || '';

  if (typeof sTargets !== 'string') {
    throw wasReported(`Something is wrong near ${JSON.stringify(sTargets)}`);
  }

  let targets = parseTargets(
    sTargets.split(',').filter((t) => t)
  ) as unknown as Array<NodeTarget & Partial<Target>>;

  if (!targets.length) {
    let jsonTargets;

    if (inputJson && inputJson.pkg) {
      jsonTargets = inputJson.pkg.targets;
    } else if (configJson && configJson.pkg) {
      jsonTargets = configJson.pkg.targets;
    }

    if (jsonTargets) {
      targets = parseTargets(jsonTargets);
    }
  }

  if (!targets.length) {
    if (!autoOutput) {
      targets = parseTargets(['host']);
      assert(targets.length === 1);
    } else {
      targets = parseTargets(['linux', 'macos', 'win']);
    }

    log.info(
      'Targets not specified. Assuming:',
      `${targets.map((t) => stringifyTarget(t)).join(', ')}`
    );
  }

  // differentParts

  const different = differentParts(targets);

  // targets[].output

  for (const target of targets) {
    let file;

    if (targets.length === 1) {
      file = output;
    } else {
      file = stringifyTargetForOutput(output, target, different);
    }

    if (target.platform === 'win' && path.extname(file) !== '.exe') {
      file += '.exe';
    }

    target.output = file;
  }

  // bakes

  const bakes = ((argv.options || '') as string)
    .split(',')
    .filter((bake) => bake)
    .map((bake) => `--${bake}`);

  // check if input is going
  // to be overwritten by output

  for (const target of targets) {
    if (target.output === inputFin) {
      if (autoOutput) {
        target.output += `-${target.platform}`;
      } else {
        throw wasReported('Refusing to overwrite input file', [inputFin]);
      }
    }
  }

  // fetch targets

  const { bytecode } = argv;

  const nativeBuild = argv['native-build'];

  for (const target of targets) {
    target.forceBuild = forceBuild;

    await needWithDryRun(target);

    target.fabricator = fabricatorForTarget(target) as Target;

    if (bytecode) {
      await needWithDryRun({
        ...target.fabricator,
        forceBuild,
      });
    }
  }

  if (dryRunResults.fetched && !dryRunResults.built) {
    log.info('Fetching base Node.js binaries to PKG_CACHE_PATH');
  }

  for (const target of targets) {
    target.binaryPath = await needViaCache(target);
    const f = target.fabricator;

    if (f && bytecode) {
      f.binaryPath = await needViaCache(f as NodeTarget);

      if (f.platform === 'macos') {
        // ad-hoc sign the base binary temporarily to generate bytecode
        // due to the new mandatory signing requirement
        const signedBinaryPath = `${f.binaryPath}-signed`;
        await remove(signedBinaryPath);
        copyFileSync(f.binaryPath, signedBinaryPath);
        try {
          signMachOExecutable(signedBinaryPath);
        } catch {
          throw wasReported('Cannot generate bytecode', [
            'pkg fails to run "codesign" utility. Due to the mandatory signing',
            'requirement of macOS, executables must be signed. Please ensure the',
            'utility is installed and properly configured.',
          ]);
        }
        f.binaryPath = signedBinaryPath;
      }

      if (f.platform !== 'win') {
        await plusx(f.binaryPath);
      }
    }
  }

  // marker

  let marker: Marker;

  if (configJson) {
    marker = {
      config: configJson,
      base: path.dirname(config),
      configPath: config,
    };
  } else {
    marker = {
      config: inputJson || {}, // not `inputBin` because only `input`
      base: path.dirname(input), // is the place for `inputJson`
      configPath: input,
    };
  }

  marker.toplevel = true;

  // public

  const params: WalkerParams = {};

  if (argv.public) {
    params.publicToplevel = true;
  }

  if (argv['public-packages']) {
    params.publicPackages = argv['public-packages'].split(',');

    if (params.publicPackages?.indexOf('*') !== -1) {
      params.publicPackages = ['*'];
    }
  }

  if (argv['no-dict']) {
    params.noDictionary = argv['no-dict'].split(',');

    if (params.noDictionary?.indexOf('*') !== -1) {
      params.noDictionary = ['*'];
    }
  }

  // records

  let records;
  let entrypoint = inputFin;
  let symLinks: SymLinks;
  const addition = isConfiguration(input) ? input : undefined;

  const walkResult = await walk(marker, entrypoint, addition, params);
  entrypoint = walkResult.entrypoint;

  records = walkResult.records;
  symLinks = walkResult.symLinks;

  const refineResult = refine(records, entrypoint, symLinks);
  entrypoint = refineResult.entrypoint;
  records = refineResult.records;
  symLinks = refineResult.symLinks;

  const backpack = packer({ records, entrypoint, bytecode, symLinks });

  log.debug('Targets:', JSON.stringify(targets, null, 2));

  for (const target of targets) {
    if (target.output && existsSync(target.output)) {
      if ((await stat(target.output)).isFile()) {
        await remove(target.output);
      } else {
        throw wasReported('Refusing to overwrite non-file output', [
          target.output,
        ]);
      }
    } else if (target.output) {
      await mkdirp(path.dirname(target.output));
    }

    await producer({
      backpack,
      bakes,
      slash: target.platform === 'win' ? '\\' : '/',
      target: target as Target,
      symLinks,
      doCompress,
      nativeBuild,
    });

    if (target.platform !== 'win' && target.output) {
      if (argv.signature && target.platform === 'macos') {
        // patch executable to allow code signing
        const buf = patchMachOExecutable(readFileSync(target.output));
        writeFileSync(target.output, buf);

        try {
          // sign executable ad-hoc to workaround the new mandatory signing requirement
          // users can always replace the signature if necessary
          signMachOExecutable(target.output);
        } catch {
          if (target.arch === 'arm64') {
            log.warn('Unable to sign the macOS executable', [
              'Due to the mandatory code signing requirement, before the',
              'executable is distributed to end users, it must be signed.',
              'Otherwise, it will be immediately killed by kernel on launch.',
              'An ad-hoc signature is sufficient.',
              'To do that, run pkg on a Mac, or transfer the executable to a Mac',
              'and run "codesign --sign - <executable>", or (if you use Linux)',
              'install "ldid" utility to PATH and then run pkg again',
            ]);
          }
        }
      }

      await plusx(target.output);
    }
  }

  shutdown();
}


================================================
FILE: lib/log.js
================================================
export { log, wasReported } from 'pkg-fetch/lib-es5/log';


================================================
FILE: lib/mach-o.ts
================================================
import { execFileSync } from 'child_process';

function parseCStr(buf: Buffer) {
  for (let i = 0; i < buf.length; i += 1) {
    if (buf[i] === 0) {
      return buf.slice(0, i).toString();
    }
  }
}

function patchCommand(type: number, buf: Buffer, file: Buffer) {
  // segment_64
  if (type === 0x19) {
    const name = parseCStr(buf.slice(0, 16));

    if (name === '__LINKEDIT') {
      const fileoff = buf.readBigUInt64LE(32);
      const vmsizePatched = BigInt(file.length) - fileoff;
      const filesizePatched = vmsizePatched;

      buf.writeBigUInt64LE(vmsizePatched, 24);
      buf.writeBigUInt64LE(filesizePatched, 40);
    }
  }

  // symtab
  if (type === 0x2) {
    const stroff = buf.readUInt32LE(8);
    const strsizePatched = file.length - stroff;

    buf.writeUInt32LE(strsizePatched, 12);
  }
}

function patchMachOExecutable(file: Buffer) {
  const align = 8;
  const hsize = 32;

  const ncmds = file.readUInt32LE(16);
  const buf = file.slice(hsize);

  for (let offset = 0, i = 0; i < ncmds; i += 1) {
    const type = buf.readUInt32LE(offset);

    offset += 4;
    const size = buf.readUInt32LE(offset) - 8;

    offset += 4;
    patchCommand(type, buf.slice(offset, offset + size), file);

    offset += size;
    if (offset & align) {
      offset += align - (offset & align);
    }
  }

  return file;
}

function signMachOExecutable(executable: string) {
  try {
    execFileSync('codesign', ['-f', '--sign', '-', executable], {
      stdio: 'inherit',
    });
  } catch {
    execFileSync('ldid', ['-Cadhoc', '-S', executable], { stdio: 'inherit' });
  }
}

export { patchMachOExecutable, signMachOExecutable };


================================================
FILE: lib/packer.ts
================================================
/* eslint-disable complexity */

import assert from 'assert';
import fs from 'fs-extra';
import path from 'path';

import {
  STORE_BLOB,
  STORE_CONTENT,
  STORE_LINKS,
  STORE_STAT,
  isDotJS,
  isDotJSON,
} from './common';

import { log, wasReported } from './log';
import { FileRecord, FileRecords, SymLinks } from './types';

const { version } = JSON.parse(
  fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8')
);

const bootstrapText = fs
  .readFileSync(require.resolve('../prelude/bootstrap.js'), 'utf8')
  .replace('%VERSION%', version);

const commonText = fs.readFileSync(require.resolve('./common'), 'utf8');

const diagnosticText = fs.readFileSync(
  require.resolve('../prelude/diagnostic.js'),
  'utf8'
);

function itemsToText<T extends unknown>(items: T[]) {
  const len = items.length;
  return len.toString() + (len % 10 === 1 ? ' item' : ' items');
}

function hasAnyStore(record: FileRecord) {
  // discarded records like native addons
  for (const store of [STORE_BLOB, STORE_CONTENT, STORE_LINKS, STORE_STAT]) {
    if (record[store]) return true;
  }
  return false;
}

interface PackerOptions {
  records: FileRecords;
  entrypoint: string;
  bytecode: boolean;
  symLinks: SymLinks;
}

export interface Stripe {
  snap: string;
  skip?: boolean;
  store: number;
  file?: string;
  buffer?: Buffer;
}

export default function packer({
  records,
  entrypoint,
  bytecode,
}: PackerOptions) {
  const stripes: Stripe[] = [];

  for (const snap in records) {
    if (records[snap]) {
      const record = records[snap];
      const { file } = record;

      if (!hasAnyStore(record)) {
        continue;
      }

      assert(record[STORE_STAT], 'packer: no STORE_STAT');
      assert(
        record[STORE_BLOB] ||
          record[STORE_CONTENT] ||
          record[STORE_LINKS] ||
          record[STORE_STAT]
      );

      if (record[STORE_BLOB] && !bytecode) {
        delete record[STORE_BLOB];
        if (!record[STORE_CONTENT]) {
          // TODO make a test for it?
          throw wasReported(
            '--no-bytecode and no source breaks final executable',
            [
              file,
              'Please run with "-d" and without "--no-bytecode" first, and make',
              'sure that debug log does not contain "was included as bytecode".',
            ]
          );
        }
      }
      for (const store of [
        STORE_BLOB,
        STORE_CONTENT,
        STORE_LINKS,
        STORE_STAT,
      ]) {
        const value = record[store];

        if (!value) {
          continue;
        }

        if (store === STORE_BLOB || store === STORE_CONTENT) {
          if (record.body === undefined) {
            stripes.push({ snap, store, file });
          } else if (Buffer.isBuffer(record.body)) {
            stripes.push({ snap, store, buffer: record.body });
          } else if (typeof record.body === 'string') {
            stripes.push({ snap, store, buffer: Buffer.from(record.body) });
          } else {
            assert(false, 'packer: bad STORE_BLOB/STORE_CONTENT');
          }
        } else if (store === STORE_LINKS) {
          if (Array.isArray(value)) {
            const dedupedValue = [...new Set(value)];
            log.debug('files & folders deduped = ', dedupedValue);
            const buffer = Buffer.from(JSON.stringify(dedupedValue));
            stripes.push({ snap, store, buffer });
          } else {
            assert(false, 'packer: bad STORE_LINKS');
          }
        } else if (store === STORE_STAT) {
          if (typeof value === 'object') {
            const newStat = { ...value };
            const buffer = Buffer.from(JSON.stringify(newStat));
            stripes.push({ snap, store, buffer });
          } else {
            assert(false, 'packer: unknown store');
          }
        }

        if (record[STORE_CONTENT]) {
          const disclosed = isDotJS(file) || isDotJSON(file);
          log.debug(
            disclosed
              ? 'The file was included as DISCLOSED code (with sources)'
              : 'The file was included as asset content',
            file
          );
        } else if (record[STORE_BLOB]) {
          log.debug('The file was included as bytecode (no sources)', file);
        } else if (record[STORE_LINKS]) {
          const link = record[STORE_LINKS];
          log.debug(
            `The directory files list was included (${itemsToText(link)})`,
            file
          );
        }
      }
    }
  }
  const prelude =
    `return (function (REQUIRE_COMMON, VIRTUAL_FILESYSTEM, DEFAULT_ENTRYPOINT, SYMLINKS, DICT, DOCOMPRESS) {
        ${bootstrapText}${
      log.debugMode ? diagnosticText : ''
    }\n})(function (exports) {\n${commonText}\n},\n` +
    `%VIRTUAL_FILESYSTEM%` +
    `\n,\n` +
    `%DEFAULT_ENTRYPOINT%` +
    `\n,\n` +
    `%SYMLINKS%` +
    '\n,\n' +
    '%DICT%' +
    '\n,\n' +
    '%DOCOMPRESS%' +
    `\n);`;

  return { prelude, entrypoint, stripes };
}


================================================
FILE: lib/producer.ts
================================================
import { createBrotliCompress, createGzip } from 'zlib';
import Multistream from 'multistream';
import assert from 'assert';
import { execFileSync } from 'child_process';
import fs from 'fs-extra';
import intoStream from 'into-stream';
import path from 'path';
import streamMeter from 'stream-meter';
import { Readable } from 'stream';

import { STORE_BLOB, STORE_CONTENT, isDotNODE, snapshotify } from './common';
import { log, wasReported } from './log';
import { fabricateTwice } from './fabricator';
import { platform, SymLinks, Target } from './types';
import { Stripe } from './packer';
import { CompressType } from './compress_type';

interface NotFound {
  notFound: true;
}

interface Placeholder {
  position: number;
  size: number;
  padder: string;
}

type PlaceholderTypes =
  | 'BAKERY'
  | 'PAYLOAD_POSITION'
  | 'PAYLOAD_SIZE'
  | 'PRELUDE_POSITION'
  | 'PRELUDE_SIZE';
type PlaceholderMap = Record<PlaceholderTypes, Placeholder | NotFound>;

function discoverPlaceholder(
  binaryBuffer: Buffer,
  searchString: string,
  padder: string
): Placeholder | NotFound {
  const placeholder = Buffer.from(searchString);
  const position = binaryBuffer.indexOf(placeholder);

  if (position === -1) {
    return { notFound: true };
  }

  return { position, size: placeholder.length, padder };
}

function injectPlaceholder(
  fd: number,
  placeholder: Placeholder | NotFound,
  value: string | number | Buffer,
  cb: (
    err: NodeJS.ErrnoException | null,
    written: number,
    buffer: Buffer
  ) => void
) {
  if ('notFound' in placeholder) {
    assert(false, 'Placeholder for not found');
  }

  const { position, size, padder } = placeholder;
  let stringValue: Buffer = Buffer.from('');

  if (typeof value === 'number') {
    stringValue = Buffer.from(value.toString());
  } else if (typeof value === 'string') {
    stringValue = Buffer.from(value);
  } else {
    stringValue = value;
  }

  const padding = Buffer.from(padder.repeat(size - stringValue.length));

  stringValue = Buffer.concat([stringValue, padding]);
  fs.write(fd, stringValue, 0, stringValue.length, position, cb);
}

function discoverPlaceholders(binaryBuffer: Buffer) {
  return {
    BAKERY: discoverPlaceholder(
      binaryBuffer,
      `\0${'// BAKERY '.repeat(20)}`,
      '\0'
    ),
    PAYLOAD_POSITION: discoverPlaceholder(
      binaryBuffer,
      '// PAYLOAD_POSITION //',
      ' '
    ),
    PAYLOAD_SIZE: discoverPlaceholder(binaryBuffer, '// PAYLOAD_SIZE //', ' '),
    PRELUDE_POSITION: discoverPlaceholder(
      binaryBuffer,
      '// PRELUDE_POSITION //',
      ' '
    ),
    PRELUDE_SIZE: discoverPlaceholder(binaryBuffer, '// PRELUDE_SIZE //', ' '),
  };
}

function injectPlaceholders(
  fd: number,
  placeholders: PlaceholderMap,
  values: Record<PlaceholderTypes, number | string | Buffer>,
  cb: (error?: Error | null) => void
) {
  injectPlaceholder(fd, placeholders.BAKERY, values.BAKERY, (error) => {
    if (error) {
      return cb(error);
    }

    injectPlaceholder(
      fd,
      placeholders.PAYLOAD_POSITION,
      values.PAYLOAD_POSITION,
      (error2) => {
        if (error2) {
          return cb(error2);
        }

        injectPlaceholder(
          fd,
          placeholders.PAYLOAD_SIZE,
          values.PAYLOAD_SIZE,
          (error3) => {
            if (error3) {
              return cb(error3);
            }

            injectPlaceholder(
              fd,
              placeholders.PRELUDE_POSITION,
              values.PRELUDE_POSITION,
              (error4) => {
                if (error4) {
                  return cb(error4);
                }

                injectPlaceholder(
                  fd,
                  placeholders.PRELUDE_SIZE,
                  values.PRELUDE_SIZE,
                  cb
                );
              }
            );
          }
        );
      }
    );
  });
}

function makeBakeryValueFromBakes(bakes: string[]) {
  const parts = [];

  if (bakes.length) {
    for (let i = 0; i < bakes.length; i += 1) {
      parts.push(Buffer.from(bakes[i]));
      parts.push(Buffer.alloc(1));
    }

    parts.push(Buffer.alloc(1));
  }

  return Buffer.concat(parts);
}

function replaceDollarWise(s: string, sf: string, st: string) {
  return s.replace(sf, () => st);
}

function makePreludeBufferFromPrelude(prelude: string) {
  return Buffer.from(
    `(function(process, require, console, EXECPATH_FD, PAYLOAD_POSITION, PAYLOAD_SIZE) { ${prelude}\n})` // dont remove \n
  );
}

function findPackageJson(nodeFile: string) {
  let dir = nodeFile;

  while (dir !== '/') {
    dir = path.dirname(dir);

    if (fs.existsSync(path.join(dir, 'package.json'))) {
      break;
    }
  }

  if (dir === '/') {
    throw new Error(`package.json not found for "${nodeFile}"`);
  }

  return dir;
}

function nativePrebuildInstall(target: Target, nodeFile: string) {
  const prebuildInstall = path.join(
    __dirname,
    '../node_modules/.bin/prebuild-install'
  );
  const dir = findPackageJson(nodeFile);
  // parse the target node version from the binaryPath
  const nodeVersion = path.basename(target.binaryPath).split('-')[1];

  if (!/^v[0-9]+\.[0-9]+\.[0-9]+$/.test(nodeVersion)) {
    throw new Error(`Couldn't find node version, instead got: ${nodeVersion}`);
  }

  const nativeFile = `${nodeFile}.${target.platform}.${nodeVersion}`;

  if (fs.existsSync(nativeFile)) {
    return nativeFile;
  }

  // prebuild-install will overwrite the target .node file, so take a backup
  if (!fs.existsSync(`${nodeFile}.bak`)) {
    fs.copyFileSync(nodeFile, `${nodeFile}.bak`);
  }

  const napiVersions = JSON.parse(
    fs.readFileSync(path.join(dir, 'package.json'), { encoding: 'utf-8' })
  )?.binary?.napi_versions;

  const options = [
    '--platform',
    platform[target.platform],
    '--arch',
    target.arch,
  ];

  if (napiVersions == null) {
    // TODO: consider target node version and supported n-api version
    options.push('--target', nodeVersion);
  }

  // run prebuild
  execFileSync(prebuildInstall, options, { cwd: dir });

  // move the prebuild to a new name with a platform/version extension
  fs.copyFileSync(nodeFile, nativeFile);

  // put the backed up file back
  fs.moveSync(`${nodeFile}.bak`, nodeFile, { overwrite: true });

  return nativeFile;
}

interface ProducerOptions {
  backpack: { entrypoint: string; stripes: Stripe[]; prelude: string };
  bakes: string[];
  slash: string;
  target: Target;
  symLinks: SymLinks;
  doCompress: CompressType;
  nativeBuild: boolean;
}

/**
 * instead of creating a vfs dicionnary with actual path as key
 * we use a compression mechanism that can reduce significantly
 * the memory footprint of the vfs in the code.
 *
 * without vfs compression:
 *
 * vfs = {
 *   "/folder1/folder2/file1.js": {};
 *   "/folder1/folder2/folder3/file2.js": {};
 *   "/folder1/folder2/folder3/file3.js": {};
 * }
 *
 * with compression :
 *
 * fileDictionary = {
 *    "folder1": "1",
 *    "folder2": "2",
 *    "file1": "3",
 *    "folder3": "4",
 *    "file2": "5",
 *    "file3": "6",
 * }
 * vfs = {
 *   "/1/2/3": {};
 *   "/1/2/4/5": {};
 *   "/1/2/4/6": {};
 * }
 *
 * note: the key is computed in base36 for further compression.
 */
const fileDictionary: { [key: string]: string } = {};
let counter = 0;
function getOrCreateHash(fileOrFolderName: string) {
  let existingKey = fileDictionary[fileOrFolderName];
  if (!existingKey) {
    const newkey = counter;
    counter += 1;
    existingKey = newkey.toString(36);
    fileDictionary[fileOrFolderName] = existingKey;
  }
  return existingKey;
}
const separator = '/';

function makeKey(
  doCompression: CompressType,
  fullpath: string,
  slash: string
): string {
  if (doCompression === CompressType.None) return fullpath;
  return fullpath.split(slash).map(getOrCreateHash).join(separator);
}

export default function producer({
  backpack,
  bakes,
  slash,
  target,
  symLinks,
  doCompress,
  nativeBuild,
}: ProducerOptions) {
  return new Promise<void>((resolve, reject) => {
    if (!Buffer.alloc) {
      throw wasReported(
        'Your node.js does not have Buffer.alloc. Please upgrade!'
      );
    }

    const { prelude } = backpack;
    let { entrypoint, stripes } = backpack;
    entrypoint = snapshotify(entrypoint, slash);
    stripes = stripes.slice();

    const vfs: Record<string, Record<string, [number, number]>> = {};

    for (const stripe of stripes) {
      let { snap } = stripe;
      snap = snapshotify(snap, slash);
      const vfsKey = makeKey(doCompress, snap, slash);
      if (!vfs[vfsKey]) vfs[vfsKey] = {};
    }

    const snapshotSymLinks: SymLinks = {};

    for (const [key, value] of Object.entries(symLinks)) {
      const k = snapshotify(key, slash);
      const v = snapshotify(value, slash);
      const vfsKey = makeKey(doCompress, k, slash);
      snapshotSymLinks[vfsKey] = makeKey(doCompress, v, slash);
    }

    let meter: streamMeter.StreamMeter;
    let count = 0;

    function pipeToNewMeter(s: Readable) {
      meter = streamMeter();
      return s.pipe(meter);
    }
    function pipeMayCompressToNewMeter(s: Readable): streamMeter.StreamMeter {
      if (doCompress === CompressType.GZip) {
        return pipeToNewMeter(s.pipe(createGzip()));
      }
      if (doCompress === CompressType.Brotli) {
        return pipeToNewMeter(s.pipe(createBrotliCompress()));
      }
      return pipeToNewMeter(s);
    }

    function next(s: Readable) {
      count += 1;
      return pipeToNewMeter(s);
    }

    const binaryBuffer = fs.readFileSync(target.binaryPath);
    const placeholders = discoverPlaceholders(binaryBuffer);

    let track = 0;
    let prevStripe: Stripe;

    let payloadPosition: number;
    let payloadSize: number;
    let preludePosition: number;
    let preludeSize: number;

    new Multistream((cb) => {
      if (count === 0) {
        return cb(null, next(intoStream(binaryBuffer)));
      }

      if (count === 1) {
        payloadPosition = meter.bytes;
        return cb(null, next(intoStream(Buffer.alloc(0))));
      }

      if (count === 2) {
        if (prevStripe && !prevStripe.skip) {
          const { store } = prevStripe;
          let { snap } = prevStripe;
          snap = snapshotify(snap, slash);
          const vfsKey = makeKey(doCompress, snap, slash);
          vfs[vfsKey][store] = [track, meter.bytes];
          track += meter.bytes;
        }

        if (stripes.length) {
          // clone to prevent 'skip' propagate
          // to other targets, since same stripe
          // is used for several targets
          const stripe = { ...(stripes.shift() as Stripe) };
          prevStripe = stripe;

          if (stripe.buffer) {
            if (stripe.store === STORE_BLOB) {
              const snap = snapshotify(stripe.snap, slash);
              return fabricateTwice(
                bakes,
                target.fabricator,
                snap,
                stripe.buffer,
                (error, buffer) => {
                  if (error) {
                    log.warn(error.message);
                    stripe.skip = true;
                    return cb(null, intoStream(Buffer.alloc(0)));
                  }

                  cb(
                    null,
                    pipeMayCompressToNewMeter(
                      intoStream(buffer || Buffer.from(''))
                    )
                  );
                }
              );
            }
            return cb(
              null,
              pipeMayCompressToNewMeter(intoStream(stripe.buffer))
            );
          }

          if (stripe.file) {
            if (stripe.file === target.output) {
              return cb(
                wasReported(
                  'Trying to take executable into executable',
                  stripe.file
                ),
                null
              );
            }

            assert.strictEqual(stripe.store, STORE_CONTENT); // others must be buffers from walker

            if (isDotNODE(stripe.file) && nativeBuild) {
              try {
                const platformFile = nativePrebuildInstall(target, stripe.file);

                if (fs.existsSync(platformFile)) {
                  return cb(
                    null,
                    pipeMayCompressToNewMeter(fs.createReadStream(platformFile))
                  );
                }
              } catch (err) {
                log.debug(
                  `prebuild-install failed[${stripe.file}]:`,
                  (err as Error).message
                );
              }
            }
            return cb(
              null,
              pipeMayCompressToNewMeter(fs.createReadStream(stripe.file))
            );
          }

          assert(false, 'producer: bad stripe');
        } else {
          payloadSize = track;
          preludePosition = payloadPosition + payloadSize;
          return cb(
            null,
            next(
              intoStream(
                makePreludeBufferFromPrelude(
                  replaceDollarWise(
                    replaceDollarWise(
                      replaceDollarWise(
                        replaceDollarWise(
                          replaceDollarWise(
                            prelude,
                            '%VIRTUAL_FILESYSTEM%',
                            JSON.stringify(vfs)
                          ),
                          '%DEFAULT_ENTRYPOINT%',
                          JSON.stringify(entrypoint)
                        ),
                        '%SYMLINKS%',
                        JSON.stringify(snapshotSymLinks)
                      ),
                      '%DICT%',
                      JSON.stringify(fileDictionary)
                    ),
                    '%DOCOMPRESS%',
                    JSON.stringify(doCompress)
                  )
                )
              )
            )
          );
        }
      } else {
        return cb(null, null);
      }
    })
      .on('error', (error) => {
        reject(error);
      })
      .pipe(fs.createWriteStream(target.output))
      .on('error', (error) => {
        reject(error);
      })
      .on('close', () => {
        preludeSize = meter.bytes;
        fs.open(target.output, 'r+', (error, fd) => {
          if (error) return reject(error);
          injectPlaceholders(
            fd,
            placeholders,
            {
              BAKERY: makeBakeryValueFromBakes(bakes),
              PAYLOAD_POSITION: payloadPosition,
              PAYLOAD_SIZE: payloadSize,
              PRELUDE_POSITION: preludePosition,
              PRELUDE_SIZE: preludeSize,
            },
            (error2) => {
              if (error2) return reject(error2);
              fs.close(fd, (error3) => {
                if (error3) return reject(error3);
                resolve();
              });
            }
          );
        });
      });
  });
}


================================================
FILE: lib/refiner.ts
================================================
import path from 'path';
import chalk from 'chalk';
import {
  STORE_LINKS,
  retrieveDenominator,
  substituteDenominator,
} from './common';
import { FileRecords, SymLinks } from './types';
import { log } from './log';

const win32 = process.platform === 'win32';

function hasParent(file: string, records: FileRecords) {
  const dirname = path.dirname(file);

  // root directory
  if (dirname === file) {
    return false;
  }

  return Boolean(records[dirname]);
}

function purgeTopDirectories(records: FileRecords) {
  while (true) {
    let found = false;

    for (const file in records) {
      if (records[file]) {
        const record = records[file];
        const links = record[STORE_LINKS];

        if (links && links.length === 1) {
          if (!hasParent(file, records)) {
            const file2 = path.join(file, links[0]);
            const record2 = records[file2];
            const links2 = record2[STORE_LINKS];

            if (links2 && links2.length === 1) {
              const file3 = path.join(file2, links2[0]);
              const record3 = records[file3];
              const links3 = record3[STORE_LINKS];

              if (links3) {
                delete records[file];
                log.debug(chalk.cyan('Deleting record file :', file));
                found = true;
              }
            }
          }
        }
      }
    }

    if (!found) break;
  }
}

function denominate(
  records: FileRecords,
  entrypoint: string,
  denominator: number,
  symLinks: SymLinks
) {
  const newRecords: FileRecords = {};

  const makeSnap = (file: string) => {
    let snap = substituteDenominator(file, denominator);

    if (win32) {
      if (snap.slice(1) === ':') snap += '\\';
    } else if (snap === '') {
      snap = '/';
    }

    return snap;
  };

  for (const file in records) {
    if (records[file]) {
      const snap = makeSnap(file);
      newRecords[snap] = records[file];
    }
  }

  const tmpSymLinks = symLinks;
  symLinks = {};

  for (const [key, value] of Object.entries(tmpSymLinks)) {
    const key1 = makeSnap(key);
    const value1 = makeSnap(value);
    symLinks[key1] = value1;
  }

  return {
    records: newRecords,
    entrypoint: substituteDenominator(entrypoint, denominator),
    symLinks,
  };
}

export default function refiner(
  records: FileRecords,
  entrypoint: string,
  symLinks: SymLinks
) {
  purgeTopDirectories(records);
  const denominator = retrieveDenominator(Object.keys(records));
  return denominate(records, entrypoint, denominator, symLinks);
}


================================================
FILE: lib/types.ts
================================================
import type { log } from './log';

export interface FileRecord {
  file: string;
  body?: Buffer | string;
  // This could be improved a bit. making this stricter opens up a lot of
  // changes that need to be made throughout the code though
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  [key: number]: any;
}

export type FileRecords = Record<string, FileRecord>;

type License =
  | string
  | {
      type: string;
    };

export type Patches = Record<
  string,
  string & { do: 'erase' | 'prepend' | 'append' }[]
>;

export type ConfigDictionary = Record<
  string,
  {
    pkg?: {
      dependencies?: Record<string, string>;
    };
    dependencies?: Record<string, string>;
  }
>;

export interface PkgOptions {
  scripts?: string[];
  log?: (logger: typeof log, context: Record<string, string>) => void;
  assets?: string[];
  deployFiles?: string[];
  patches?: Patches;
  dictionary: ConfigDictionary;
}

export interface PackageJson {
  name?: string;
  private?: boolean;
  licenses?: License;
  license?: License;
  main?: string;
  dependencies?: Record<string, string>;
  files?: string[];
  pkg?: PkgOptions;
}

export const platform = {
  macos: 'darwin',
  win: 'win32',
  linux: 'linux',
};

export interface NodeTarget {
  nodeRange: string;
  arch: string;
  platform: keyof typeof platform;
  forceBuild?: boolean;
}

export interface Target extends NodeTarget {
  binaryPath: string;
  output: string;
  fabricator: Target;
}

export type SymLinks = Record<string, string>;


================================================
FILE: lib/walker.ts
================================================
/* eslint-disable require-atomic-updates */

import assert from 'assert';
import fs from 'fs-extra';
import isCore from 'is-core-module';
import globby from 'globby';
import path from 'path';
import chalk from 'chalk';

import {
  ALIAS_AS_RELATIVE,
  ALIAS_AS_RESOLVABLE,
  STORE_BLOB,
  STORE_CONTENT,
  STORE_LINKS,
  STORE_STAT,
  isDotJS,
  isDotJSON,
  isDotNODE,
  isPackageJson,
  normalizePath,
  toNormalizedRealPath,
} from './common';

import { follow } from './follow';
import { log, wasReported } from './log';
import * as detector from './detector';
import {
  ConfigDictionary,
  FileRecord,
  FileRecords,
  Patches,
  PackageJson,
  SymLinks,
} from './types';

export interface Marker {
  hasDictionary?: boolean;
  activated?: boolean;
  toplevel?: boolean;
  public?: boolean;
  hasDeployFiles?: boolean;
  config?: PackageJson;
  configPath: string;
  base: string;
}

interface Task {
  file: string;
  data?: unknown;
  reason?: string;
  marker?: Marker;
  store: number;
}

interface Derivative {
  alias: string;
  mayExclude?: boolean;
  mustExclude?: boolean;
  aliasType: number;
  fromDependencies?: boolean;
}

// Note: as a developer, you can set the PKG_STRICT_VER variable.
//       this will turn on some assertion in the walker code below
//       to assert that each file content/state that we appending
//       to the virtual file system applies to  a real file,
//       not a symlink.
//       By default assertion are disabled as they can have a
//       performance hit.
const strictVerify = Boolean(process.env.PKG_STRICT_VER);

const win32 = process.platform === 'win32';

function unlikelyJavascript(file: string) {
  return ['.css', '.html', '.json', '.vue'].includes(path.extname(file));
}

function isPublic(config: PackageJson) {
  if (config.private) {
    return false;
  }

  const { licenses } = config;
  let { license } = config;

  if (licenses) {
    license = licenses;
  }

  if (license && !Array.isArray(license)) {
    license = typeof license === 'string' ? license : license.type;
  }

  if (Array.isArray(license)) {
    license = license.map((c) => String(c.type || c)).join(',');
  }

  if (!license) {
    return false;
  }

  if (/^\(/.test(license)) {
    license = license.slice(1);
  }

  if (/\)$/.test(license)) {
    license = license.slice(0, -1);
  }

  license = license.toLowerCase();
  const allLicenses = Array.prototype.concat(
    license.split(' or '),
    license.split(' and '),
    license.split('/'),
    license.split(',')
  );
  let result = false;
  const foss = [
    'isc',
    'mit',
    'apache-2.0',
    'apache 2.0',
    'public domain',
    'bsd',
    'bsd-2-clause',
    'bsd-3-clause',
    'wtfpl',
    'cc-by-3.0',
    'x11',
    'artistic-2.0',
    'gplv3',
    'mpl',
    'mplv2.0',
    'unlicense',
    'apache license 2.0',
    'zlib',
    'mpl-2.0',
    'nasa-1.3',
    'apache license, version 2.0',
    'lgpl-2.1+',
    'cc0-1.0',
  ];

  for (const c of allLicenses) {
    result = foss.indexOf(c) >= 0;

    if (result) {
      break;
    }
  }

  return result;
}

function upon(p: string, base: string) {
  if (typeof p !== 'string') {
    throw wasReported('Config items must be strings. See examples');
  }

  let negate = false;

  if (p[0] === '!') {
    p = p.slice(1);
    negate = true;
  }

  p = path.join(base, p);

  if (win32) {
    p = p.replace(/\\/g, '/');
  }

  if (negate) {
    p = `!${p}`;
  }

  return p;
}

function collect(ps: string[]) {
  return globby.sync(ps, { dot: true });
}

function expandFiles(efs: string | string[], base: string) {
  if (!Array.isArray(efs)) {
    efs = [efs];
  }

  efs = collect(efs.map((p) => upon(p, base)));

  return efs;
}

async function stepRead(record: FileRecord) {
  if (strictVerify) {
    assert(record.file === toNormalizedRealPath(record.file));
  }

  let body;

  try {
    body = await fs.readFile(record.file);
  } catch (error) {
    const exception = error as NodeJS.ErrnoException;
    log.error(`Cannot read file, ${exception.code}`, record.file);
    throw wasReported(exception.message);
  }

  record.body = body;
}

function stepStrip(record: FileRecord) {
  let body = (record.body || '').toString('utf8');

  if (/^\ufeff/.test(body)) {
    body = body.replace(/^\ufeff/, '');
  }

  if (/^#!/.test(body)) {
    body = body.replace(/^#![^\n]*\n/, '\n');
  }

  record.body = body;
}

function stepDetect(
  record: FileRecord,
  marker: Marker,
  derivatives: Derivative[]
) {
  let { body = '' } = record;

  if (body instanceof Buffer) {
    body = body.toString();
  }

  try {
    detector.detect(body, (node, trying) => {
      const { toplevel } = marker;
      let d = detector.visitorSuccessful(node) as unknown as Derivative;

      if (d) {
        if (d.mustExclude) {
          return false;
        }

        d.mayExclude = d.mayExclude || trying;
        derivatives.push(d);

        return false;
      }

      d = detector.visitorNonLiteral(node) as unknown as Derivative;

      if (d) {
        if (typeof d === 'object' && d.mustExclude) {
          return false;
        }

        const debug = !toplevel || d.mayExclude || trying;
        const level = debug ? 'debug' : 'warn';
        log[level](`Cannot resolve '${d.alias}'`, [
          record.file,
          'Dynamic require may fail at run time, because the requested file',
          'is unknown at compilation time and not included into executable.',
          "Use a string literal as an argument for 'require', or leave it",
          "as is and specify the resolved file name in 'scripts' option.",
        ]);
        return false;
      }

      d = detector.visitorMalformed(node) as unknown as Derivative;

      if (d) {
        // there is no 'mustExclude'
        const debug = !toplevel || trying;
        const level = debug ? 'debug' : 'warn'; // there is no 'mayExclude'
        log[level](`Malformed requirement for '${d.alias}'`, [record.file]);
        return false;
      }

      d = detector.visitorUseSCWD(node) as unknown as Derivative;

      if (d) {
        // there is no 'mustExclude'
        const level = 'debug'; // there is no 'mayExclude'
        log[level](`Path.resolve(${d.alias}) is ambiguous`, [
          record.file,
          "It resolves relatively to 'process.cwd' by default, however",
          "you may want to use 'path.dirname(require.main.filename)'",
        ]);

        return false;
      }

      return true; // can i go inside?
    });
  } catch (error) {
    log.error((error as Error).message, record.file);
    throw wasReported((error as Error).message);
  }
}

function findCommonJunctionPoint(file: string, realFile: string) {
  // find common denominator => where the link changes
  while (toNormalizedRealPath(path.dirname(file)) === path.dirname(realFile)) {
    file = path.dirname(file);
    realFile = path.dirname(realFile);
  }

  return { file, realFile };
}

export interface WalkerParams {
  publicToplevel?: boolean;
  publicPackages?: string[];
  noDictionary?: string[];
}

class Walker {
  private params: WalkerParams;

  private symLinks: SymLinks;

  private patches: Patches;

  private tasks: Task[];

  private records: FileRecords;

  private dictionary: ConfigDictionary;

  constructor() {
    this.tasks = [];
    this.records = {};
    this.dictionary = {};
    this.patches = {};
    this.params = {};
    this.symLinks = {};
  }

  appendRecord({ file, store }: Task) {
    if (this.records[file]) {
      return;
    }

    if (
      store === STORE_BLOB ||
      store === STORE_CONTENT ||
      store === STORE_LINKS
    ) {
      // make sure we have a real file
      if (strictVerify) {
        assert(file === toNormalizedRealPath(file));
      }
    }

    this.records[file] = { file };
  }

  private append(task: Task) {
    if (strictVerify) {
      assert(typeof task.file === 'string');
      assert(task.file === normalizePath(task.file));
    }

    this.appendRecord(task);
    this.tasks.push(task);

    const what = {
      [STORE_BLOB]: 'Bytecode of',
      [STORE_CONTENT]: 'Content of',
      [STORE_LINKS]: 'Directory',
      [STORE_STAT]: 'Stat info of',
    }[task.store];

    if (task.reason) {
      log.debug(
        `${what} ${task.file} is added to queue. It was required from ${task.reason}`
      );
    } else {
      log.debug(`${what} ${task.file} is added to queue.`);
    }
  }

  appendSymlink(file: string, realFile: string) {
    const a = findCommonJunctionPoint(file, realFile);
    file = a.file;
    realFile = a.realFile;

    if (!this.symLinks[file]) {
      const dn = path.dirname(file);
      this.appendFileInFolder({
        file: dn,
        store: STORE_LINKS,
        data: path.basename(file),
      });

      log.debug(`adding symlink ${file}  => ${path.relative(file, realFile)}`);
      this.symLinks[file] = realFile;

      this.appendStat({
        file: realFile,
        store: STORE_STAT,
      });
      this.appendStat({
        file: dn,
        store: STORE_STAT,
      });
      this.appendStat({
        file,
        store: STORE_STAT,
      });
    }
  }

  appendStat(task: Task) {
    assert(task.store === STORE_STAT);
    this.append(task);
  }

  appendFileInFolder(task: Task) {
    if (strictVerify) {
      assert(task.store === STORE_LINKS);
      assert(typeof task.file === 'string');
    }
    const realFile = toNormalizedRealPath(task.file);
    if (realFile === task.file) {
      this.append(task);
      return;
    }
    this.append({ ...task, file: realFile });
    this.appendStat({
      file: task.file,
      store: STORE_STAT,
    });
    this.appendStat({
      file: path.dirname(task.file),
      store: STORE_STAT,
    });
  }

  appendBlobOrContent(task: Task) {
    if (strictVerify) {
      assert(task.file === normalizePath(task.file));
    }

    assert(task.store === STORE_BLOB || task.store === STORE_CONTENT);
    assert(typeof task.file === 'string');
    const realFile = toNormalizedRealPath(task.file);

    if (realFile === task.file) {
      this.append(task);
      return;
    }

    this.append({ ...task, file: realFile });
    this.appendSymlink(task.file, realFile);
    this.appendStat({
      file: task.file,
      store: STORE_STAT,
    });
  }

  async appendFilesFromConfig(marker: Marker) {
    const { config, configPath, base } = marker;
    const pkgConfig = config?.pkg;

    if (pkgConfig) {
      let { scripts } = pkgConfig;

      if (scripts) {
        scripts = expandFiles(scripts, base);

        for (const script of scripts) {
          const stat = await fs.stat(script);

          if (stat.isFile()) {
            if (!isDotJS(script) && !isDotJSON(script) && !isDotNODE(script)) {
              log.warn("Non-javascript file is specified in 'scripts'.", [
                'Pkg will probably fail to parse. Specify *.js in glob.',
                script,
              ]);
            }

            this.appendBlobOrContent({
              file: normalizePath(script),
              marker,
              store: STORE_BLOB,
              reason: configPath,
            });
          }
        }
      }

      let { assets } = pkgConfig;

      if (assets) {
        assets = expandFiles(assets, base);

        for (const asset of assets) {
          log.debug(' Adding asset : .... ', asset);
          const stat = await fs.stat(asset);

          if (stat.isFile()) {
            this.appendBlobOrContent({
              file: normalizePath(asset),
              marker,
              store: STORE_CONTENT,
              reason: configPath,
            });
          }
        }
      }
    } else if (config) {
      let { files } = config;

      if (files) {
        files = expandFiles(files, base);

        for (let file of files) {
          file = normalizePath(file);
          const stat = await fs.stat(file);

          if (stat.isFile()) {
            // 1) remove sources of top-level(!) package 'files' i.e. ship as BLOB
            // 2) non-source (non-js) files of top-level package are shipped as CONTENT
            // 3) parsing some js 'files' of non-top-level packages fails, hence all CONTENT
            if (marker.toplevel) {
              this.appendBlobOrContent({
                file,
                marker,
                store: isDotJS(file) ? STORE_BLOB : STORE_CONTENT,
                reason: configPath,
              });
            } else {
              this.appendBlobOrContent({
                file,
                marker,
                store: STORE_CONTENT,
                reason: configPath,
              });
            }
          }
        }
      }
    }
  }

  async stepActivate(marker: Marker, derivatives: Derivative[]) {
    if (!marker) {
      assert(false);
    }

    if (marker.activated) {
      return;
    }

    const { config, base } = marker;

    if (!config) {
      assert(false);
    }

    const { name } = config;

    if (name) {
      const d = this.dictionary[name];

      if (d) {
        if (
          typeof config.dependencies === 'object' &&
          typeof d.dependencies === 'object'
        ) {
          Object.assign(config.dependencies, d.dependencies);
          delete d.dependencies;
        }

        Object.assign(config, d);
        marker.hasDictionary = true;
      }
    }

    const { dependencies } = config;

    if (typeof dependencies === 'object') {
      for (const dependency in dependencies) {
        // it may be `undefined` - overridden
        // in dictionary (see publicsuffixlist)
        if (dependencies[dependency]) {
          derivatives.push({
            alias: dependency,
            aliasType: ALIAS_AS_RESOLVABLE,
            fromDependencies: true,
          });

          derivatives.push({
            alias: `${dependency}/package.json`,
            aliasType: ALIAS_AS_RESOLVABLE,
            fromDependencies: true,
          });
        }
      }
    }

    const pkgConfig = config.pkg;

    if (pkgConfig) {
      const { patches } = pkgConfig;

      if (patches) {
        for (const key in patches) {
          if (patches[key]) {
            const p = path.join(base, key);
            this.patches[p] = patches[key];
          }
        }
      }

      const { deployFiles } = pkgConfig;

      if (deployFiles) {
        marker.hasDeployFiles = true;

        for (const deployFile of deployFiles) {
          const type = deployFile[2] || 'file';
          log.warn(`Cannot include ${type} %1 into executable.`, [
            `The ${type} must be distributed with executable as %2.`,
            `%1: ${path.relative(
              process.cwd(),
              path.join(base, deployFile[0])
            )}`,
            `%2: path-to-executable/${deployFile[1]}`,
          ]);
        }
      }

      if (pkgConfig.log) {
        pkgConfig.log(log, { packagePath: base });
      }
    }

    await this.appendFilesFromConfig(marker);
    marker.public = isPublic(config);

    if (!marker.public && marker.toplevel) {
      marker.public = this.params.publicToplevel;
    }

    if (!marker.public && !marker.toplevel && this.params.publicPackages) {
      marker.public =
        this.params.publicPackages[0] === '*' ||
        (!!name && this.params.publicPackages.indexOf(name) !== -1);
    }

    marker.activated = true;
    // assert no further work with config
    delete marker.config;
  }

  hasPatch(record: FileRecord) {
    const patch = this.patches[record.file];

    if (!patch) {
      return;
    }

    return true;
  }

  stepPatch(record: FileRecord) {
    const patch = this.patches[record.file];

    if (!patch) {
      return;
    }

    let body = (record.body || '').toString('utf8');

    for (let i = 0; i < patch.length; i += 2) {
      if (typeof patch[i] === 'object') {
        if (patch[i].do === 'erase') {
          body = patch[i + 1];
        } else if (patch[i].do === 'prepend') {
          body = patch[i + 1] + body;
        } else if (patch[i].do === 'append') {
          body += patch[i + 1];
        }
      } else if (typeof patch[i] === 'string') {
        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
        // function escapeRegExp
        const esc = patch[i].replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
        const regexp = new RegExp(esc, 'g');
        body = body.replace(regexp, patch[i + 1]);
      }
    }

    record.body = body;
  }

  async stepDerivatives_ALIAS_AS_RELATIVE(
    record: FileRecord,
    marker: Marker,
    derivative: Derivative
  ) {
    const file = normalizePath(
      path.join(path.dirname(record.file), derivative.alias)
    );

    let stat;

    try {
      stat = await fs.stat(file);
    } catch (error) {
      const { toplevel } = marker;
      const exception = error as NodeJS.ErrnoException;
      const debug = !toplevel && exception.code === 'ENOENT';
      const level = debug ? 'debug' : 'warn';
      log[level](`Cannot stat, ${exception.code}`, [
        file,
        `The file was required from '${record.file}'`,
      ]);
    }

    if (stat && stat.isFile()) {
      this.appendBlobOrContent({
        file,
        marker,
        store: STORE_CONTENT,
        reason: record.file,
      });
    }
  }

  async stepDerivatives_ALIAS_AS_RESOLVABLE(
    record: FileRecord,
    marker: Marker,
    derivative: Derivative
  ) {
    const newPackages: { packageJson: string; marker?: Marker }[] = [];

    const catchReadFile = (file: string) => {
      assert(isPackageJson(file), `walker: ${file} must be package.json`);
      newPackages.push({ packageJson: file });
    };

    const catchPackageFilter = (config: PackageJson, base: string) => {
      const newPackage = newPackages[newPackages.length - 1];
      newPackage.marker = { config, configPath: newPackage.packageJson, base };
    };

    let newFile = '';
    let failure: Error | undefined;

    const basedir = path.dirname(record.file);
    try {
      newFile = await follow(derivative.alias, {
        basedir,
        // default is extensions: ['.js'], but
        // it is not enough because 'typos.json'
        // is not taken in require('./typos')
        // in 'normalize-package-data/lib/fixer.js'
        extensions: ['.js', '.json', '.node'],
        catchReadFile,
        catchPackageFilter,
      });
    } catch (error) {
      failure = error as Error;
    }

    if (failure) {
      const { toplevel } = marker;
      const mainNotFound =
        newPackages.length > 0 && !newPackages[0].marker?.config?.main;
      const debug =
        !toplevel ||
        derivative.mayExclude ||
        (mainNotFound && derivative.fromDependencies);
      const level = debug ? 'debug' : 'warn';

      if (mainNotFound) {
        const message = "Entry 'main' not found in %1";
        log[level](message, [
          `%1: ${newPackages[0].packageJson}`,
          `%2: ${record.file}`,
        ]);
      } else {
        log[level](`${chalk.yellow(failure.message)}  in ${record.file}`);
      }

      return;
    }

    let newPackageForNewRecords;

    for (const newPackage of newPackages) {
      let newFile2;

      try {
        newFile2 = await follow(derivative.alias, {
          basedir: path.dirname(record.file),
          extensions: ['.js', '.json', '.node'],
          ignoreFile: newPackage.packageJson,
        });
        if (strictVerify) {
          assert(newFile2 === normalizePath(newFile2));
        }
      } catch (_) {
        // not setting is enough
      }

      if (newFile2 !== newFile) {
        newPackageForNewRecords = newPackage;
        break;
      }
    }

    if (newPackageForNewRecords) {
      if (strictVerify) {
        assert(
          newPackageForNewRecords.packageJson ===
            normalizePath(newPackageForNewRecords.packageJson)
        );
      }
      this.appendBlobOrContent({
        file: newPackageForNewRecords.packageJson,
        marker: newPackageForNewRecords.marker,
        store: STORE_CONTENT,
        reason: record.file,
      });
    }

    this.appendBlobOrContent({
      file: newFile,
      marker: newPackageForNewRecords ? newPackageForNewRecords.marker : marker,
      store: STORE_BLOB,
      reason: record.file,
    });
  }

  async stepDerivatives(
    record: FileRecord,
    marker: Marker,
    derivatives: Derivative[]
  ) {
    for (const derivative of derivatives) {
      // TODO: actually use the target node version
      if (isCore(derivative.alias, '99.0.0')) continue;

      switch (derivative.aliasType) {
        case ALIAS_AS_RELATIVE:
          await this.stepDerivatives_ALIAS_AS_RELATIVE(
            record,
            marker,
            derivative
          );
          break;
        case ALIAS_AS_RESOLVABLE:
          await this.stepDerivatives_ALIAS_AS_RESOLVABLE(
            record,
            marker,
            derivative
          );
          break;
        default:
          assert(false, `walker: unknown aliasType ${derivative.aliasType}`);
      }
    }
  }

  async step_STORE_ANY(record: FileRecord, marker: Marker, store: number) {
    if (strictVerify) {
      assert(record.file === toNormalizedRealPath(record.file));
    }
    if (record[store] !== undefined) return;
    record[store] = false; // default is discard

    this.appendStat({
      file: record.file,
      store: STORE_STAT,
    });

    const derivatives1: Derivative[] = [];
    await this.stepActivate(marker, derivatives1);
    await this.stepDerivatives(record, marker, derivatives1);

    if (store === STORE_BLOB) {
      if (unlikelyJavascript(record.file) || isDotNODE(record.file)) {
        this.appendBlobOrContent({
          file: record.file,
          marker,
          store: STORE_CONTENT,
        });
        return; // discard
      }

      if (marker.public || marker.hasDictionary) {
        this.appendBlobOrContent({
          file: record.file,
          marker,
          store: STORE_CONTENT,
        });
      }
    }

    if (store === STORE_BLOB || this.hasPatch(record)) {
      if (!record.body) {
        await stepRead(record);
        this.stepPatch(record);

        if (store === STORE_BLOB) {
          stepStrip(record);
        }
      }

      if (store === STORE_BLOB) {
        const derivatives2: Derivative[] = [];
        stepDetect(record, marker, derivatives2);
        await this.stepDerivatives(record, marker, derivatives2);
      }
    }

    record[store] = true;
  }

  step_STORE_LINKS(record: FileRecord, data: unknown) {
    if (strictVerify) {
      assert(
        record.file === toNormalizedRealPath(record.file),
        ' expecting real file !!!'
      );
    }

    if (record[STORE_LINKS]) {
      record[STORE_LINKS].push(data);
      return;
    }

    record[STORE_LINKS] = [data];

    if (record[STORE_STAT]) {
      return;
    }
    this.appendStat({
      file: record.file,
      store: STORE_STAT,
    });
  }

  async step_STORE_STAT(record: FileRecord) {
    if (record[STORE_STAT]) return;

    const realPath = toNormalizedRealPath(record.file);
    if (realPath !== record.file) {
      this.appendStat({
        file: realPath,
        store: STORE_STAT,
      });
    }

    try {
      const valueStat = await fs.stat(record.file);

      const value = {
        mode: valueStat.mode,
        size: valueStat.isFile() ? valueStat.size : 0,
        isFileValue: valueStat.isFile(),
        isDirectoryValue: valueStat.isDirectory(),
        isSocketValue: valueStat.isSocket(),
        isSymbolicLinkValue: valueStat.isSymbolicLink(),
      };
      record[STORE_STAT] = value;
    } catch (error) {
      const exception = error as NodeJS.ErrnoException;
      log.error(`Cannot stat, ${exception.code}`, record.file);
      throw wasReported(exception.message);
    }

    if (path.dirname(record.file) !== record.file) {
      // root directory
      this.appendFileInFolder({
        file: path.dirname(record.file),
        store: STORE_LINKS,
        data: path.basename(record.file),
      });
    }
  }

  async step(task: Task) {
    const { file, store, data } = task;
    const record = this.records[file];

    switch (store) {
      case STORE_BLOB:
      case STORE_CONTENT:
        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
        await this.step_STORE_ANY(record, task.marker!, store);
        break;
      case STORE_LINKS:
        this.step_STORE_LINKS(record, data);
        break;
      case STORE_STAT:
        await this.step_STORE_STAT(record);
        break;
      default:
        assert(false, `walker: unknown store ${store}`);
    }
  }

  async readDictionary(marker: Marker) {
    if (this.params.noDictionary?.[0] === '*') {
      return;
    }
    const dd = path.join(__dirname, '../dictionary');
    const files = await fs.readdir(dd);

    for (const file of files) {
      if (/\.js$/.test(file)) {
        const name = file.slice(0, -3);

        if (this.params.noDictionary?.includes(file)) {
          continue;
        }
        // eslint-disable-next-line import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires
        const config = require(path.join(dd, file));
        this.dictionary[name] = config;
      }
    }

    const pkgConfig = marker.config?.pkg;

    if (pkgConfig) {
      const { dictionary } = pkgConfig;

      if (dictionary) {
        for (const name in dictionary) {
          if (dictionary[name]) {
            this.dictionary[name] = { pkg: dictionary[name] };
          }
        }
      }
    }
  }

  async start(
    marker: Marker,
    entrypoint: string,
    addition: string | undefined,
    params: WalkerParams
  ) {
    this.params = params;
    this.symLinks = {};

    await this.readDictionary(marker);

    entrypoint = normalizePath(entrypoint);

    this.appendBlobOrContent({
      file: entrypoint,
      marker,
      store: STORE_BLOB,
    });

    if (addition) {
      addition = normalizePath(addition);
      this.appendBlobOrContent({
        file: addition,
        marker,
        store: STORE_CONTENT,
      });
    }

    const { tasks } = this;

    for (let i = 0; i < tasks.length; i += 1) {
      // NO MULTIPLE WORKERS! THIS WILL LEAD TO NON-DETERMINISTIC
      // ORDER. one-by-one fifo is the only way to iterate tasks
      await this.step(tasks[i]);
    }

    return {
      symLinks: this.symLinks,
      records: this.records,
      entrypoint: normalizePath(entrypoint),
    };
  }
}

export default async function walker(...args: Parameters<Walker['start']>) {
  const w = new Walker();
  return w.start(...args);
}


================================================
FILE: package.json
================================================
{
  "name": "pkg",
  "version": "5.8.1",
  "description": "Package your Node.js project into an executable",
  "main": "lib-es5/index.js",
  "license": "MIT",
  "repository": "vercel/pkg",
  "types": "lib-es5/index.d.ts",
  "bin": {
    "pkg": "lib-es5/bin.js"
  },
  "files": [
    "lib-es5/*.js",
    "lib-es5/index.d.ts",
    "dictionary/*.js",
    "prelude/*.js"
  ],
  "prettier": {
    "singleQuote": true
  },
  "dependencies": {
    "@babel/generator": "7.18.2",
    "@babel/parser": "7.18.4",
    "@babel/types": "7.19.0",
    "chalk": "^4.1.2",
    "fs-extra": "^9.1.0",
    "globby": "^11.1.0",
    "into-stream": "^6.0.0",
    "is-core-module": "2.9.0",
    "minimist": "^1.2.6",
    "multistream": "^4.1.0",
    "pkg-fetch": "3.5.2",
    "prebuild-install": "7.1.1",
    "resolve": "^1.22.0",
    "stream-meter": "^1.0.4"
  },
  "devDependencies": {
    "@babel/core": "7.18.2",
    "@types/babel__generator": "7.6.4",
    "@types/fs-extra": "9.0.13",
    "@types/is-core-module": "2.2.0",
    "@types/minimist": "1.2.2",
    "@types/multistream": "4.1.0",
    "@types/node": "14.18.20",
    "@types/resolve": "1.20.2",
    "@types/stream-meter": "0.0.22",
    "@typescript-eslint/eslint-plugin": "4.33.0",
    "@typescript-eslint/parser": "4.33.0",
    "eslint": "7.32.0",
    "eslint-config-airbnb-base": "14.2.1",
    "eslint-config-airbnb-typescript": "12.3.1",
    "eslint-config-prettier": "8.5.0",
    "eslint-plugin-import": "2.26.0",
    "json-stable-stringify": "^1.0.1",
    "lint-staged": "^10.5.4",
    "mkdirp": "^1.0.4",
    "prettier": "2.6.2",
    "rimraf": "^3.0.2",
    "simple-git-hooks": ">=2.8.0",
    "typescript": "4.7.2"
  },
  "scripts": {
    "clean": "rimraf lib-es5",
    "build": "npm run clean && tsc",
    "start": "tsc --watch",
    "lint": "npm run lint:style && npm run lint:code",
    "lint:style": "prettier -c \"{lib,prelude,test}/**/*.{ts,js}\"",
    "lint:code": "eslint lib prelude test",
    "fix": "npm run lint:style -- -w && npm run lint:code -- --fix",
    "prepare": "npm run build",
    "prepublishOnly": "npm run lint",
    "test": "npm run build && npm run test:18 && npm run test:16 && npm run test:14 && npm run test:host",
    "test:18": "node test/test.js node18 no-npm",
    "test:16": "node test/test.js node16 no-npm",
    "test:14": "node test/test.js node14 no-npm",
    "test:host": "node test/test.js host only-npm"
  },
  "simple-git-hooks": {
    "pre-commit": "npx lint-staged"
  },
  "lint-staged": {
    "*.{js,css,md,json}": "prettier --write"
  }
}


================================================
FILE: prelude/.eslintrc.json
================================================
{
  "parserOptions": {
    "sourceType": "script"
  },
  "rules": {
    "no-var": "off",
    "vars-on-top": "off"
  }
}


================================================
FILE: prelude/bootstrap.js
================================================
/* eslint-disable import/no-unresolved */
/* eslint-disable global-require */
/* eslint-disable no-underscore-dangle */
/* eslint-disable prefer-rest-params */
/* eslint-disable prefer-spread */

/* global EXECPATH_FD */
/* global PAYLOAD_POSITION */
/* global PAYLOAD_SIZE */
/* global REQUIRE_COMMON */
/* global VIRTUAL_FILESYSTEM */
/* global DEFAULT_ENTRYPOINT */
/* global DICT */
/* global DOCOMPRESS */
/* global SYMLINKS */

'use strict';

const childProcess = require('child_process');
const { createHash } = require('crypto');
const fs = require('fs');
const { isRegExp } = require('util').types;
const Module = require('module');
const path = require('path');
const { promisify, _extend } = require('util');
const { Script } = require('vm');
const { tmpdir } = require('os');
const util = require('util');
const {
  brotliDecompress,
  brotliDecompressSync,
  gunzip,
  gunzipSync,
} = require('zlib');

const common = {};
REQUIRE_COMMON(common);

const {
  STORE_BLOB,
  STORE_CONTENT,
  STORE_LINKS,
  STORE_STAT,
  isRootPath,
  normalizePath,
  insideSnapshot,
  stripSnapshot,
  removeUplevels,
} = common;

let FLAG_ENABLE_PROJECT = false;
const NODE_VERSION_MAJOR = process.version.match(/^v(\d+)/)[1] | 0;
const NODE_VERSION_MINOR = process.version.match(/^v\d+.(\d+)/)[1] | 0;

// /////////////////////////////////////////////////////////////////
// ENTRYPOINT //////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////

// set ENTRYPOINT and ARGV0 here because
// they can be altered during process run
const ARGV0 = process.argv[0];
const EXECPATH = process.execPath;
let ENTRYPOINT = process.argv[1];

if (process.env.PKG_EXECPATH === 'PKG_INVOKE_NODEJS') {
  return { undoPatch: true };
}

if (NODE_VERSION_MAJOR < 12 || require('worker_threads').isMainThread) {
  if (process.argv[1] !== 'PKG_DUMMY_ENTRYPOINT') {
    // expand once patchless is introduced, that
    // will obviously lack any work in node_main.cc
    throw new Error('PKG_DUMMY_ENTRYPOINT EXPECTED');
  }
}

if (process.env.PKG_EXECPATH === EXECPATH) {
  process.argv.splice(1, 1);

  if (process.argv[1] && process.argv[1] !== '-') {
    // https://github.com/nodejs/node/blob/1a96d83a223ff9f05f7d942fb84440d323f7b596/lib/internal/bootstrap/node.js#L269
    process.argv[1] = path.resolve(process.argv[1]);
  }
} else {
  process.argv[1] = DEFAULT_ENTRYPOINT;
}

[, ENTRYPOINT = DEFAULT_ENTRYPOINT] = process.argv;
delete process.env.PKG_EXECPATH;

// /////////////////////////////////////////////////////////////////
// EXECSTAT ////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////

const EXECSTAT = fs.statSync(EXECPATH);

EXECSTAT.atimeMs = EXECSTAT.atime.getTime();
EXECSTAT.mtimeMs = EXECSTAT.mtime.getTime();
EXECSTAT.ctimeMs = EXECSTAT.ctime.getTime();
EXECSTAT.birthtimeMs = EXECSTAT.birthtime.getTime();

// /////////////////////////////////////////////////////////////////
// MOUNTPOINTS /////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////

const mountpoints = [];

function insideMountpoint(f) {
  if (!insideSnapshot(f)) return null;
  const file = normalizePath(f);
  const found = mountpoints
    .map((mountpoint) => {
      const { interior, exterior } = mountpoint;
      if (isRegExp(interior) && interior.test(file))
        return file.replace(interior, exterior);
      if (interior === file) return exterior;
      const left = interior + path.sep;
      if (file.slice(0, left.length) !== left) return null;
      return exterior + file.slice(left.length - 1);
    })
    .filter((result) => result);

  if (found.length >= 2) throw new Error('UNEXPECTED-00');
  if (found.length === 0) return null;
  return found[0];
}

function readdirMountpoints(path_) {
  return mountpoints
    .filter(({ interior }) => {
      if (isRegExp(interior)) return interior.test(path_);
      return path.dirname(interior) === path_;
    })
    .map(({ interior, exterior }) => {
      if (isRegExp(interior)) return path_.replace(interior, exterior);
      return path.basename(interior);
    });
}

function translate(f) {
  const result = insideMountpoint(f);
  if (!result) throw new Error('UNEXPECTED-05');
  return result;
}

function cloneArgs(args_) {
  return Array.prototype.slice.call(args_);
}

function translateNth(args_, index, f) {
  const args = cloneArgs(args_);
  args[index] = translate(f);
  return args;
}

function createMountpoint(interior, exterior) {
  // TODO validate
  mountpoints.push({ interior, exterior });
}

const DEFAULT_COPY_CHUNK_SIZE = 10 * 1024 * 1024; // 10 MB
function copyInChunks(
  source,
  target,
  chunkSize = DEFAULT_COPY_CHUNK_SIZE,
  fs_ = fs
) {
  const sourceFile = fs_.openSync(source, 'r');
  const targetFile = fs_.openSync(target, 'w');

  let bytesRead = 1;
  while (bytesRead > 0) {
    const buffer = Buffer.alloc(chunkSize);
    bytesRead = fs_.readSync(sourceFile, buffer, 0, chunkSize);
    fs_.writeSync(targetFile, buffer, 0, bytesRead);
  }

  fs_.closeSync(sourceFile);
  fs_.closeSync(targetFile);
}

// TODO: replace this with fs.cpSync when we drop Node < 16
function copyFolderRecursiveSync(source, target) {
  // Build target folder
  const targetFolder = path.join(target, path.basename(source));

  // Check if target folder needs to be created or integrated
  if (!fs.existsSync(targetFolder)) {
    fs.mkdirSync(targetFolder);
  }

  // Copy
  if (fs.lstatSync(source).isDirectory()) {
    const files = fs.readdirSync(source);

    for (const file of files) {
      // Build source name
      const curSource = path.join(source, file);

      // Call this function recursively as long as source is a directory
      if (fs.lstatSync(curSource).isDirectory()) {
        copyFolderRecursiveSync(curSource, targetFolder);
      } else {
        // Current source is a file, it must be available on the real filesystem
        // instead of the virtual snapshot file system to load it by process.dlopen.
        //
        // Before we try to copy we do some checks.
        // See https://github.com/vercel/pkg/issues/1589 for more details.

        // Build target file name
        const curTarget = path.join(targetFolder, path.basename(curSource));

        if (fs.existsSync(curTarget)) {
          // Target file already exists, read source and target file...
          const curSourceContent = fs.readFileSync(curSource, {
            encoding: 'binary',
          });
          const curTargetContent = fs.readFileSync(curTarget, {
            encoding: 'binary',
          });

          // ...and calculate checksum from source and target file
          const curSourceHash = createHash('sha256')
            .update(curSourceContent)
            .digest('hex');
          const curTargetHash = createHash('sha256')
            .update(curTargetContent)
            .digest('hex');

          // If checksums are equal then there is nothing to do here
          // ==> target already exists and is up-to-date
          if (curSourceHash === curTargetHash) {
            continue;
          }
        }

        // Target must be copied because it either does not exist or is outdated.
        // Due to the possibility that mutliple instances of this app start simultaneously,
        // the copy action might fail. Only one starting instance gets write access.
        //
        // We don't catch any error here because it does not make sense to go ahead and to
        // try to load the file while another instance has not yet finished the copy action.
        // If the app start fails then the user should try to start the app later again.
        // Unfortunately, we cannot implement delayed retries ourselves because process.dlopen
        // is a synchronous function, promises are not supported.
        fs.copyFileSync(curSource, curTarget);
      }
    }
  }
}

function createDirRecursively(dir) {
Download .txt
gitextract_v7367qf3/

├── .eslintignore
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── 01_bug_report.yml
│   │   ├── 02_regression.yml
│   │   └── config.yml
│   └── workflows/
│       ├── ci.yml
│       └── close-stale.yml
├── .gitignore
├── .prettierignore
├── .yarnrc
├── LICENSE
├── README.md
├── dictionary/
│   ├── .eslintrc.json
│   ├── angular-bridge.js
│   ├── any-promise.js
│   ├── async.js
│   ├── aws-sdk.js
│   ├── babel-core.js
│   ├── batch.js
│   ├── bcrypt.js
│   ├── better-sqlite3.js
│   ├── bignum.js
│   ├── bindings.js
│   ├── blessed.js
│   ├── body-parser.js
│   ├── browserify.js
│   ├── bson.js
│   ├── buffermaker.js
│   ├── bunyan.js
│   ├── busboy.js
│   ├── bytes.js
│   ├── callsites.js
│   ├── chokidar.js
│   ├── coffee-script.js
│   ├── colors.js
│   ├── compression.js
│   ├── compressjs.js
│   ├── connect-mongo.js
│   ├── connect-mongodb.js
│   ├── connect-redis.js
│   ├── connect.js
│   ├── consolidate.js
│   ├── cookie-parser.js
│   ├── cookie.js
│   ├── cors.js
│   ├── cron.js
│   ├── cross-env.js
│   ├── cross-spawn-async.js
│   ├── curve25519.js
│   ├── data-preflight.js
│   ├── debug.js
│   ├── denymount.js
│   ├── diff.js
│   ├── drivelist.js
│   ├── ed25519.js
│   ├── ejs.js
│   ├── elasticsearch.js
│   ├── electron.js
│   ├── emailjs.js
│   ├── engine.io.js
│   ├── epoll.js
│   ├── errorhandler.js
│   ├── errors.js
│   ├── eslint.js
│   ├── etcher-image-write.js
│   ├── exceljs.js
│   ├── exiftool.exe.js
│   ├── exiftool.pl.js
│   ├── express-load.js
│   ├── express-session.js
│   ├── express.js
│   ├── extender.js
│   ├── extsprintf.js
│   ├── faye-websocket.js
│   ├── feathers.js
│   ├── findup-sync.js
│   ├── floordate.js
│   ├── fmt.js
│   ├── formidable.js
│   ├── fs-extra.js
│   ├── fsevents.js
│   ├── geoip-lite.js
│   ├── github.js
│   ├── gm.js
│   ├── google-closure-compiler-java.js
│   ├── google-closure-compiler.js
│   ├── googleapis.js
│   ├── got.js
│   ├── graceful-fs.js
│   ├── grpc.js
│   ├── gulp.js
│   ├── hap-nodejs.js
│   ├── heapdump.js
│   ├── hoek.js
│   ├── homebridge.js
│   ├── http-proxy.js
│   ├── http-server.js
│   ├── image-size.js
│   ├── indexof.js
│   ├── inquirer.js
│   ├── j.js
│   ├── jade.js
│   ├── jsdom.js
│   ├── json-stringify-date.js
│   ├── json-stringify-safe.js
│   ├── jsonwebtoken.js
│   ├── kerberos.js
│   ├── knex.js
│   ├── later.js
│   ├── level.js
│   ├── leveldown.js
│   ├── levelup.js
│   ├── liftoff.js
│   ├── lodash.js
│   ├── log4js.js
│   ├── logform.js
│   ├── machinepack-urls.js
│   ├── markdown.js
│   ├── mdns.js
│   ├── method-override.js
│   ├── microjob.js
│   ├── mime-types.js
│   ├── mime.js
│   ├── minimatch.js
│   ├── minstache.js
│   ├── module-deps.js
│   ├── moment-timezone.js
│   ├── moment.js
│   ├── mongodb-core.js
│   ├── mongodb.js
│   ├── mongoose.js
│   ├── mongoskin.js
│   ├── ms.js
│   ├── msgpack.js
│   ├── multer.js
│   ├── muri.js
│   ├── native-or-bluebird.js
│   ├── natives.js
│   ├── nconf.js
│   ├── nedb.js
│   ├── negotiator.js
│   ├── newrelic.js
│   ├── nib.js
│   ├── nightmare.js
│   ├── node-forge.js
│   ├── node-libcurl.js
│   ├── node-notifier.js
│   ├── node-pre-gyp.js
│   ├── node-redis-pubsub.js
│   ├── node-sass.js
│   ├── node-uuid.js
│   ├── node-xlsx.js
│   ├── node-zookeeper-client.js
│   ├── nodegit.js
│   ├── nodemailer-sendmail-transport.js
│   ├── nodemailer.js
│   ├── npm-registry-client.js
│   ├── npm.js
│   ├── nssocket.js
│   ├── oauth2orize.js
│   ├── octobat.js
│   ├── open.js
│   ├── opn.js
│   ├── optimist.js
│   ├── passport-local.js
│   ├── passport.js
│   ├── pg-cursor.js
│   ├── pg-query-stream.js
│   ├── pg-types.js
│   ├── pg.js
│   ├── pg.js.js
│   ├── pgpass.js
│   ├── phantom.js
│   ├── phantomjs-prebuilt.js
│   ├── pkginfo.js
│   ├── pm2.js
│   ├── pmx.js
│   ├── pouchdb.js
│   ├── primus-emitter.js
│   ├── primus-spark-latency.js
│   ├── primus.js
│   ├── publicsuffixlist.js
│   ├── pug.js
│   ├── punt.js
│   ├── puppeteer.js
│   ├── pwd.js
│   ├── q.js
│   ├── raven.js
│   ├── rc.js
│   ├── readable-stream.js
│   ├── rechoir.js
│   ├── redis-parser.js
│   ├── redis.js
│   ├── regression.js
│   ├── reload.js
│   ├── request.js
│   ├── require-uncached.js
│   ├── require_optional.js
│   ├── s3.js
│   ├── safe_datejs.js
│   ├── sails.js
│   ├── sax.js
│   ├── scrypt.js
│   ├── semver.js
│   ├── sequelize.js
│   ├── serialport.js
│   ├── sha3.js
│   ├── sharp.js
│   ├── shelljs.js
│   ├── sinon.js
│   ├── socket.io-client.js
│   ├── socket.io.js
│   ├── sqip.js
│   ├── sqlite3.js
│   ├── steam-crypto.js
│   ├── steam-resources.js
│   ├── steam.js
│   ├── stripe-webhook-middleware.js
│   ├── stripe.js
│   ├── strong-globalize.js
│   ├── stylus.js
│   ├── supervisor.js
│   ├── svgo.js
│   ├── tabtab.js
│   ├── tesseract.js.js
│   ├── throng.js
│   ├── time.js
│   ├── tinify.js
│   ├── tiny-worker.js
│   ├── tmp.js
│   ├── transformers.js
│   ├── uglify-js.js
│   ├── umd.js
│   ├── underscore.js
│   ├── union.js
│   ├── update-notifier.js
│   ├── usage.js
│   ├── v8flags.js
│   ├── verror.js
│   ├── voc.js
│   ├── webdriverio.js
│   ├── winston-uber.js
│   ├── winston.js
│   ├── ws.js
│   ├── xlsx.js
│   ├── xml2js.js
│   ├── yargs.js
│   └── zeromq.js
├── examples/
│   ├── .eslintrc.json
│   └── express/
│       ├── index.js
│       ├── package.json
│       ├── readme.md
│       └── views/
│           ├── index.html
│           └── lib/
│               └── sakura.css
├── lib/
│   ├── bin.ts
│   ├── chmod.ts
│   ├── common.ts
│   ├── compress_type.ts
│   ├── detector.ts
│   ├── fabricator.ts
│   ├── follow.ts
│   ├── help.ts
│   ├── index.ts
│   ├── log.js
│   ├── mach-o.ts
│   ├── packer.ts
│   ├── producer.ts
│   ├── refiner.ts
│   ├── types.ts
│   └── walker.ts
├── package.json
├── prelude/
│   ├── .eslintrc.json
│   ├── bootstrap.js
│   └── diagnostic.js
├── test/
│   ├── .eslintrc.json
│   ├── .gitignore
│   ├── test-42-fetch-all/
│   │   └── main.js
│   ├── test-42-path-related-values/
│   │   ├── main.js
│   │   └── project/
│   │       ├── app.js
│   │       └── module.js
│   ├── test-46-input/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-js/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-output-js/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-js-exe/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-target/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-output-target-js/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-target-js-exe/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-targets-many/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-output-targets-many-2/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-output-targets-many-3/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-targets-many-4/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-targets-many-5/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-output-targets-many-6/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-package-json/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-package-json-dir/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-package-json-dir-scope/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-package-json-outputdir/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-package-json-target/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-46-input-target/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-target-js/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-target-js-exe/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-targets-many/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-targets-many-2/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-input-targets-many-3/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-targets-many-4/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-targets-many-5/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-input-targets-many-6/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-multi-arch/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-multi-arch-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-46-outpath/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-outpath-target/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-46-outpath-targets-many/
│   │   ├── main.js
│   │   └── test-x-index
│   ├── test-48-common/
│   │   └── main.js
│   ├── test-50-api/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-arguments/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-ast-parsing/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-data.txt
│   ├── test-50-ast-parsing-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery-3/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery-4/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-bakery-fetch/
│   │   └── main.js
│   ├── test-50-can-include-addon/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── time.node
│   ├── test-50-cannot-css-script/
│   │   ├── assets/
│   │   │   └── animate.css
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-50-cannot-include-df/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-chdir-env-var/
│   │   ├── main.js
│   │   └── source/
│   │       └── test-x-index.js
│   ├── test-50-class-to-string/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-config-log/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-console-trace/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-corrupt-executable/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-debug/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-error-source-position/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-extensions/
│   │   ├── .eslintrc.json
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-esnext.js
│   │   └── test-z-sub.js
│   ├── test-50-for-await-of/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-fs-runtime-layer/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   ├── test-x1-index.js
│   │   ├── test-x2-index.js
│   │   ├── test-x3-index.js
│   │   ├── test-z-asset-A.css
│   │   └── test-z-asset-B.css
│   ├── test-50-fs-runtime-layer-2/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-asset.css
│   ├── test-50-fs-runtime-layer-3/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-asset.css
│   ├── test-50-global-object/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve-A.js
│   │   └── test-y-resolve-B.js
│   ├── test-50-inspect/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-invalid/
│   │   └── main.js
│   ├── test-50-invalid-package-json/
│   │   └── main.js
│   ├── test-50-invalid-package-json-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-invalid-package-json-bin/
│   │   ├── main.js
│   │   └── package.json
│   ├── test-50-invalid-package-json-bin-2/
│   │   ├── main.js
│   │   └── package.json
│   ├── test-50-invalid-unknown-token/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-many-arrow-functions/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-creator.js
│   ├── test-50-many-callbacks/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-creator.js
│   ├── test-50-may-exclude/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-may-exclude-must-exclude/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-index.js
│   ├── test-50-module-parent/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-fish-A.js
│   │   ├── test-y-fish-B.js
│   │   └── test-y-fish-C.js
│   ├── test-50-mountpoints/
│   │   ├── main.js
│   │   ├── plugins-C-int/
│   │   │   └── test-y-require-C.js
│   │   ├── plugins-D-ext/
│   │   │   └── test-y-require-D.js
│   │   ├── test-x-index.js
│   │   └── test-y-common.js
│   ├── test-50-native-addon/
│   │   ├── lib/
│   │   │   └── time.node
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-native-addon-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-native-addon-3/
│   │   ├── lib/
│   │   │   ├── community/
│   │   │   │   ├── test-y-index.js
│   │   │   │   └── time-y.node
│   │   │   ├── enterprise/
│   │   │   │   ├── test-z-index.js
│   │   │   │   └── time-z.node
│   │   │   ├── test-x-index.js
│   │   │   └── time-x.node
│   │   └── main.js
│   ├── test-50-native-addon-4/
│   │   ├── lib/
│   │   │   └── time.node
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-no-signature/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-no-super-in-constructor/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-node-modules-tree/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-fish-A.js
│   │   ├── test-y-fish-B.js
│   │   ├── test-y-fish-E
│   │   ├── test-y-fish-F
│   │   ├── test-y-fish-G
│   │   ├── test-y-fish-H
│   │   ├── test-y-fish-I
│   │   ├── test-y-fish-J
│   │   ├── test-y-fish-M
│   │   ├── test-y-fish-N
│   │   ├── test-y-fish-O
│   │   └── test-y-fish-P
│   ├── test-50-non-ascii/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-$$.js
│   ├── test-50-not-found-wording/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-not-found-wording-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-object-spread/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-observe-snapshot-root/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-observe-snapshot-root-2/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-odd-entrypoint/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-a-binary/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve-A.js
│   │   ├── test-y-resolve-B.txt
│   │   └── test-y-resolve-C.json
│   ├── test-50-package-json-2/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   └── test-x-index.js
│   │   └── test-y-data.json
│   ├── test-50-package-json-3/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   └── test-y-data.json
│   ├── test-50-package-json-4/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-5/
│   │   └── main.js
│   ├── test-50-package-json-6/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-6b/
│   │   └── main.js
│   ├── test-50-package-json-6c/
│   │   ├── beta/
│   │   │   ├── alpha.js
│   │   │   ├── beta.js
│   │   │   └── package.json
│   │   └── main.js
│   ├── test-50-package-json-6d/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-7/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-50-package-json-7p/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-50-package-json-8/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   ├── sub/
│   │   │   │   └── test-y-require.js
│   │   │   ├── test-x-index.js
│   │   │   └── test-z-require.js
│   │   └── test-z-data.css
│   ├── test-50-package-json-8b/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   ├── sub/
│   │   │   │   └── test-y-require.js
│   │   │   ├── test-x-index.js
│   │   │   └── test-z-require.js
│   │   └── test-z-data.css
│   ├── test-50-package-json-8p/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   ├── sub/
│   │   │   │   └── test-y-require.js
│   │   │   ├── test-x-index.js
│   │   │   └── test-z-require.js
│   │   └── test-z-data.css
│   ├── test-50-package-json-9/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-9p/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-package-json-A/
│   │   ├── main.js
│   │   ├── package.json
│   │   └── test-x-index.js
│   ├── test-50-path-as-buffer/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-z-asset.css
│   ├── test-50-path-separators/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── sub/
│   │   │   ├── test-y-require-C.js
│   │   │   └── test-y-require-D.js
│   │   └── test-x-index.js
│   ├── test-50-promisify/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-public-packages/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-reproducible/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-require-edge-cases/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-x1-content.js
│   │   ├── test-x2-require-false.js
│   │   └── test-x3-empty-file.js
│   ├── test-50-require-main-parent/
│   │   ├── main.js
│   │   ├── sub/
│   │   │   ├── test-y-require-C.js
│   │   │   └── test-y-require-D.js
│   │   ├── test-x-index.js
│   │   ├── test-y-require-A.js
│   │   └── test-y-require-B.js
│   ├── test-50-require-resolve/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve.any
│   │   ├── test-z-require-code-1.js
│   │   ├── test-z-require-code-2.js
│   │   ├── test-z-require-code-3.js
│   │   ├── test-z-require-code-4.js
│   │   ├── test-z-require-content.css
│   │   ├── test-z-require-json-1.json
│   │   ├── test-z-require-json-2.json
│   │   ├── test-z-require-json-3.json
│   │   ├── test-z-require-json-4.json
│   │   └── test-z-require-json-5.json
│   ├── test-50-require-resolve-2/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve-A.txt
│   │   ├── test-y-resolve-B.txt
│   │   ├── test-y-resolve-C.txt
│   │   ├── test-y-resolve-D.txt
│   │   ├── test-y-resolve-E.txt
│   │   ├── test-y-resolve-F.txt
│   │   ├── test-y-resolve-G.txt
│   │   ├── test-y-resolve-H.txt
│   │   ├── test-z-require-code-I.js
│   │   ├── test-z-require-code-J.js
│   │   ├── test-z-require-content-K.txt
│   │   ├── test-z-require-content-L.txt
│   │   ├── test-z-require-content-M.txt
│   │   └── test-z-require-content-N.txt
│   ├── test-50-require-with-config/
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-x-index.js
│   │   ├── test-y-resolve-A.txt
│   │   ├── test-y-resolve-B.txt
│   │   ├── test-y-resolve-C.txt
│   │   ├── test-y-resolve-D.txt
│   │   ├── test-y-resolve-E.txt
│   │   ├── test-y-resolve-F.txt
│   │   ├── test-y-resolve-G.txt
│   │   ├── test-y-resolve-H.txt
│   │   ├── test-z-require-code-I.js
│   │   ├── test-z-require-code-J.js
│   │   ├── test-z-require-content-K.txt
│   │   ├── test-z-require-content-L.txt
│   │   ├── test-z-require-content-M.txt
│   │   └── test-z-require-content-N.txt
│   ├── test-50-resolve-and-nearby/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-fish
│   ├── test-50-should-disclose-package/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-signature/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-sigusr1/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-spawn/
│   │   ├── main.js
│   │   ├── test-cluster-child.js
│   │   ├── test-cluster.js
│   │   ├── test-cpfork-a-1.js
│   │   ├── test-cpfork-a-2.js
│   │   ├── test-cpfork-a-child.js
│   │   ├── test-cpfork-b-1.js
│   │   ├── test-cpfork-b-2.js
│   │   ├── test-cpfork-b-child.js
│   │   ├── test-exec-1.js
│   │   ├── test-exec-2.js
│   │   ├── test-exec-3.js
│   │   ├── test-exec-child.js
│   │   ├── test-execFile-child.js
│   │   ├── test-execFile.js
│   │   ├── test-execFileSync-child.js
│   │   ├── test-execFileSync.js
│   │   ├── test-execSync-1.js
│   │   ├── test-execSync-2.js
│   │   ├── test-execSync-3.js
│   │   ├── test-execSync-child.js
│   │   ├── test-node.js
│   │   ├── test-spawn-a-1.js
│   │   ├── test-spawn-a-2.js
│   │   ├── test-spawn-a-3.js
│   │   ├── test-spawn-a-4.js
│   │   ├── test-spawn-a-5.js
│   │   ├── test-spawn-a-child.js
│   │   ├── test-spawn-b-child.js
│   │   ├── test-spawn-b.js
│   │   ├── test-spawn-c-child.js
│   │   ├── test-spawn-c.js
│   │   ├── test-spawn-d-child.js
│   │   ├── test-spawn-d.js
│   │   ├── test-spawnSync-child.js
│   │   └── test-spawnSync.js
│   ├── test-50-symlink/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-tamper-core/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-50-undo-patch/
│   │   ├── main.js
│   │   ├── test-x-index.js
│   │   └── test-y-index.js
│   ├── test-77-compare-dicts-and-tests/
│   │   └── main.js
│   ├── test-78-verify-pkg-version/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-79-npm/
│   │   ├── angular-bridge/
│   │   │   ├── angular-bridge.js
│   │   │   └── package.json
│   │   ├── any-promise/
│   │   │   ├── any-promise.js
│   │   │   ├── any-promise.meta.js
│   │   │   └── package.json
│   │   ├── async/
│   │   │   ├── async.js
│   │   │   └── package.json
│   │   ├── aws-sdk/
│   │   │   ├── aws-sdk.js
│   │   │   └── package.json
│   │   ├── babel-core/
│   │   │   ├── babel-core.js
│   │   │   ├── babel-core.txt
│   │   │   ├── babel-core@4.7.16.js
│   │   │   └── package.json
│   │   ├── batch/
│   │   │   ├── batch.js
│   │   │   └── package.json
│   │   ├── bcrypt/
│   │   │   ├── bcrypt.js
│   │   │   └── package.json
│   │   ├── better-sqlite3/
│   │   │   ├── .gitignore
│   │   │   ├── better-sqlite3.js
│   │   │   ├── better-sqlite3.meta.js
│   │   │   └── package.json
│   │   ├── bignum/
│   │   │   ├── bignum.js
│   │   │   ├── bignum.meta.js
│   │   │   └── package.json
│   │   ├── bindings/
│   │   │   ├── bindings.js
│   │   │   └── package.json
│   │   ├── blessed/
│   │   │   ├── blessed.js
│   │   │   └── package.json
│   │   ├── body-parser/
│   │   │   ├── body-parser.js
│   │   │   ├── body-parser@1.10.2.js
│   │   │   └── package.json
│   │   ├── browserify/
│   │   │   ├── browserify.js
│   │   │   ├── browserify.meta.js
│   │   │   └── package.json
│   │   ├── bson/
│   │   │   ├── bson.js
│   │   │   ├── bson@0.2.22.js
│   │   │   ├── bson@0.2.22.meta.js
│   │   │   ├── bson@0.4.0.js
│   │   │   ├── bson@0.4.0.meta.js
│   │   │   ├── bson@1.0.0.js
│   │   │   └── package.json
│   │   ├── buffermaker/
│   │   │   ├── buffermaker.js
│   │   │   └── package.json
│   │   ├── bunyan/
│   │   │   ├── bunyan.js
│   │   │   └── package.json
│   │   ├── busboy/
│   │   │   ├── busboy.js
│   │   │   └── package.json
│   │   ├── bytes/
│   │   │   ├── bytes.js
│   │   │   ├── bytes@2.5.0.js
│   │   │   └── package.json
│   │   ├── callsites/
│   │   │   ├── callsites.js
│   │   │   └── package.json
│   │   ├── checklist.htm
│   │   ├── checklist.js
│   │   ├── chokidar/
│   │   │   ├── chokidar.js
│   │   │   └── package.json
│   │   ├── coffee-script/
│   │   │   ├── coffee-script-example.coffee
│   │   │   ├── coffee-script.js
│   │   │   └── package.json
│   │   ├── colors/
│   │   │   ├── colors.js
│   │   │   └── package.json
│   │   ├── compression/
│   │   │   ├── compression.js
│   │   │   └── package.json
│   │   ├── compressjs/
│   │   │   ├── compressjs.js
│   │   │   └── package.json
│   │   ├── connect/
│   │   │   ├── connect.js
│   │   │   ├── connect@2.3.9.js
│   │   │   └── package.json
│   │   ├── connect-mongo/
│   │   │   ├── connect-mongo.js
│   │   │   ├── connect-mongo.meta.js
│   │   │   ├── connect-mongo@0.8.2.js
│   │   │   ├── connect-mongo@0.8.2.meta.js
│   │   │   └── package.json
│   │   ├── connect-mongodb/
│   │   │   ├── connect-mongodb.js
│   │   │   ├── connect-mongodb.meta.js
│   │   │   └── package.json
│   │   ├── connect-redis/
│   │   │   ├── connect-redis.js
│   │   │   ├── connect-redis.meta.js
│   │   │   ├── connect-redis@2.5.1.js
│   │   │   ├── connect-redis@2.5.1.meta.js
│   │   │   └── package.json
│   │   ├── consolidate/
│   │   │   ├── consolidate.js
│   │   │   └── package.json
│   │   ├── cookie/
│   │   │   ├── cookie.js
│   │   │   └── package.json
│   │   ├── cookie-parser/
│   │   │   ├── cookie-parser.js
│   │   │   └── package.json
│   │   ├── cors/
│   │   │   ├── cors.js
│   │   │   └── package.json
│   │   ├── cron/
│   │   │   ├── cron.js
│   │   │   └── package.json
│   │   ├── cross-env/
│   │   │   ├── cross-env.js
│   │   │   └── package.json
│   │   ├── cross-spawn-async/
│   │   │   ├── cross-spawn-async.js
│   │   │   ├── fixture.js
│   │   │   └── package.json
│   │   ├── curve25519/
│   │   │   ├── package.json
│   │   │   └── see.hap-nodejs.meta.js
│   │   ├── data-preflight/
│   │   │   ├── data-preflight.js
│   │   │   ├── data-preflight.meta.js
│   │   │   └── package.json
│   │   ├── debug/
│   │   │   ├── debug.js
│   │   │   └── package.json
│   │   ├── denymount/
│   │   │   ├── denymount.js
│   │   │   └── package.json
│   │   ├── diff/
│   │   │   ├── diff.js
│   │   │   └── package.json
│   │   ├── drivelist/
│   │   │   ├── drivelist.js
│   │   │   ├── drivelist.meta.js
│   │   │   ├── drivelist@3.0.0.js
│   │   │   ├── drivelist@3.0.0.meta.js
│   │   │   └── package.json
│   │   ├── ed25519/
│   │   │   ├── ed25519.js
│   │   │   ├── ed25519.meta.js
│   │   │   └── package.json
│   │   ├── ejs/
│   │   │   ├── ejs.js
│   │   │   ├── ejs@0.8.8.js
│   │   │   └── package.json
│   │   ├── elasticsearch/
│   │   │   ├── elasticsearch.js
│   │   │   └── package.json
│   │   ├── electron/
│   │   │   ├── electron.js
│   │   │   ├── electron.meta.js
│   │   │   └── package.json
│   │   ├── emailjs/
│   │   │   ├── emailjs.js
│   │   │   └── package.json
│   │   ├── engine.io/
│   │   │   ├── engine.io.js
│   │   │   ├── engine.io@1.8.0.js
│   │   │   └── package.json
│   │   ├── epoll/
│   │   │   ├── epoll.js
│   │   │   ├── epoll.meta.js
│   │   │   └── package.json
│   │   ├── errorhandler/
│   │   │   ├── errorhandler.js
│   │   │   └── package.json
│   │   ├── errors/
│   │   │   ├── errors.js
│   │   │   └── package.json
│   │   ├── eslint/
│   │   │   ├── eslint.js
│   │   │   ├── eslint.meta.js
│   │   │   └── package.json
│   │   ├── etcher-image-write/
│   │   │   ├── etcher-image-write.js
│   │   │   ├── etcher-image-write.meta.js
│   │   │   └── package.json
│   │   ├── exceljs/
│   │   │   ├── exceljs.js
│   │   │   └── package.json
│   │   ├── exiftool.pl/
│   │   │   ├── exiftool.pl.js
│   │   │   ├── exiftool.pl.meta.js
│   │   │   └── package.json
│   │   ├── express/
│   │   │   ├── express.js
│   │   │   ├── express@3.5.3.js
│   │   │   └── package.json
│   │   ├── express-load/
│   │   │   ├── controllers/
│   │   │   │   └── fixture.js
│   │   │   ├── express-load.config.json
│   │   │   ├── express-load.js
│   │   │   ├── package.json
│   │   │   └── routes/
│   │   │       └── fixture.js
│   │   ├── express-session/
│   │   │   ├── express-session.js
│   │   │   └── package.json
│   │   ├── express-with-jade/
│   │   │   ├── express.config.json
│   │   │   ├── express.js
│   │   │   ├── express.meta.js
│   │   │   ├── express@3.0.6.config.json
│   │   │   ├── express@3.0.6.js
│   │   │   ├── express@3.0.6.meta.js
│   │   │   ├── express@3.21.2.config.json
│   │   │   ├── express@3.21.2.js
│   │   │   ├── express@3.21.2.meta.js
│   │   │   ├── package.json
│   │   │   └── views/
│   │   │       └── fixture.jade
│   │   ├── extender/
│   │   │   ├── extender.js
│   │   │   └── package.json
│   │   ├── extsprintf/
│   │   │   ├── extsprintf.js
│   │   │   └── package.json
│   │   ├── faye-websocket/
│   │   │   ├── faye-websocket.js
│   │   │   └── package.json
│   │   ├── feathers/
│   │   │   ├── feathers.js
│   │   │   └── package.json
│   │   ├── findup-sync/
│   │   │   ├── findup-sync.js
│   │   │   └── package.json
│   │   ├── floordate/
│   │   │   ├── floordate.js
│   │   │   └── package.json
│   │   ├── fmt/
│   │   │   ├── fmt.js
│   │   │   └── package.json
│   │   ├── formidable/
│   │   │   ├── formidable.js
│   │   │   └── package.json
│   │   ├── fs-extra/
│   │   │   ├── fs-extra.js
│   │   │   ├── fs-extra@0.20.1.js
│   │   │   └── package.json
│   │   ├── fsevents/
│   │   │   ├── fsevents.js
│   │   │   ├── fsevents.meta.js
│   │   │   └── package.json
│   │   ├── geoip-lite/
│   │   │   ├── geoip-lite.js
│   │   │   └── package.json
│   │   ├── github/
│   │   │   ├── github.js
│   │   │   └── package.json
│   │   ├── gm/
│   │   │   ├── gm.js
│   │   │   ├── gm.meta.js
│   │   │   └── package.json
│   │   ├── google-closure-compiler/
│   │   │   ├── google-closure-compiler.js
│   │   │   ├── google-closure-compiler.meta.js
│   │   │   ├── google-closure-compiler@20180610.0.2.js
│   │   │   ├── google-closure-compiler@20180610.0.2.meta.js
│   │   │   └── package.json
│   │   ├── google-closure-compiler-java/
│   │   │   ├── google-closure-compiler-java.js
│   │   │   ├── google-closure-compiler-java.meta.js
│   │   │   └── package.json
│   │   ├── googleapis/
│   │   │   ├── googleapis.js
│   │   │   └── package.json
│   │   ├── got/
│   │   │   ├── got.js
│   │   │   └── package.json
│   │   ├── graceful-fs/
│   │   │   ├── graceful-fs.js
│   │   │   ├── graceful-fs@3.0.8.js
│   │   │   └── package.json
│   │   ├── grpc/
│   │   │   ├── grpc.js
│   │   │   ├── grpc.meta.js
│   │   │   └── package.json
│   │   ├── gulp/
│   │   │   ├── gulp-concat-01.txt
│   │   │   ├── gulp-concat-02.txt
│   │   │   ├── gulp.js
│   │   │   ├── gulp.meta.js
│   │   │   ├── gulpfile.js
│   │   │   └── package.json
│   │   ├── hap-nodejs/
│   │   │   ├── hap-nodejs.js
│   │   │   ├── hap-nodejs.meta.js
│   │   │   └── package.json
│   │   ├── heapdump/
│   │   │   ├── heapdump.js
│   │   │   ├── heapdump.meta.js
│   │   │   └── package.json
│   │   ├── hoek/
│   │   │   ├── hoek.js
│   │   │   ├── hoek.meta.js
│   │   │   ├── hoek@0.9.1.js
│   │   │   └── package.json
│   │   ├── home.js
│   │   ├── homebridge/
│   │   │   ├── homebridge.js
│   │   │   ├── homebridge.meta.js
│   │   │   └── package.json
│   │   ├── http-proxy/
│   │   │   ├── http-proxy.js
│   │   │   └── package.json
│   │   ├── http-server/
│   │   │   ├── http-server.js
│   │   │   └── package.json
│   │   ├── image-size/
│   │   │   ├── image-size.js
│   │   │   └── package.json
│   │   ├── indexof/
│   │   │   ├── indexof.js
│   │   │   └── package.json
│   │   ├── inquirer/
│   │   │   ├── inquirer.js
│   │   │   └── package.json
│   │   ├── j/
│   │   │   ├── j.js
│   │   │   ├── package.json
│   │   │   └── registry.xls
│   │   ├── jade/
│   │   │   ├── jade.js
│   │   │   └── package.json
│   │   ├── jsdom/
│   │   │   ├── jsdom.js
│   │   │   ├── jsdom.meta.js
│   │   │   ├── jsdom@8.5.0.js
│   │   │   ├── jsdom@8.5.0.meta.js
│   │   │   └── package.json
│   │   ├── json-stringify-date/
│   │   │   ├── json-stringify-date.js
│   │   │   └── package.json
│   │   ├── json-stringify-safe/
│   │   │   ├── json-stringify-safe.js
│   │   │   ├── json-stringify-safe@4.0.0.js
│   │   │   └── package.json
│   │   ├── jsonwebtoken/
│   │   │   ├── jsonwebtoken.js
│   │   │   └── package.json
│   │   ├── kerberos/
│   │   │   ├── kerberos.js
│   │   │   ├── kerberos.meta.js
│   │   │   ├── kerberos@0.0.10.js
│   │   │   ├── kerberos@0.0.10.meta.js
│   │   │   └── package.json
│   │   ├── knex/
│   │   │   ├── knex.js
│   │   │   └── package.json
│   │   ├── later/
│   │   │   ├── later.js
│   │   │   └── package.json
│   │   ├── level/
│   │   │   ├── level.js
│   │   │   └── package.json
│   │   ├── leveldown/
│   │   │   ├── leveldown.js
│   │   │   ├── leveldown.meta.js
│   │   │   └── package.json
│   │   ├── levelup/
│   │   │   ├── levelup.js
│   │   │   ├── levelup.meta.js
│   │   │   └── package.json
│   │   ├── liftoff/
│   │   │   ├── liftoff.js
│   │   │   └── package.json
│   │   ├── lodash/
│   │   │   ├── lodash.js
│   │   │   └── package.json
│   │   ├── log4js/
│   │   │   ├── log4js.js
│   │   │   ├── log4js@0.5.8.js
│   │   │   ├── log4js@0.6.34.js
│   │   │   ├── log4js@1.1.1.js
│   │   │   └── package.json
│   │   ├── logform/
│   │   │   ├── logform.js
│   │   │   └── package.json
│   │   ├── machinepack-urls/
│   │   │   ├── machinepack-urls.js
│   │   │   ├── machinepack-urls@5.0.0.js
│   │   │   └── package.json
│   │   ├── main.js
│   │   ├── markdown/
│   │   │   ├── markdown.js
│   │   │   └── package.json
│   │   ├── mdns/
│   │   │   ├── mdns.js
│   │   │   ├── mdns.meta.js
│   │   │   └── package.json
│   │   ├── method-override/
│   │   │   ├── method-override.js
│   │   │   └── package.json
│   │   ├── microjob/
│   │   │   ├── microjob.js
│   │   │   └── package.json
│   │   ├── mime/
│   │   │   ├── mime.js
│   │   │   ├── mime@1.4.1.js
│   │   │   └── package.json
│   │   ├── mime-types/
│   │   │   ├── mime-types.js
│   │   │   └── package.json
│   │   ├── minimatch/
│   │   │   ├── minimatch.js
│   │   │   └── package.json
│   │   ├── minstache/
│   │   │   ├── minstache.js
│   │   │   └── package.json
│   │   ├── module-deps/
│   │   │   ├── module-deps.js
│   │   │   └── package.json
│   │   ├── moment/
│   │   │   ├── moment.js
│   │   │   └── package.json
│   │   ├── moment-timezone/
│   │   │   ├── moment-timezone.js
│   │   │   └── package.json
│   │   ├── mongodb/
│   │   │   ├── mongodb.js
│   │   │   ├── mongodb.meta.js
│   │   │   └── package.json
│   │   ├── mongodb-core/
│   │   │   ├── mongodb-core.js
│   │   │   ├── mongodb-core@1.0.5.js
│   │   │   ├── mongodb-core@1.0.5.meta.js
│   │   │   └── package.json
│   │   ├── mongoose/
│   │   │   ├── mongoose.js
│   │   │   ├── mongoose.meta.js
│   │   │   ├── mongoose@3.9.7.js
│   │   │   ├── mongoose@3.9.7.meta.js
│   │   │   ├── mongoose@4.0.8.js
│   │   │   ├── mongoose@4.0.8.meta.js
│   │   │   ├── mongoose@4.1.12.js
│   │   │   ├── mongoose@4.1.12.meta.js
│   │   │   └── package.json
│   │   ├── mongoskin/
│   │   │   ├── mongoskin@2.0.3.js
│   │   │   ├── mongoskin@2.0.3.meta.js
│   │   │   └── package.json
│   │   ├── ms/
│   │   │   ├── ms.js
│   │   │   └── package.json
│   │   ├── msgpack/
│   │   │   ├── msgpack.js
│   │   │   ├── msgpack.meta.js
│   │   │   └── package.json
│   │   ├── multer/
│   │   │   ├── multer.js
│   │   │   └── package.json
│   │   ├── muri/
│   │   │   ├── muri.js
│   │   │   └── package.json
│   │   ├── native-or-bluebird/
│   │   │   ├── native-or-bluebird.js
│   │   │   └── package.json
│   │   ├── natives/
│   │   │   ├── natives.js
│   │   │   └── package.json
│   │   ├── nconf/
│   │   │   ├── nconf.js
│   │   │   └── package.json
│   │   ├── nedb/
│   │   │   ├── nedb.js
│   │   │   └── package.json
│   │   ├── negotiator/
│   │   │   ├── negotiator.js
│   │   │   ├── negotiator@0.4.9.js
│   │   │   └── package.json
│   │   ├── newrelic/
│   │   │   ├── newrelic.js
│   │   │   └── package.json
│   │   ├── nib/
│   │   │   ├── nib.js
│   │   │   └── package.json
│   │   ├── nightmare/
│   │   │   ├── nightmare.config.json
│   │   │   ├── nightmare.js
│   │   │   ├── nightmare.meta.js
│   │   │   └── package.json
│   │   ├── node-forge/
│   │   │   ├── node-forge.js
│   │   │   └── package.json
│   │   ├── node-libcurl/
│   │   │   ├── node-libcurl.js
│   │   │   ├── node-libcurl.meta.js
│   │   │   └── package.json
│   │   ├── node-notifier/
│   │   │   ├── node-notifier.js
│   │   │   ├── node-notifier.meta.js
│   │   │   └── package.json
│   │   ├── node-pre-gyp/
│   │   │   ├── node-pre-gyp.js
│   │   │   └── package.json
│   │   ├── node-redis-pubsub/
│   │   │   ├── node-redis-pubsub.js
│   │   │   └── package.json
│   │   ├── node-sass/
│   │   │   ├── node-sass.js
│   │   │   └── package.json
│   │   ├── node-uuid/
│   │   │   ├── node-uuid.js
│   │   │   └── package.json
│   │   ├── node-xlsx/
│   │   │   ├── ffc.ods
│   │   │   ├── node-xlsx.js
│   │   │   ├── node-xlsx.meta.js
│   │   │   ├── node-xlsx@0.6.0.js
│   │   │   ├── package.json
│   │   │   └── registry.xls
│   │   ├── node-zookeeper-client/
│   │   │   ├── node-zookeeper-client.js
│   │   │   └── package.json
│   │   ├── nodegit/
│   │   │   ├── nodegit.js
│   │   │   ├── nodegit.meta.js
│   │   │   └── package.json
│   │   ├── nodemailer/
│   │   │   ├── nodemailer.js
│   │   │   └── package.json
│   │   ├── nodemailer-sendmail-transport/
│   │   │   ├── nodemailer-sendmail-transport.js
│   │   │   └── package.json
│   │   ├── npm/
│   │   │   ├── npm.meta.js
│   │   │   └── package.json
│   │   ├── npm-registry-client/
│   │   │   ├── npm-registry-client.js
│   │   │   ├── npm-registry-client@6.0.7.js
│   │   │   └── package.json
│   │   ├── nssocket/
│   │   │   ├── nssocket.js
│   │   │   ├── nssocket@0.5.3.js
│   │   │   └── package.json
│   │   ├── oauth2orize/
│   │   │   ├── oauth2orize.js
│   │   │   └── package.json
│   │   ├── octobat/
│   │   │   ├── octobat.js
│   │   │   └── package.json
│   │   ├── open/
│   │   │   ├── open.js
│   │   │   ├── open.meta.js
│   │   │   └── package.json
│   │   ├── opn/
│   │   │   ├── opn.js
│   │   │   ├── opn.meta.js
│   │   │   └── package.json
│   │   ├── optimist/
│   │   │   ├── optimist.js
│   │   │   └── package.json
│   │   ├── passport/
│   │   │   ├── package.json
│   │   │   ├── passport.js
│   │   │   └── passport@0.2.2.js
│   │   ├── passport-local/
│   │   │   ├── package.json
│   │   │   ├── passport-local.js
│   │   │   └── passport-local@0.1.6.js
│   │   ├── pg/
│   │   │   ├── package.json
│   │   │   ├── pg.js
│   │   │   ├── pg@3.6.3.js
│   │   │   ├── pg@4.0.0.js
│   │   │   └── pg@6.4.1.js
│   │   ├── pg-cursor/
│   │   │   ├── package.json
│   │   │   ├── pg-cursor.js
│   │   │   └── pg-cursor.meta.js
│   │   ├── pg-query-stream/
│   │   │   ├── package.json
│   │   │   ├── pg-query-stream.js
│   │   │   ├── pg-query-stream.meta.js
│   │   │   ├── pg-query-stream@1.0.0.js
│   │   │   └── pg-query-stream@1.0.0.meta.js
│   │   ├── pg-types/
│   │   │   ├── package.json
│   │   │   ├── pg-types.js
│   │   │   └── pg-types@1.0.0.js
│   │   ├── pg.js/
│   │   │   ├── package.json
│   │   │   ├── pg.js.js
│   │   │   ├── pg.js@3.6.2.js
│   │   │   └── pg.js@4.1.0.js
│   │   ├── pgpass/
│   │   │   ├── package.json
│   │   │   └── pgpass.js
│   │   ├── phantom/
│   │   │   ├── package.json
│   │   │   ├── phantom.js
│   │   │   └── phantom.meta.js
│   │   ├── phantomjs-prebuilt/
│   │   │   ├── package.json
│   │   │   ├── phantomjs-prebuilt.js
│   │   │   └── phantomjs-prebuilt.meta.js
│   │   ├── pkginfo/
│   │   │   ├── package.json
│   │   │   ├── pkginfo.js
│   │   │   └── pkginfo@0.2.1.js
│   │   ├── pm2/
│   │   │   ├── package.json
│   │   │   └── test.it.manually.meta.js
│   │   ├── pmx/
│   │   │   ├── package.json
│   │   │   ├── pmx.js
│   │   │   └── pmx@0.5.9.js
│   │   ├── pouchdb/
│   │   │   ├── package.json
│   │   │   ├── pouchdb.js
│   │   │   └── pouchdb.meta.js
│   │   ├── primus/
│   │   │   ├── package.json
│   │   │   └── primus.js
│   │   ├── primus-emitter/
│   │   │   ├── package.json
│   │   │   └── primus-emitter.js
│   │   ├── primus-spark-latency/
│   │   │   ├── package.json
│   │   │   └── primus-spark-latency.js
│   │   ├── publicsuffixlist/
│   │   │   ├── package.json
│   │   │   └── publicsuffixlist.js
│   │   ├── pug/
│   │   │   ├── package.json
│   │   │   └── pug.js
│   │   ├── punt/
│   │   │   ├── package.json
│   │   │   ├── punt.js
│   │   │   └── punt@1.0.1.js
│   │   ├── puppeteer/
│   │   │   ├── package.json
│   │   │   ├── puppeteer.js
│   │   │   └── puppeteer.meta.js
│   │   ├── pwd/
│   │   │   ├── package.json
│   │   │   ├── pwd.js
│   │   │   └── pwd@0.0.4.js
│   │   ├── q/
│   │   │   ├── package.json
│   │   │   └── q.js
│   │   ├── raven/
│   │   │   ├── package.json
│   │   │   └── raven.js
│   │   ├── rc/
│   │   │   ├── .fixture.for.rc
│   │   │   ├── package.json
│   │   │   ├── rc.config.json
│   │   │   └── rc.js
│   │   ├── readable-stream/
│   │   │   ├── package.json
│   │   │   └── readable-stream.js
│   │   ├── rechoir/
│   │   │   ├── fixture.coffee
│   │   │   ├── package.json
│   │   │   ├── rechoir.config.json
│   │   │   ├── rechoir.js
│   │   │   └── rechoir.meta.js
│   │   ├── redis/
│   │   │   ├── package.json
│   │   │   ├── redis.js
│   │   │   ├── redis@1.0.0.js
│   │   │   ├── redis@2.0.1.js
│   │   │   ├── redis@2.1.0.js
│   │   │   ├── redis@2.2.5.js
│   │   │   ├── redis@2.3.1.js
│   │   │   └── redis@2.4.2.js
│   │   ├── redis-parser/
│   │   │   ├── package.json
│   │   │   └── redis-parser.js
│   │   ├── redis-with-hiredis/
│   │   │   ├── package.json
│   │   │   ├── redis.js
│   │   │   ├── redis.meta.js
│   │   │   ├── redis@1.0.0.js
│   │   │   ├── redis@1.0.0.meta.js
│   │   │   ├── redis@2.0.1.js
│   │   │   ├── redis@2.0.1.meta.js
│   │   │   ├── redis@2.1.0.js
│   │   │   ├── redis@2.1.0.meta.js
│   │   │   ├── redis@2.2.5.js
│   │   │   ├── redis@2.2.5.meta.js
│   │   │   ├── redis@2.3.1.js
│   │   │   ├── redis@2.3.1.meta.js
│   │   │   ├── redis@2.4.2.js
│   │   │   └── redis@2.4.2.meta.js
│   │   ├── regression/
│   │   │   ├── package.json
│   │   │   ├── regression.js
│   │   │   └── regression@1.4.0.js
│   │   ├── reload/
│   │   │   ├── package.json
│   │   │   ├── reload.js
│   │   │   ├── reload.meta.js
│   │   │   ├── reload@2.1.0.js
│   │   │   └── reload@2.1.0.meta.js
│   │   ├── request/
│   │   │   ├── package.json
│   │   │   └── request.js
│   │   ├── require-uncached/
│   │   │   ├── package.json
│   │   │   └── require-uncached.js
│   │   ├── require_optional/
│   │   │   ├── package.json
│   │   │   ├── require_optional.config.json
│   │   │   └── require_optional.js
│   │   ├── s3/
│   │   │   ├── package.json
│   │   │   └── s3.js
│   │   ├── safe_datejs/
│   │   │   ├── package.json
│   │   │   └── safe_datejs.js
│   │   ├── sails/
│   │   │   ├── package.json
│   │   │   ├── sails.js
│   │   │   └── sails.meta.js
│   │   ├── sax/
│   │   │   ├── package.json
│   │   │   └── sax.js
│   │   ├── scrypt/
│   │   │   ├── package.json
│   │   │   ├── scrypt.js
│   │   │   ├── scrypt.meta.js
│   │   │   ├── scrypt@5.4.1.js
│   │   │   └── scrypt@5.4.1.meta.js
│   │   ├── semver/
│   │   │   ├── package.json
│   │   │   └── semver.js
│   │   ├── sequelize/
│   │   │   ├── package.json
│   │   │   ├── sequelize.config.json
│   │   │   ├── sequelize.js
│   │   │   ├── sequelize.meta.js
│   │   │   ├── sequelize@3.30.4.config.json
│   │   │   ├── sequelize@3.30.4.js
│   │   │   └── sequelize@3.30.4.meta.js
│   │   ├── serialport/
│   │   │   ├── package.json
│   │   │   ├── serialport.js
│   │   │   └── serialport.meta.js
│   │   ├── sha3/
│   │   │   ├── package.json
│   │   │   ├── sha3.js
│   │   │   └── sha3.meta.js
│   │   ├── sharp/
│   │   │   ├── package.json
│   │   │   ├── sharp.js
│   │   │   └── sharp.meta.js
│   │   ├── shelljs/
│   │   │   ├── package.json
│   │   │   ├── shelljs.js
│   │   │   ├── shelljs@0.1.4.js
│   │   │   ├── shelljs@0.6.0.js
│   │   │   └── shelljs@0.7.6.js
│   │   ├── sinon/
│   │   │   ├── package.json
│   │   │   ├── sinon.js
│   │   │   └── sinon@1.1.0.js
│   │   ├── socket.io/
│   │   │   ├── package.json
│   │   │   ├── socket.io.js
│   │   │   ├── socket.io@1.4.8.js
│   │   │   ├── socket.io@1.6.0.js
│   │   │   └── socket.io@1.7.0.js
│   │   ├── socket.io-client/
│   │   │   ├── package.json
│   │   │   ├── socket.io-client.js
│   │   │   ├── socket.io-client@0.9.17.js
│   │   │   ├── socket.io-client@1.0.6.js
│   │   │   └── socket.io-client@1.7.0.js
│   │   ├── sqip/
│   │   │   ├── package.json
│   │   │   └── sqip.js
│   │   ├── sqlite3/
│   │   │   ├── package.json
│   │   │   ├── sqlite3.js
│   │   │   └── sqlite3.meta.js
│   │   ├── stamp.js
│   │   ├── steam/
│   │   │   ├── package.json
│   │   │   ├── steam.js
│   │   │   └── steam.meta.js
│   │   ├── steam-crypto/
│   │   │   ├── package.json
│   │   │   └── steam-crypto.js
│   │   ├── stripe/
│   │   │   ├── package.json
│   │   │   ├── stripe.js
│   │   │   └── stripe@3.9.0.js
│   │   ├── stripe-webhook-middleware/
│   │   │   ├── package.json
│   │   │   └── stripe-webhook-middleware.js
│   │   ├── strong-globalize/
│   │   │   ├── package.json
│   │   │   └── strong-globalize.js
│   │   ├── stylus/
│   │   │   ├── external.css
│   │   │   ├── package.json
│   │   │   ├── stylus.config.json
│   │   │   └── stylus.js
│   │   ├── supervisor/
│   │   │   ├── fixture.js
│   │   │   ├── package.json
│   │   │   ├── supervisor.js
│   │   │   └── supervisor.meta.js
│   │   ├── svgo/
│   │   │   ├── package.json
│   │   │   └── svgo.js
│   │   ├── tabtab/
│   │   │   ├── package.json
│   │   │   └── tabtab.js
│   │   ├── tesseract.js/
│   │   │   ├── package.json
│   │   │   ├── tesseract.js.js
│   │   │   └── tesseract.js.meta.js
│   │   ├── throng/
│   │   │   ├── package.json
│   │   │   ├── throng.js
│   │   │   └── throng.meta.js
│   │   ├── time/
│   │   │   ├── package.json
│   │   │   ├── time.js
│   │   │   └── time.meta.js
│   │   ├── times.js
│   │   ├── tinify/
│   │   │   ├── package.json
│   │   │   └── tinify.js
│   │   ├── tiny-worker/
│   │   │   ├── fixture.js
│   │   │   ├── package.json
│   │   │   └── tiny-worker.js
│   │   ├── tmp/
│   │   │   ├── package.json
│   │   │   └── tmp.js
│   │   ├── transformers/
│   │   │   ├── package.json
│   │   │   └── transformers.js
│   │   ├── uglify-js/
│   │   │   ├── package.json
│   │   │   ├── uglify-js.js
│   │   │   └── uglify-js@2.7.5.js
│   │   ├── umd/
│   │   │   ├── package.json
│   │   │   ├── umd.js
│   │   │   └── umd@2.1.0.js
│   │   ├── underscore/
│   │   │   ├── package.json
│   │   │   └── underscore.js
│   │   ├── union/
│   │   │   ├── package.json
│   │   │   └── union.js
│   │   ├── update-notifier/
│   │   │   ├── package.json
│   │   │   ├── update-notifier.js
│   │   │   └── update-notifier.meta.js
│   │   ├── usage/
│   │   │   ├── package.json
│   │   │   ├── usage.js
│   │   │   └── usage.meta.js
│   │   ├── v8flags/
│   │   │   ├── package.json
│   │   │   ├── v8flags.js
│   │   │   └── v8flags@2.1.1.js
│   │   ├── verror/
│   │   │   ├── package.json
│   │   │   └── verror.js
│   │   ├── voc/
│   │   │   ├── package.json
│   │   │   └── voc.js
│   │   ├── webdriverio/
│   │   │   ├── package.json
│   │   │   └── webdriverio.js
│   │   ├── winston/
│   │   │   ├── package.json
│   │   │   └── winston.js
│   │   ├── winston-uber/
│   │   │   ├── package.json
│   │   │   └── winston-uber.js
│   │   ├── ws/
│   │   │   ├── package.json
│   │   │   ├── ws.js
│   │   │   └── ws@0.5.0.js
│   │   ├── xlsx/
│   │   │   ├── ffc.ods
│   │   │   ├── package.json
│   │   │   ├── registry.xls
│   │   │   └── xlsx.js
│   │   ├── xml2js/
│   │   │   ├── package.json
│   │   │   └── xml2js.js
│   │   ├── yargs/
│   │   │   ├── package.json
│   │   │   └── yargs.js
│   │   └── zeromq/
│   │       ├── package.json
│   │       ├── zeromq.js
│   │       └── zeromq.meta.js
│   ├── test-80-compression/
│   │   ├── .gitignore
│   │   ├── main.js
│   │   ├── test-empty.js
│   │   └── test-x.js
│   ├── test-80-compression-node-opcua/
│   │   ├── .gitignore
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── test-empty.js
│   │   ├── test-x.js
│   │   └── test-y.js
│   ├── test-80-compression-various-file-access/
│   │   ├── main.js
│   │   ├── myfile.txt
│   │   ├── package.json
│   │   ├── test.js
│   │   └── test_with_new_fs_promises.js
│   ├── test-99-#1120-mkdir-mountpoints/
│   │   ├── main.js
│   │   └── test-x-index.js
│   ├── test-99-#1121-regexp-mountpoints/
│   │   ├── main.js
│   │   ├── plugins-D-ext/
│   │   │   └── test-y-require-D.js
│   │   └── test-x-index.js
│   ├── test-99-#1130/
│   │   ├── .gitignore
│   │   ├── files/
│   │   │   ├── a.js
│   │   │   └── b.js
│   │   ├── main.js
│   │   ├── package.json
│   │   └── read.js
│   ├── test-99-#1135/
│   │   ├── .gitignore
│   │   ├── index.js
│   │   ├── main.js
│   │   └── package.json
│   ├── test-99-#1191/
│   │   ├── .gitignore
│   │   ├── index.js
│   │   ├── main.js
│   │   └── package.json
│   ├── test-99-#1192/
│   │   ├── .gitignore
│   │   ├── main.js
│   │   ├── package.json
│   │   ├── public/
│   │   │   └── views/
│   │   │       └── index.pug
│   │   └── src/
│   │       └── index.js
│   ├── test-99-#1207/
│   │   ├── .gitignore
│   │   ├── index.js
│   │   └── main.js
│   ├── test-99-#1505/
│   │   ├── .gitignore
│   │   ├── files/
│   │   │   └── test.txt
│   │   ├── main.js
│   │   ├── package.json
│   │   └── stat.js
│   ├── test-99-#1861/
│   │   ├── index.js
│   │   ├── launch.bat
│   │   └── main.js
│   ├── test-99-#420-copy-from-snapshot/
│   │   ├── .gitignore
│   │   ├── copy.js
│   │   ├── input/
│   │   │   └── test.json
│   │   ├── main.js
│   │   └── package.json
│   ├── test-99-#775/
│   │   ├── a.js
│   │   ├── b.js
│   │   ├── main.js
│   │   └── package.json
│   ├── test-99-#938-withfiletypes/
│   │   ├── .gitignore
│   │   ├── main.js
│   │   ├── package.json
│   │   └── read.js
│   ├── test.js
│   └── utils.js
└── tsconfig.json
Download .txt
SYMBOL INDEX (310 symbols across 59 files)

FILE: lib/bin.ts
  function main (line 6) | async function main() {

FILE: lib/chmod.ts
  function plusx (line 3) | async function plusx(file: string) {

FILE: lib/common.ts
  constant STORE_BLOB (line 5) | const STORE_BLOB = 0;
  constant STORE_CONTENT (line 6) | const STORE_CONTENT = 1;
  constant STORE_LINKS (line 7) | const STORE_LINKS = 2;
  constant STORE_STAT (line 8) | const STORE_STAT = 3;
  constant ALIAS_AS_RELATIVE (line 9) | const ALIAS_AS_RELATIVE = 0;
  constant ALIAS_AS_RESOLVABLE (line 10) | const ALIAS_AS_RESOLVABLE = 1;
  function uppercaseDriveLetter (line 15) | function uppercaseDriveLetter(f: string) {
  function removeTrailingSlashes (line 20) | function removeTrailingSlashes(f: string) {
  function pathToString (line 49) | function pathToString(p: string | URL | Buffer, win: boolean): string {
  function isRootPath (line 63) | function isRootPath(p: string | URL | Buffer) {
  function normalizePath (line 73) | function normalizePath(f: string | URL | Buffer) {
  function isPackageJson (line 87) | function isPackageJson(file: string) {
  function isDotJS (line 91) | function isDotJS(file: string) {
  function isDotJSON (line 95) | function isDotJSON(file: string) {
  function isDotNODE (line 99) | function isDotNODE(file: string) {
  function replaceSlashes (line 103) | function replaceSlashes(file: string, slash: string) {
  function injectSnapshot (line 117) | function injectSnapshot(file: string) {
  function longestCommonLength (line 141) | function longestCommonLength(s1: string, s2: string) {
  function withoutNodeModules (line 153) | function withoutNodeModules(file: string) {
  function retrieveDenominator (line 157) | function retrieveDenominator(files: string[]) {
  function substituteDenominator (line 174) | function substituteDenominator(f: string, denominator: number) {
  function snapshotify (line 179) | function snapshotify(file: string, slash: string) {
  function insideSnapshot (line 183) | function insideSnapshot(f: Buffer | string | URL) {
  function stripSnapshot (line 208) | function stripSnapshot(f: string) {
  function removeUplevels (line 230) | function removeUplevels(f: string) {
  function toNormalizedRealPath (line 258) | function toNormalizedRealPath(requestPath: string) {

FILE: lib/compress_type.ts
  type CompressType (line 1) | enum CompressType {

FILE: lib/detector.ts
  function isLiteral (line 8) | function isLiteral(node: babelTypes.Node): node is babelTypes.Literal {
  function getLiteralValue (line 24) | function getLiteralValue(node: babelTypes.Literal) {
  function reconstructSpecifiers (line 40) | function reconstructSpecifiers(
  function reconstruct (line 82) | function reconstruct(node: babelTypes.Node) {
  type Was (line 99) | interface Was {
  function forge (line 105) | function forge(pattern: string, was: Was) {
  function valid2 (line 115) | function valid2(v2?: Was['v2']) {
  function visitorRequireResolve (line 124) | function visitorRequireResolve(n: babelTypes.Node) {
  function visitorRequire (line 153) | function visitorRequire(n: babelTypes.Node) {
  function visitorImport (line 176) | function visitorImport(n: babelTypes.Node) {
  function visitorPathJoin (line 184) | function visitorPathJoin(n: babelTypes.Node) {
  function visitorSuccessful (line 224) | function visitorSuccessful(node: babelTypes.Node, test = false) {
  function nonLiteralRequireResolve (line 286) | function nonLiteralRequireResolve(n: babelTypes.Node) {
  function nonLiteralRequire (line 325) | function nonLiteralRequire(n: babelTypes.Node) {
  function visitorNonLiteral (line 358) | function visitorNonLiteral(n: babelTypes.Node) {
  function isRequire (line 376) | function isRequire(n: babelTypes.Node) {
  function isRequireResolve (line 398) | function isRequireResolve(n: babelTypes.Node) {
  function visitorMalformed (line 426) | function visitorMalformed(n: babelTypes.Node) {
  function visitorUseSCWD (line 436) | function visitorUseSCWD(n: babelTypes.Node) {
  type VisitorFunction (line 464) | type VisitorFunction = (node: babelTypes.Node, trying?: boolean) => bool...
  function traverse (line 466) | function traverse(ast: babelTypes.File, visitor: VisitorFunction) {
  function parse (line 498) | function parse(body: string) {
  function detect (line 505) | function detect(body: string, visitor: VisitorFunction) {

FILE: lib/fabricator.ts
  function fabricate (line 49) | function fabricate(
  function fabricateTwice (line 152) | function fabricateTwice(
  function shutdown (line 169) | function shutdown() {

FILE: lib/follow.ts
  constant PROOF (line 8) | const PROOF = 'a-proof-that-main-is-captured.js';
  function parentDirectoriesContain (line 10) | function parentDirectoriesContain(parent: string, directory: string) {
  type FollowOptions (line 28) | interface FollowOptions extends Pick<SyncOpts, 'basedir' | 'extensions'> {
  function follow (line 34) | function follow(x: string, opts: FollowOptions) {

FILE: lib/help.ts
  function help (line 3) | function help() {

FILE: lib/index.ts
  function isConfiguration (line 35) | function isConfiguration(file: string) {
  function parseTargets (line 53) | function parseTargets(items: string[]): NodeTarget[] {
  function stringifyTarget (line 98) | function stringifyTarget(target: NodeTarget) {
  type DifferentResult (line 103) | interface DifferentResult {
  function differentParts (line 109) | function differentParts(targets: NodeTarget[]): DifferentResult {
  function stringifyTargetForOutput (line 137) | function stringifyTargetForOutput(
  function fabricatorForTarget (line 159) | function fabricatorForTarget({ nodeRange, arch }: NodeTarget) {
  function needWithDryRun (line 180) | async function needWithDryRun({
  function needViaCache (line 199) | async function needViaCache(target: NodeTarget) {
  function exec (line 221) | async function exec(argv2: string[]) {

FILE: lib/mach-o.ts
  function parseCStr (line 3) | function parseCStr(buf: Buffer) {
  function patchCommand (line 11) | function patchCommand(type: number, buf: Buffer, file: Buffer) {
  function patchMachOExecutable (line 35) | function patchMachOExecutable(file: Buffer) {
  function signMachOExecutable (line 60) | function signMachOExecutable(executable: string) {

FILE: lib/packer.ts
  function itemsToText (line 34) | function itemsToText<T extends unknown>(items: T[]) {
  function hasAnyStore (line 39) | function hasAnyStore(record: FileRecord) {
  type PackerOptions (line 47) | interface PackerOptions {
  type Stripe (line 54) | interface Stripe {
  function packer (line 62) | function packer({

FILE: lib/producer.ts
  type NotFound (line 18) | interface NotFound {
  type Placeholder (line 22) | interface Placeholder {
  type PlaceholderTypes (line 28) | type PlaceholderTypes =
  type PlaceholderMap (line 34) | type PlaceholderMap = Record<PlaceholderTypes, Placeholder | NotFound>;
  function discoverPlaceholder (line 36) | function discoverPlaceholder(
  function injectPlaceholder (line 51) | function injectPlaceholder(
  function discoverPlaceholders (line 82) | function discoverPlaceholders(binaryBuffer: Buffer) {
  function injectPlaceholders (line 104) | function injectPlaceholders(
  function makeBakeryValueFromBakes (line 157) | function makeBakeryValueFromBakes(bakes: string[]) {
  function replaceDollarWise (line 172) | function replaceDollarWise(s: string, sf: string, st: string) {
  function makePreludeBufferFromPrelude (line 176) | function makePreludeBufferFromPrelude(prelude: string) {
  function findPackageJson (line 182) | function findPackageJson(nodeFile: string) {
  function nativePrebuildInstall (line 200) | function nativePrebuildInstall(target: Target, nodeFile: string) {
  type ProducerOptions (line 252) | interface ProducerOptions {
  function getOrCreateHash (line 295) | function getOrCreateHash(fileOrFolderName: string) {
  function makeKey (line 307) | function makeKey(
  function producer (line 316) | function producer({

FILE: lib/refiner.ts
  function hasParent (line 13) | function hasParent(file: string, records: FileRecords) {
  function purgeTopDirectories (line 24) | function purgeTopDirectories(records: FileRecords) {
  function denominate (line 59) | function denominate(
  function refiner (line 102) | function refiner(

FILE: lib/types.ts
  type FileRecord (line 3) | interface FileRecord {
  type FileRecords (line 12) | type FileRecords = Record<string, FileRecord>;
  type License (line 14) | type License =
  type Patches (line 20) | type Patches = Record<
  type ConfigDictionary (line 25) | type ConfigDictionary = Record<
  type PkgOptions (line 35) | interface PkgOptions {
  type PackageJson (line 44) | interface PackageJson {
  type NodeTarget (line 61) | interface NodeTarget {
  type Target (line 68) | interface Target extends NodeTarget {
  type SymLinks (line 74) | type SymLinks = Record<string, string>;

FILE: lib/walker.ts
  type Marker (line 37) | interface Marker {
  type Task (line 48) | interface Task {
  type Derivative (line 56) | interface Derivative {
  function unlikelyJavascript (line 75) | function unlikelyJavascript(file: string) {
  function isPublic (line 79) | function isPublic(config: PackageJson) {
  function upon (line 156) | function upon(p: string, base: string) {
  function collect (line 181) | function collect(ps: string[]) {
  function expandFiles (line 185) | function expandFiles(efs: string | string[], base: string) {
  function stepRead (line 195) | async function stepRead(record: FileRecord) {
  function stepStrip (line 213) | function stepStrip(record: FileRecord) {
  function stepDetect (line 227) | function stepDetect(
  function findCommonJunctionPoint (line 305) | function findCommonJunctionPoint(file: string, realFile: string) {
  type WalkerParams (line 315) | interface WalkerParams {
  class Walker (line 321) | class Walker {
    method constructor (line 334) | constructor() {
    method appendRecord (line 343) | appendRecord({ file, store }: Task) {
    method append (line 362) | private append(task: Task) {
    method appendSymlink (line 387) | appendSymlink(file: string, realFile: string) {
    method appendStat (line 418) | appendStat(task: Task) {
    method appendFileInFolder (line 423) | appendFileInFolder(task: Task) {
    method appendBlobOrContent (line 444) | appendBlobOrContent(task: Task) {
    method appendFilesFromConfig (line 466) | async appendFilesFromConfig(marker: Marker) {
    method stepActivate (line 551) | async stepActivate(marker: Marker, derivatives: Derivative[]) {
    method hasPatch (line 662) | hasPatch(record: FileRecord) {
    method stepPatch (line 672) | stepPatch(record: FileRecord) {
    method stepDerivatives_ALIAS_AS_RELATIVE (line 702) | async stepDerivatives_ALIAS_AS_RELATIVE(
    method stepDerivatives_ALIAS_AS_RESOLVABLE (line 736) | async stepDerivatives_ALIAS_AS_RESOLVABLE(
    method stepDerivatives (line 842) | async stepDerivatives(
    method step_STORE_ANY (line 872) | async step_STORE_ANY(record: FileRecord, marker: Marker, store: number) {
    method step_STORE_LINKS (line 927) | step_STORE_LINKS(record: FileRecord, data: unknown) {
    method step_STORE_STAT (line 951) | async step_STORE_STAT(record: FileRecord) {
    method step (line 990) | async step(task: Task) {
    method readDictionary (line 1011) | async readDictionary(marker: Marker) {
    method start (line 1046) | async start(
  function walker (line 1090) | async function walker(...args: Parameters<Walker['start']>) {

FILE: prelude/bootstrap.js
  constant FLAG_ENABLE_PROJECT (line 51) | let FLAG_ENABLE_PROJECT = false;
  constant NODE_VERSION_MAJOR (line 52) | const NODE_VERSION_MAJOR = process.version.match(/^v(\d+)/)[1] | 0;
  constant NODE_VERSION_MINOR (line 53) | const NODE_VERSION_MINOR = process.version.match(/^v\d+.(\d+)/)[1] | 0;
  constant ARGV0 (line 61) | const ARGV0 = process.argv[0];
  constant EXECPATH (line 62) | const EXECPATH = process.execPath;
  constant ENTRYPOINT (line 63) | let ENTRYPOINT = process.argv[1];
  constant EXECSTAT (line 95) | const EXECSTAT = fs.statSync(EXECPATH);
  function insideMountpoint (line 108) | function insideMountpoint(f) {
  function readdirMountpoints (line 128) | function readdirMountpoints(path_) {
  function translate (line 140) | function translate(f) {
  function cloneArgs (line 146) | function cloneArgs(args_) {
  function translateNth (line 150) | function translateNth(args_, index, f) {
  function createMountpoint (line 156) | function createMountpoint(interior, exterior) {
  constant DEFAULT_COPY_CHUNK_SIZE (line 161) | const DEFAULT_COPY_CHUNK_SIZE = 10 * 1024 * 1024;
  function copyInChunks (line 162) | function copyInChunks(
  function copyFolderRecursiveSync (line 183) | function copyFolderRecursiveSync(source, target) {
  function createDirRecursively (line 252) | function createDirRecursively(dir) {
  function replace (line 289) | function replace(k) {
  function findVirtualFileSystemKey (line 301) | function findVirtualFileSystemKey(path_, slash) {
  function toOriginal (line 314) | function toOriginal(fShort) {
  function findVirtualFileSystemKeyAndFollowLinks (line 329) | function findVirtualFileSystemKeyAndFollowLinks(path_) {
  function realpathFromSnapshot (line 345) | function realpathFromSnapshot(path_) {
  function findVirtualFileSystemEntry (line 350) | function findVirtualFileSystemEntry(path_) {
  function projectToFilesystem (line 361) | function projectToFilesystem(f) {
  function projectToNearby (line 387) | function projectToNearby(f) {
  function findNativeAddonSyncFreeFromRequire (line 390) | function findNativeAddonSyncFreeFromRequire(path_) {
  function findNativeAddonSyncUnderRequire (line 403) | function findNativeAddonSyncUnderRequire(path_) {
  function asap (line 412) | function asap(cb) {
  function dezalgo (line 416) | function dezalgo(cb) {
  function rethrow (line 436) | function rethrow(error, arg) {
  function readPayload (line 448) | function readPayload(buffer, offset, length, position, callback) {
  function readPayloadSync (line 459) | function readPayloadSync(buffer, offset, length, position) {
  function payloadCopyUni (line 469) | function payloadCopyUni(
  function payloadCopyMany (line 495) | function payloadCopyMany(source, target, targetStart, sourceStart, cb) {
  function payloadCopyManySync (line 517) | function payloadCopyManySync(source, target, targetStart, sourceStart) {
  constant GZIP (line 534) | const GZIP = 1;
  constant BROTLI (line 535) | const BROTLI = 2;
  function payloadFile (line 536) | function payloadFile(pointer, cb) {
  function payloadFileSync (line 556) | function payloadFileSync(pointer) {
  function assertEncoding (line 644) | function assertEncoding(encoding) {
  function maybeCallback (line 650) | function maybeCallback(args) {
  function error_ENOENT (line 655) | function error_ENOENT(fileOrDirectory, path_) {
  function error_EISDIR (line 668) | function error_EISDIR(path_) {
  function error_ENOTDIR (line 677) | function error_ENOTDIR(path_) {
  function removeTemporaryFolderAndContent (line 690) | function removeTemporaryFolderAndContent(folder) {
  function deflateSync (line 712) | function deflateSync(snapshotFilename) {
  function uncompressExternallyPath (line 739) | function uncompressExternallyPath(path_) {
  function uncompressExternallyAndOpen (line 745) | function uncompressExternallyAndOpen(dock) {
  function openFromSnapshot (line 751) | function openFromSnapshot(path_, uncompress, cb) {
  function readFromSnapshotSub (line 815) | function readFromSnapshotSub(
  function readFromSnapshot (line 868) | function readFromSnapshot(fd, buffer, offset, length, position, cb) {
  function writeToSnapshot (line 961) | function writeToSnapshot(cb) {
  function readFileOptions (line 1020) | function readFileOptions(options, hasCallback) {
  function readFileFromSnapshotSub (line 1033) | function readFileFromSnapshotSub(entityContent, cb) {
  function readFileFromSnapshot (line 1041) | function readFileFromSnapshot(path_, cb) {
  function _streamCopy (line 1135) | function _streamCopy() {
  function readdirOptions (line 1195) | function readdirOptions(options, hasCallback) {
  function Dirent (line 1208) | function Dirent(name, type) {
  function getFileTypes (line 1230) | function getFileTypes(path_, entries) {
  function readdirRoot (line 1242) | function readdirRoot(path_, options, cb) {
  function readdirFromSnapshotSub (line 1264) | function readdirFromSnapshotSub(entityLinks, path_, cb) {
  function readdirFromSnapshot (line 1276) | function readdirFromSnapshot(path_, cb) {
  function restore (line 1392) | function restore(s) {
  function findNativeAddonForStat (line 1441) | function findNativeAddonForStat(path_, cb) {
  function statFromSnapshotSub (line 1452) | function statFromSnapshotSub(entityStat, cb) {
  function statFromSnapshot (line 1464) | function statFromSnapshot(path_, cb) {
  function fstatFromSnapshot (line 1527) | function fstatFromSnapshot(fd, cb) {
  function findNativeAddonForExists (line 1556) | function findNativeAddonForExists(path_) {
  function existsFromSnapshot (line 1562) | function existsFromSnapshot(path_) {
  function accessFromSnapshot (line 1595) | function accessFromSnapshot(path_, cb) {
  function mkdirFailInSnapshot (line 1629) | function mkdirFailInSnapshot(path_, cb) {
  function makeLong (line 1737) | function makeLong(f) {
  function revertMakingLong (line 1741) | function revertMakingLong(f) {
  function findNativeAddonForInternalModuleStat (line 1746) | function findNativeAddonForInternalModuleStat(path_) {
  function setOptsEnv (line 2000) | function setOptsEnv(args) {
  function startsWith2 (line 2013) | function startsWith2(args, index, name, impostor) {
  function startsWith (line 2031) | function startsWith(args, index, name) {
  function modifyLong (line 2043) | function modifyLong(args, index) {
  function modifyShort (line 2053) | function modifyShort(args) {
  method value (line 2130) | value(path_) {
  function revertMakingLong (line 2194) | function revertMakingLong(f) {

FILE: prelude/diagnostic.js
  function dumpLevel (line 15) | function dumpLevel(filename, level, tree) {
  function wrap (line 45) | function wrap(obj, name) {

FILE: test/test-42-fetch-all/main.js
  function nodeRangeToNodeVersion (line 11) | function nodeRangeToNodeVersion(nodeRange) {

FILE: test/test-42-path-related-values/main.js
  function pad (line 45) | function pad(s, width) {

FILE: test/test-48-common/main.js
  function substituteMany (line 10) | function substituteMany(files) {

FILE: test/test-50-console-trace/main.js
  function extractFileName (line 26) | function extractFileName(line) {

FILE: test/test-50-for-await-of/test-x-index.js
  class AsyncIterator (line 3) | class AsyncIterator {
    method constructor (line 4) | constructor() {
    method next (line 9) | next() {
  method [Symbol.asyncIterator] (line 18) | [Symbol.asyncIterator]() {
  function t (line 25) | async function t() {

FILE: test/test-50-fs-runtime-layer-2/main.js
  function bitty (line 21) | function bitty(version) {

FILE: test/test-50-fs-runtime-layer-2/test-x-index.js
  function dumpError (line 11) | function dumpError(error) {
  function test01 (line 29) | function test01() {
  function test01e (line 109) | function test01e(badFd) {
  function test02 (line 192) | function test02() {
  function test03 (line 209) | function test03() {
  function test04 (line 271) | function test04() {
  function test05 (line 307) | function test05() {
  function test06 (line 331) | function test06() {
  function test07 (line 356) | function test07() {

FILE: test/test-50-fs-runtime-layer-3/test-x-index.js
  function test01 (line 12) | function test01() {
  function test02 (line 32) | function test02() {

FILE: test/test-50-fs-runtime-layer/test-x1-index.js
  function firstLowerCase (line 12) | function firstLowerCase(s) {
  function firstUpperCase (line 16) | function firstUpperCase(s) {

FILE: test/test-50-fs-runtime-layer/test-x2-index.js
  function firstLowerCase (line 13) | function firstLowerCase(s) {
  function firstUpperCase (line 17) | function firstUpperCase(s) {

FILE: test/test-50-fs-runtime-layer/test-x3-index.js
  function firstLowerCase (line 12) | function firstLowerCase(s) {
  function firstUpperCase (line 16) | function firstUpperCase(s) {

FILE: test/test-50-many-arrow-functions/test-x-index.js
  function EventEmitter (line 3) | function EventEmitter() {

FILE: test/test-50-may-exclude/test-x-index.js
  function func1 (line 7) | function func1() {
  function func2 (line 21) | function func2() {

FILE: test/test-50-no-super-in-constructor/test-x-index.js
  class UpnpService (line 6) | class UpnpService {
    method constructor (line 7) | constructor() {

FILE: test/test-50-package-a-binary/test-x-index.js
  function sha256 (line 7) | function sha256(s) {

FILE: test/test-50-package-json-8/sub/sub/test-y-require.js
  function main (line 5) | function main() {

FILE: test/test-50-package-json-8b/sub/sub/test-y-require.js
  function main (line 5) | function main() {

FILE: test/test-50-package-json-8p/sub/sub/test-y-require.js
  function main (line 5) | function main() {

FILE: test/test-50-path-as-buffer/main.js
  function isNode8 (line 19) | function isNode8(version) {

FILE: test/test-50-should-disclose-package/main.js
  function rightReducer (line 17) | function rightReducer(mappy, line, index, right) {

FILE: test/test-50-spawn/main.js
  function rnd (line 16) | function rnd() {
  function stripTraceOpt (line 34) | function stripTraceOpt(lines) {

FILE: test/test-79-npm/any-promise/any-promise.js
  function p (line 5) | function p() {

FILE: test/test-79-npm/connect-mongo/connect-mongo.js
  function Store (line 3) | function Store() {
  function MemoryStore (line 7) | function MemoryStore() {}

FILE: test/test-79-npm/connect-redis/connect-redis.js
  function Store (line 3) | function Store() {
  function MemoryStore (line 7) | function MemoryStore() {}

FILE: test/test-79-npm/express-session/express-session.js
  function genuuid (line 7) | function genuuid() {

FILE: test/test-79-npm/kerberos/kerberos.js
  function isModuleNotFoundError (line 3) | function isModuleNotFoundError(error) {
  function hideTryBlockFromBundleDetectorIgnoreFlag (line 12) | function hideTryBlockFromBundleDetectorIgnoreFlag() {
  function hideTryBlockFromBundleDetectorIgnoreFlag2 (line 27) | function hideTryBlockFromBundleDetectorIgnoreFlag2() {

FILE: test/test-79-npm/main.js
  constant UPM (line 9) | const UPM = process.env.USE_PREINSTALLED_MODULES || false;
  function applyMetaToRight (line 35) | function applyMetaToRight(right, meta) {
  function save (line 51) | function save() {
  function stamp2string (line 71) | function stamp2string(s) {
  function update (line 76) | function update(p, r, v, note) {

FILE: test/test-79-npm/times.js
  function nextJob (line 15) | function nextJob() {
  function queueJob (line 20) | function queueJob(foldyName) {
  function getLatestTime (line 28) | function getLatestTime(foldyName, cb) {

FILE: test/test-79-npm/update-notifier/update-notifier.js
  function runNotifier (line 17) | function runNotifier() {

FILE: test/test-80-compression-node-opcua/main.js
  function pkgCompress (line 73) | function pkgCompress(compressMode, output) {

FILE: test/test-80-compression-various-file-access/main.js
  function runTest (line 17) | async function runTest(input) {

FILE: test/test-80-compression-various-file-access/test.js
  function withReadFileSync (line 9) | function withReadFileSync() {
  function withDirectAccess (line 15) | async function withDirectAccess() {
  function withReadStream (line 29) | async function withReadStream() {
  function withReadStream2 (line 41) | async function withReadStream2() {
  function readbinaryFile (line 52) | async function readbinaryFile() {
  function readbinaryFileWithStream (line 63) | async function readbinaryFileWithStream() {

FILE: test/test-80-compression-various-file-access/test_with_new_fs_promises.js
  constant MAJOR_VERSION (line 6) | const MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10);
  function withPromises (line 18) | async function withPromises() {
  function withPromisesReadFile (line 46) | async function withPromisesReadFile() {
  function withPromiseReadDir (line 57) | async function withPromiseReadDir() {

FILE: test/test-80-compression/main.js
  function pkgCompress (line 40) | function pkgCompress(compressMode, output) {

FILE: test/test-99-#1130/read.js
  function serializeFiles (line 30) | function serializeFiles(files) {

FILE: test/test-99-#1191/main.js
  function doTestWithCompression (line 48) | function doTestWithCompression() {
  function doTestNoCompression (line 63) | function doTestNoCompression() {

FILE: test/test-99-#1192/main.js
  function runTest (line 53) | function runTest(doCompress) {

FILE: test/test-99-#1505/stat.js
  function test (line 16) | async function test() {
  function serialize (line 27) | function serialize(result) {

FILE: test/test-99-#775/a.js
  constant MAJOR_VERSION (line 6) | const MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10);

FILE: test/test-99-#775/main.js
  constant MAJOR_VERSION (line 13) | const MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10);

FILE: test/test-99-#938-withfiletypes/read.js
  function isLastEntryString (line 5) | function isLastEntryString(files) {
  function isLastEntryDirent (line 10) | function isLastEntryDirent(files) {

FILE: test/test.js
  function joinAndForward (line 43) | function joinAndForward(d) {
Condensed preview — 1427 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,406K chars).
[
  {
    "path": ".eslintignore",
    "chars": 26,
    "preview": "lib-es5\nnode_modules\ndist\n"
  },
  {
    "path": ".eslintrc",
    "chars": 2073,
    "preview": "{\n  \"extends\": [\"airbnb-base\", \"prettier\"],\n  \"rules\": {\n    \"no-bitwise\": \"off\",\n    \"no-continue\": \"off\",\n    \"no-awai"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/01_bug_report.yml",
    "chars": 2628,
    "preview": "name: 🐞 Bug Report\ndescription: Create a bug report for pkg\nlabels: 'template: bug'\nbody:\n  - type: markdown\n    attribu"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/02_regression.yml",
    "chars": 2861,
    "preview": "name: ⏮️ Regression report\ndescription: Report a bug not seen in an earlier version of pkg\nlabels: 'template: regression"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 242,
    "preview": "contact_links:\n  - name: 💡 Feature Request\n    url: https://github.com/vercel/pkg/discussions/new\n    about: Share ideas"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 753,
    "preview": "name: CI\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  test:\n    strategy:\n      fail-fast: false # p"
  },
  {
    "path": ".github/workflows/close-stale.yml",
    "chars": 1144,
    "preview": "name: 'Close stale issues'\non:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    steps:"
  },
  {
    "path": ".gitignore",
    "chars": 293,
    "preview": "# build output\n/lib-es5\n\n# dependencies\n/node_modules\n\n# logs\nnpm-debug.log\n\n# General macOS\n.DS_Store\nexamples/.DS_Stor"
  },
  {
    "path": ".prettierignore",
    "chars": 8,
    "preview": "lib-es5/"
  },
  {
    "path": ".yarnrc",
    "chars": 15,
    "preview": "save-prefix \"\"\n"
  },
  {
    "path": "LICENSE",
    "chars": 1079,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2021 Vercel, Inc.\n\nPermission is hereby granted, free of charge, to any person obta"
  },
  {
    "path": "README.md",
    "chars": 18301,
    "preview": "# `pkg`\n\n> [!IMPORTANT]  \n> `pkg` has been deprecated with `5.8.1` as the last release. There are a number of successful"
  },
  {
    "path": "dictionary/.eslintrc.json",
    "chars": 56,
    "preview": "{\n  \"parserOptions\": {\n    \"sourceType\": \"script\"\n  }\n}\n"
  },
  {
    "path": "dictionary/angular-bridge.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/any-promise.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/async.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/aws-sdk.js",
    "chars": 102,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['apis/*.json', 'lib/services/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/babel-core.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/batch.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/bcrypt.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/better-sqlite3.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/bignum.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/bindings.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/blessed.js",
    "chars": 132,
    "preview": "'use strict';\n\n// https://github.com/chjj/blessed/issues/298\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/widgets/*.js"
  },
  {
    "path": "dictionary/body-parser.js",
    "chars": 113,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: [\n      'lib/types/*.js', // for 1.4-1.13\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/browserify.js",
    "chars": 78,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['bin/*.txt'],\n  },\n};\n"
  },
  {
    "path": "dictionary/bson.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/buffermaker.js",
    "chars": 78,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/bunyan.js",
    "chars": 149,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/bunyan.js': [\"mv = require('mv' + '');\", \"mv = requ"
  },
  {
    "path": "dictionary/busboy.js",
    "chars": 84,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/types/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/bytes.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/callsites.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/chokidar.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/coffee-script.js",
    "chars": 92,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/coffee-script/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/colors.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/compression.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/compressjs.js",
    "chars": 78,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/connect-mongo.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/connect-mongodb.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/connect-redis.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/connect.js",
    "chars": 154,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/middleware/*.js'],\n    assets: [\n      'lib/public/**/*', "
  },
  {
    "path": "dictionary/consolidate.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cookie-parser.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cookie.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cors.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cron.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cross-env.js",
    "chars": 243,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      // author is mistaken to point package.json.main to\n    "
  },
  {
    "path": "dictionary/cross-spawn-async.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/curve25519.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/data-preflight.js",
    "chars": 102,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['src/view/**/*', 'src/js/view/**/*'],\n  },\n};\n"
  },
  {
    "path": "dictionary/debug.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/denymount.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/diff.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/drivelist.js",
    "chars": 626,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'build/scripts.js': [\n        \"path.join(__dirname, '..'"
  },
  {
    "path": "dictionary/ed25519.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/ejs.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/elasticsearch.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/electron.js",
    "chars": 419,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        'path.join(__dirname, fs',\n       "
  },
  {
    "path": "dictionary/emailjs.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/engine.io.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/epoll.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/errorhandler.js",
    "chars": 80,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['public/**/*'],\n  },\n};\n"
  },
  {
    "path": "dictionary/errors.js",
    "chars": 81,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/static/*'],\n  },\n};\n"
  },
  {
    "path": "dictionary/eslint.js",
    "chars": 107,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/rules/*.js', 'lib/formatters/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/etcher-image-write.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/exceljs.js",
    "chars": 539,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: [\n      // TODO look at exceljs and implement as\n      // many __"
  },
  {
    "path": "dictionary/exiftool.exe.js",
    "chars": 289,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"path.join(__dirname, 'vendor', 'e"
  },
  {
    "path": "dictionary/exiftool.pl.js",
    "chars": 273,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"path.join(__dirname, 'vendor', 'e"
  },
  {
    "path": "dictionary/express-load.js",
    "chars": 193,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/express-load.js': [\n        'entity = path.resolve("
  },
  {
    "path": "dictionary/express-session.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/express.js",
    "chars": 318,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/view.js': [\n        'path = join(this.root, path)',"
  },
  {
    "path": "dictionary/extender.js",
    "chars": 359,
    "preview": "'use strict';\n\nmodule.exports = {\n  // в declare.js грязный хак.\n  // если в тексте(!) функции есть подстрока \"super\"\n  "
  },
  {
    "path": "dictionary/extsprintf.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/faye-websocket.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/feathers.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/findup-sync.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/floordate.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/fmt.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/formidable.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/fs-extra.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/fsevents.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/geoip-lite.js",
    "chars": 75,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['data/*'],\n  },\n};\n"
  },
  {
    "path": "dictionary/github.js",
    "chars": 84,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/routes.json'],\n  },\n};\n"
  },
  {
    "path": "dictionary/gm.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/google-closure-compiler-java.js",
    "chars": 309,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"require.resolve('./compiler.jar')"
  },
  {
    "path": "dictionary/google-closure-compiler.js",
    "chars": 333,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/node/closure-compiler.js': [\n        \"require.resol"
  },
  {
    "path": "dictionary/googleapis.js",
    "chars": 82,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['apis/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/got.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/graceful-fs.js",
    "chars": 466,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'graceful-fs.js': [\n        { do: 'prepend' },\n        '"
  },
  {
    "path": "dictionary/grpc.js",
    "chars": 199,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    files: [\n      // suppress because hundreds of\n      // C++ files go insi"
  },
  {
    "path": "dictionary/gulp.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/hap-nodejs.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/heapdump.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/hoek.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/homebridge.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/http-proxy.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/http-server.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/image-size.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/indexof.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/inquirer.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/j.js",
    "chars": 271,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'j.js': [\n        \"require('xl'+'sx')\",\n        \"require"
  },
  {
    "path": "dictionary/jade.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/jsdom.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/json-stringify-date.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/json-stringify-safe.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/jsonwebtoken.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/kerberos.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/knex.js",
    "chars": 81,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/later.js",
    "chars": 78,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['later.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/level.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/leveldown.js",
    "chars": 213,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'binding.js': ['__dirname', \"require('path').dirname(pro"
  },
  {
    "path": "dictionary/levelup.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/liftoff.js",
    "chars": 290,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        'resolve.sync(this.moduleName, {ba"
  },
  {
    "path": "dictionary/lodash.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/log4js.js",
    "chars": 88,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/appenders/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/logform.js",
    "chars": 74,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/machinepack-urls.js",
    "chars": 83,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['machines/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/markdown.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/mdns.js",
    "chars": 107,
    "preview": "'use strict';\n\nmodule.exports = {\n  // хоть bindings и объявлен в\n  // dependencies, но не используется\n};\n"
  },
  {
    "path": "dictionary/method-override.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/microjob.js",
    "chars": 413,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'dist/worker-pool.js': [\n        'error.stack = message."
  },
  {
    "path": "dictionary/mime-types.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/mime.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/minimatch.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/minstache.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/module-deps.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/moment-timezone.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/moment.js",
    "chars": 81,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['locale/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/mongodb-core.js",
    "chars": 651,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/error.js': [\n        'return err;',\n        'if (er"
  },
  {
    "path": "dictionary/mongodb.js",
    "chars": 89,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/mongodb/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/mongoose.js",
    "chars": 106,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/drivers/node-mongodb-native/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/mongoskin.js",
    "chars": 81,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/ms.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/msgpack.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/multer.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/muri.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/native-or-bluebird.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/natives.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/nconf.js",
    "chars": 91,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/nconf/stores/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/nedb.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/negotiator.js",
    "chars": 78,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/newrelic.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/nib.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/nightmare.js",
    "chars": 459,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/nightmare.js': [\n        \"path.join(__dirname, 'run"
  },
  {
    "path": "dictionary/node-forge.js",
    "chars": 89,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['js/*.js', 'lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/node-libcurl.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-notifier.js",
    "chars": 1035,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'notifiers/balloon.js': [\n        \"__dirname, '../vendor"
  },
  {
    "path": "dictionary/node-pre-gyp.js",
    "chars": 78,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/node-redis-pubsub.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-sass.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-uuid.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-xlsx.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-zookeeper-client.js",
    "chars": 96,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/jute/specification.json'],\n  },\n};\n"
  },
  {
    "path": "dictionary/nodegit.js",
    "chars": 82,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['dist/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/nodemailer-sendmail-transport.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/nodemailer.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/npm-registry-client.js",
    "chars": 81,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/npm.js",
    "chars": 78,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/nssocket.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/oauth2orize.js",
    "chars": 81,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/octobat.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/open.js",
    "chars": 256,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"path.join(__dirname, 'xdg-open')\""
  },
  {
    "path": "dictionary/opn.js",
    "chars": 83,
    "preview": "'use strict';\n\n// compatibility with 'open'\nmodule.exports = require('./open.js');\n"
  },
  {
    "path": "dictionary/optimist.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/passport-local.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/passport.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pg-cursor.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pg-query-stream.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pg-types.js",
    "chars": 88,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/arrayParser.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pg.js",
    "chars": 81,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pg.js.js",
    "chars": 81,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pgpass.js",
    "chars": 83,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/helper.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/phantom.js",
    "chars": 424,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/phantom.js': [\n        \"__dirname + '/shim/index.js"
  },
  {
    "path": "dictionary/phantomjs-prebuilt.js",
    "chars": 387,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/phantomjs.js': [\n        '__dirname, location.locat"
  },
  {
    "path": "dictionary/pkginfo.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pm2.js",
    "chars": 97,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/ProcessContainerFork.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pmx.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pouchdb.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/primus-emitter.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/primus-spark-latency.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/primus.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/publicsuffixlist.js",
    "chars": 275,
    "preview": "'use strict';\n\nmodule.exports = {\n  dependencies: {\n    gulp: undefined,\n    'gulp-di': undefined,\n    'gulp-istanbul': "
  },
  {
    "path": "dictionary/pug.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/punt.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/puppeteer.js",
    "chars": 310,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'utils/ChromiumDownloader.js': [\n        \"path.join(__di"
  },
  {
    "path": "dictionary/pwd.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/q.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/raven.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/rc.js",
    "chars": 189,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/utils.js': [\n        'process.cwd()',\n        \"requ"
  },
  {
    "path": "dictionary/readable-stream.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/rechoir.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/redis-parser.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/redis.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/regression.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/reload.js",
    "chars": 90,
    "preview": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/reload-server.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/request.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/require-uncached.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/require_optional.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/s3.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/safe_datejs.js",
    "chars": 36,
    "preview": "'use strict';\n\nmodule.exports = {};\n"
  }
]

// ... and 1227 more files (download for full content)

About this extraction

This page contains the full source code of the vercel/pkg GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1427 files (1.2 MB), approximately 213.0k tokens, and a symbol index with 310 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!