[
  {
    "path": ".eslintignore",
    "content": "lib-es5\nnode_modules\ndist\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"extends\": [\"airbnb-base\", \"prettier\"],\n  \"rules\": {\n    \"no-bitwise\": \"off\",\n    \"no-continue\": \"off\",\n    \"no-await-in-loop\": \"off\",\n    \"no-constant-condition\": \"off\",\n    \"no-param-reassign\": \"off\",\n    \"consistent-return\": \"off\",\n    \"no-restricted-syntax\": \"off\",\n    \"import/prefer-default-export\": \"off\",\n    \"camelcase\": \"off\"\n  },\n  \"overrides\": [\n    {\n      \"files\": [\"*.ts\"],\n      \"extends\": [\n        \"airbnb-typescript/base\",\n        \"plugin:@typescript-eslint/recommended\",\n        \"prettier\"\n      ],\n      \"parser\": \"@typescript-eslint/parser\",\n      \"parserOptions\": {\n        \"project\": \"./tsconfig.json\"\n      },\n      \"rules\": {\n        \"@typescript-eslint/explicit-module-boundary-types\": \"off\",\n        \"consistent-return\": \"off\",\n        \"import/prefer-default-export\": \"off\",\n        \"no-await-in-loop\": \"off\",\n        \"no-bitwise\": \"off\",\n        \"no-constant-condition\": \"off\",\n        \"no-continue\": \"off\",\n        \"no-param-reassign\": \"off\",\n        \"no-restricted-syntax\": \"off\"\n      }\n    },\n    {\n      \"files\": [\"prelude/**/*\"],\n      \"rules\": {\n        \"strict\": \"off\"\n      }\n    },\n    {\n      \"files\": [\"test/**/*\"],\n      \"rules\": {\n        \"array-callback-return\": \"off\",\n        \"func-names\": \"off\",\n        \"global-require\": \"off\",\n        \"guard-for-in\": \"off\",\n        \"import/extensions\": \"off\",\n        \"import/no-dynamic-require\": \"off\",\n        \"import/no-extraneous-dependencies\": \"off\",\n        \"import/newline-after-import\": \"off\",\n        \"import/no-unresolved\": \"off\",\n        \"import/no-useless-path-segments\": \"off\",\n        \"import/order\": \"off\",\n        \"no-console\": \"off\",\n        \"no-lonely-if\": \"off\",\n        \"no-multi-assign\": \"off\",\n        \"no-undef\": \"off\",\n        \"no-else-return\": \"off\",\n        \"no-use-before-define\": \"off\",\n        \"object-shorthand\": \"off\",\n        \"one-var\": \"off\",\n        \"prefer-arrow-callback\": \"off\",\n        \"prefer-destructuring\": \"off\",\n        \"prefer-object-spread\": \"off\",\n        \"prefer-template\": \"off\",\n        \"strict\": [\"error\", \"global\"]\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/01_bug_report.yml",
    "content": "name: 🐞 Bug Report\ndescription: Create a bug report for pkg\nlabels: 'template: bug'\nbody:\n  - type: markdown\n    attributes:\n      value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.\n  - type: markdown\n    attributes:\n      value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions \"Question\" section.\n  - type: markdown\n    attributes:\n      value: 'Please first search the repository for similar issues and discussions.'\n  - type: input\n    attributes:\n      label: What version of pkg are you using?\n      description: '`pkg --version` - For example: 5.4.1'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What version of Node.js are you using?\n      description: '`node --version` - For example: 16.0.0'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What operating system are you using?\n      description: 'For example: macOS, Windows, Ubuntu 20.04'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What CPU architecture are you using?\n      description: 'For example: x86_64, arm64, armv7, Intel 12900K, Apple M1'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What Node versions, OSs and CPU architectures are you building for?\n      description: 'For example: default, node18, node18-linux-x64, node16-win-arm64'\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Describe the Bug\n      description: A clear and concise description of what the bug is.\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Expected Behavior\n      description: A clear and concise description of what you expected to happen.\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: To Reproduce\n      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.\n    validations:\n      required: true\n  - type: markdown\n    attributes:\n      value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear.\n  - type: markdown\n    attributes:\n      value: Contributors should be able to follow the steps provided in order to reproduce the bug.\n  - type: markdown\n    attributes:\n      value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance!\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/02_regression.yml",
    "content": "name: ⏮️ Regression report\ndescription: Report a bug not seen in an earlier version of pkg\nlabels: 'template: regression'\nbody:\n  - type: markdown\n    attributes:\n      value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.\n  - type: markdown\n    attributes:\n      value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions \"Question\" section.\n  - type: markdown\n    attributes:\n      value: 'Please first search the repository for similar issues and discussions.'\n  - type: input\n    attributes:\n      label: What version of pkg are you using?\n      description: '`pkg --version` - For example: 5.4.1'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: Which version(s) of pkg work for you?\n      description: '`pkg --version` - For example: < 5.4.1, 5.3.0, 4.5.0'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What version of Node.js are you using?\n      description: '`node --version` - For example: 16.0.0'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What operating system are you using?\n      description: 'For example: macOS, Windows, Ubuntu 20.04'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What CPU architecture are you using?\n      description: 'For example: x86_64, arm64, armv7, Intel 12900K, Apple M1'\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What Node versions, OSs and CPU architectures are you building for?\n      description: 'For example: default, node18, node18-linux-x64, node16-win-arm64'\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Describe the Bug\n      description: A clear and concise description of what the bug is.\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Expected Behavior\n      description: A clear and concise description of what you expected to happen.\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: To Reproduce\n      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.\n    validations:\n      required: true\n  - type: markdown\n    attributes:\n      value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear.\n  - type: markdown\n    attributes:\n      value: Contributors should be able to follow the steps provided in order to reproduce the bug.\n  - type: markdown\n    attributes:\n      value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance!\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "contact_links:\n  - name: 💡 Feature Request\n    url: https://github.com/vercel/pkg/discussions/new\n    about: Share ideas for new features\n  - name: ❓ Question\n    url: https://github.com/vercel/pkg/discussions/new\n    about: General questions"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  test:\n    strategy:\n      fail-fast: false # prevent test to stop if one fails\n      matrix:\n        node-version: [14.x, 16.x, 18.x]\n        os: [ubuntu-latest, windows-latest, macos-latest]\n    runs-on: ${{ matrix.os }}\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-node@v3\n        with:\n          node-version: ${{ matrix.node-version }}\n      - uses: actions/cache@v3\n        with:\n          path: ~/.pkg-cache/\n          key: ${{ matrix.os }}-${{ matrix.node-version }}\n\n      - run: yarn install\n      - if: matrix['node-version'] == '18.x' && matrix['os'] == 'ubuntu-latest'\n        run: yarn lint\n      - run: yarn build\n      - run: yarn test\n"
  },
  {
    "path": ".github/workflows/close-stale.yml",
    "content": "name: 'Close stale issues'\non:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/stale@v3\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          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'\n          close-issue-message: 'This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.'\n          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'\n          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.'\n          days-before-stale: 90\n          days-before-close: 5\n          exempt-issue-labels: 'no-stale,enhancement'\n          exempt-pr-labels: 'no-stale'\n"
  },
  {
    "path": ".gitignore",
    "content": "# 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_Store\n\n# Example pkg'd application\nexamples/express/express-example\n\n# Example dependencies\nexamples/express/node_modules\n\n# Editors\n.vscode/\nyarn-error.log\ntsconfig.tsbuildinfo"
  },
  {
    "path": ".prettierignore",
    "content": "lib-es5/"
  },
  {
    "path": ".yarnrc",
    "content": "save-prefix \"\"\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2021 Vercel, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# `pkg`\n\n> [!IMPORTANT]  \n> `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.\n\nThis 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.\n\n## Use Cases\n\n- Make a commercial version of your application without sources\n- Make a demo/evaluation/trial version of your app without sources\n- Instantly make executables for other platforms (cross-compilation)\n- Make some kind of self-extracting archive or installer\n- No need to install Node.js and npm to run the packaged application\n- No need to download hundreds of files via `npm install` to deploy\n  your application. Deploy it as a single file\n- Put your assets inside the executable to make it even more portable\n- Test your app against new Node.js version without installing it\n\n## Usage\n\n```sh\nnpm install -g pkg\n```\n\nAfter installing it, run `pkg --help` without arguments to see list of options:\n\n```console\npkg [options] <input>\n\n  Options:\n\n    -h, --help           output usage information\n    -v, --version        output pkg version\n    -t, --targets        comma-separated list of targets (see examples)\n    -c, --config         package.json or any json file with top-level config\n    --options            bake v8 options into executable to run with them on\n    -o, --output         output file name or template for several files\n    --out-path           path to save output one or more executables\n    -d, --debug          show more information during packaging process [off]\n    -b, --build          don't download prebuilt base binaries, build them\n    --public             speed up and disclose the sources of top-level project\n    --public-packages    force specified packages to be considered public\n    --no-bytecode        skip bytecode generation and include source files as plain js\n    --no-native-build    skip native addons build\n    --no-signature       skip signature of the final executable on macos\n    --no-dict            comma-separated list of packages names to ignore dictionaries. Use --no-dict * to disable all dictionaries\n    -C, --compress       [default=None] compression algorithm = Brotli or GZip\n\n  Examples:\n\n  – Makes executables for Linux, macOS and Windows\n    $ pkg index.js\n  – Takes package.json from cwd and follows 'bin' entry\n    $ pkg .\n  – Makes executable for particular target machine\n    $ pkg -t node16-win-arm64 index.js\n  – Makes executables for target machines of your choice\n    $ pkg -t node16-linux,node18-linux,node16-win index.js\n  – Bakes '--expose-gc' and '--max-heap-size=34' into executable\n    $ pkg --options \"expose-gc,max-heap-size=34\" index.js\n  – Consider packageA and packageB to be public\n    $ pkg --public-packages \"packageA,packageB\" index.js\n  – Consider all packages to be public\n    $ pkg --public-packages \"*\" index.js\n  – Bakes '--expose-gc' into executable\n    $ pkg --options expose-gc index.js\n  – reduce size of the data packed inside the executable with GZip\n    $ pkg --compress GZip index.js\n```\n\nThe entrypoint of your project is a mandatory CLI argument. It may be:\n\n- Path to entry file. Suppose it is `/path/app.js`, then\n  packaged app will work the same way as `node /path/app.js`\n- Path to `package.json`. `Pkg` will follow `bin` property of\n  the specified `package.json` and use it as entry file.\n- Path to directory. `Pkg` will look for `package.json` in\n  the specified directory. See above.\n\n### Targets\n\n`pkg` can generate executables for several target machines at a\ntime. You can specify a comma-separated list of targets via `--targets`\noption. A canonical target consists of 3 elements, separated by\ndashes, for example `node18-macos-x64` or `node14-linux-arm64`:\n\n- **nodeRange** (node8), node10, node12, node14, node16 or latest\n- **platform** alpine, linux, linuxstatic, win, macos, (freebsd)\n- **arch** x64, arm64, (armv6, armv7)\n\n(element) is unsupported, but you may try to compile yourself.\n\nYou may omit any element (and specify just `node14` for example).\nThe omitted elements will be taken from current platform or\nsystem-wide Node.js installation (its version and arch).\nThere is also an alias `host`, that means that all 3 elements\nare taken from current platform/Node.js. By default targets are\n`linux,macos,win` for current Node.js version and arch.\n\nIf you want to generate executable for different architectures,\nnote that by default `pkg` has to run the executable of the\n**target** arch to generate bytecodes:\n\n- Linux: configure binfmt with [QEMU](https://wiki.debian.org/QemuUserEmulation).\n- macOS: possible to build `x64` on `arm64` with `Rosetta 2` but not opposite.\n- Windows: possible to build `x64` on `arm64` with `x64 emulation` but not opposite.\n- or, disable bytecode generation with `--no-bytecode --public-packages \"*\" --public`.\n\n`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).\nThe final executable has to be signed (ad-hoc signature is sufficient) with `codesign`\nutility of macOS (or `ldid` utility on Linux). Otherwise, the executable will be killed\nby kernel and the end-user has no way to permit it to run at all. `pkg` tries to ad-hoc\nsign the final executable. If necessary, you can replace this signature with your own\ntrusted Apple Developer ID.\n\nTo be able to generate executables for all supported architectures and platforms, run\n`pkg` on a Linux host with binfmt (`QEMU` emulation) configured and `ldid` installed.\n\n### Config\n\nDuring packaging process `pkg` parses your sources, detects\ncalls to `require`, traverses the dependencies of your project\nand includes them into executable. In most cases you\ndon't need to specify anything manually.\n\nHowever your code may have `require(variable)` calls (so called non-literal\nargument to `require`) or use non-javascript files (for\nexample views, css, images etc).\n\n```js\nrequire('./build/' + cmd + '.js');\npath.join(__dirname, 'views/' + viewName);\n```\n\nSuch cases are not handled by `pkg`. So you must specify the\nfiles - scripts and assets - manually in `pkg` property of\nyour `package.json` file.\n\n```json\n  \"pkg\": {\n    \"scripts\": \"build/**/*.js\",\n    \"assets\": \"views/**/*\",\n    \"targets\": [ \"node14-linux-arm64\" ],\n    \"outputPath\": \"dist\"\n  }\n```\n\nThe above example will include everything in `assets/` and\nevery .js file in `build/`, build only for `node14-linux-arm64`,\nand place the executable inside `dist/`.\n\nYou may also specify arrays of globs:\n\n```\n    \"assets\": [ \"assets/**/*\", \"images/**/*\" ]\n```\n\nJust be sure to call `pkg package.json` or `pkg .` to make\nuse of `package.json` configuration.\n\n### Scripts\n\n`scripts` is a [glob](https://github.com/sindresorhus/globby)\nor list of globs. Files specified as `scripts` will be compiled\nusing `v8::ScriptCompiler` and placed into executable without\nsources. They must conform to the JS standards of those Node.js versions\nyou target (see [Targets](#targets)), i.e. be already transpiled.\n\n### Assets\n\n`assets` is a [glob](https://github.com/sindresorhus/globby)\nor list of globs. Files specified as `assets` will be packaged\ninto executable as raw content without modifications. Javascript\nfiles may also be specified as `assets`. Their sources will\nnot be stripped as it improves execution performance of the\nfiles and simplifies debugging.\n\nSee also\n[Detecting assets in source code](#detecting-assets-in-source-code) and\n[Snapshot filesystem](#snapshot-filesystem).\n\n### Options\n\nNode.js application can be called with runtime options\n(belonging to Node.js or V8). To list them type `node --help` or `node --v8-options`.\n\nYou can \"bake\" these runtime options into packaged application. The app will always run with the options\nturned on. Just remove `--` from option name.\n\nYou can specify multiple options by joining them in a single string, comma (`,`) separated:\n\n```sh\npkg app.js --options expose-gc\npkg app.js --options max_old_space_size=4096\npkg app.js --options max-old-space-size=1024,tls-min-v1.0,expose-gc\n```\n\n### Output\n\nYou may specify `--output` if you create only one executable\nor `--out-path` to place executables for multiple targets.\n\n### Debug\n\nPass `--debug` to `pkg` to get a log of packaging process.\nIf you have issues with some particular file (seems not packaged\ninto executable), it may be useful to look through the log.\n\n### Bytecode (reproducibility)\n\nBy default, your source code is precompiled to v8 bytecode before being written\nto the output file. To disable this feature, pass `--no-bytecode` to `pkg`.\n\n#### Why would you want to do this?\n\nIf you need a reproducible build\nprocess where your executable hashes (e.g. md5, sha1, sha256, etc.) are the\nsame value between builds. Because compiling bytecode is not deterministic\n(see [here](https://ui.adsabs.harvard.edu/abs/2019arXiv191003478C/abstract) or\n[here](https://medium.com/dailyjs/understanding-v8s-bytecode-317d46c94775)) it\nresults in executables with differing hashed values. Disabling bytecode\ncompilation allows a given input to always have the same output.\n\n#### Why would you NOT want to do this?\n\nWhile compiling to bytecode does not make your source code 100% secure, it does\nadd a small layer of security/privacy/obscurity to your source code. Turning\noff bytecode compilation causes the raw source code to be written directly to\nthe executable file. If you're on \\*nix machine and would like an example, run\n`pkg` with the `--no-bytecode` flag, and use the GNU strings tool on the\noutput. You then should be able to grep your source code.\n\n#### Other considerations\n\nSpecifying `--no-bytecode` will fail if there are any packages in your project that aren't explicitly marked\nas public by the `license` in their `package.json`.\nBy default, `pkg` will check the license of each package and make sure that stuff that isn't meant for the public will\nonly be included as bytecode.\n\nIf you do require building pkg binaries for other architectures and/or depend on a package with a broken\n`license` in its `package.json`, you can override this behaviour by either explicitly whitelisting packages to be public\nusing `--public-packages \"packageA,packageB\"` or setting all packages to public using `--public-packages \"*\"`\n\n### Build\n\n`pkg` has so called \"base binaries\" - they are actually same\n`node` executables but with some patches applied. They are\nused as a base for every executable `pkg` creates. `pkg`\ndownloads precompiled base binaries before packaging your\napplication. If you prefer to compile base binaries from\nsource instead of downloading them, you may pass `--build`\noption to `pkg`. First ensure your computer meets the\nrequirements to compile original Node.js:\n[BUILDING.md](https://github.com/nodejs/node/blob/HEAD/BUILDING.md)\n\nSee [pkg-fetch](https://github.com/vercel/pkg-fetch) for more info.\n\n### Compression\n\nPass `--compress Brotli` or `--compress GZip` to `pkg` to compress further the content of the files store in the exectable.\n\nThis option can reduce the size of the embedded file system by up to 60%.\n\nThe startup time of the application might be reduced slightly.\n\n`-C` can be used as a shortcut for `--compress `.\n\n### Environment\n\n| Var            | Description                                                                               |\n| -------------- | ----------------------------------------------------------------------------------------- |\n| PKG_CACHE_PATH | Used to specify a custom path for node binaries cache folder. Default is `~/.pkg-cache`   |\n| PKG_IGNORE_TAG | Allows to ignore additional folder created on `PKG_CACHE_PATH` matching pkg-fetch version |\n| MAKE_JOB_COUNT | Allow configuring number of processes used for compiling                                  |\n\nExamples\n\n```bash\n# 1 - Using export\nexport PKG_CACHE_PATH=/my/cache\npkg app.js\n\n# 2 - Passing it before the script\nPKG_CACHE_PATH=/my/cache pkg app.js\n```\n\n## Usage of packaged app\n\nCommand line call to packaged app `./app a b` is equivalent\nto `node app.js a b`\n\n## Snapshot filesystem\n\nDuring packaging process `pkg` collects project files and places\nthem into executable. It is called a snapshot. At run time the\npackaged application has access to snapshot filesystem where all\nthat files reside.\n\nPackaged files have `/snapshot/` prefix in their paths (or\n`C:\\snapshot\\` in Windows). If you used `pkg /path/app.js` command line,\nthen `__filename` value will be likely `/snapshot/path/app.js`\nat run time. `__dirname` will be `/snapshot/path` as well. Here is\nthe comparison table of path-related values:\n\n| value                         | with `node`     | packaged                 | comments                       |\n| ----------------------------- | --------------- | ------------------------ | ------------------------------ |\n| \\_\\_filename                  | /project/app.js | /snapshot/project/app.js |\n| \\_\\_dirname                   | /project        | /snapshot/project        |\n| process.cwd()                 | /project        | /deploy                  | suppose the app is called ...  |\n| process.execPath              | /usr/bin/nodejs | /deploy/app-x64          | `app-x64` and run in `/deploy` |\n| process.argv[0]               | /usr/bin/nodejs | /deploy/app-x64          |\n| process.argv[1]               | /project/app.js | /snapshot/project/app.js |\n| process.pkg.entrypoint        | undefined       | /snapshot/project/app.js |\n| process.pkg.defaultEntrypoint | undefined       | /snapshot/project/app.js |\n| require.main.filename         | /project/app.js | /snapshot/project/app.js |\n\nHence, in order to make use of a file collected at packaging\ntime (`require` a javascript file or serve an asset) you should\ntake `__filename`, `__dirname`, `process.pkg.defaultEntrypoint`\nor `require.main.filename` as a base for your path calculations.\nFor javascript files you can just `require` or `require.resolve`\nbecause they use current `__dirname` by default. For assets use\n`path.join(__dirname, '../path/to/asset')`. Learn more about\n`path.join` in\n[Detecting assets in source code](#detecting-assets-in-source-code).\n\nOn the other hand, in order to access real file system at run time\n(pick up a user's external javascript plugin, json configuration or\neven get a list of user's directory) you should take `process.cwd()`\nor `path.dirname(process.execPath)`.\n\n## Detecting assets in source code\n\nWhen `pkg` encounters `path.join(__dirname, '../path/to/asset')`,\nit automatically packages the file specified as an asset. See\n[Assets](#assets). Pay attention that `path.join` must have two\narguments and the last one must be a string literal.\n\nThis way you may even avoid creating `pkg` config for your project.\n\n## Native addons\n\nNative addons (`.node` files) use is supported. When `pkg` encounters\na `.node` file in a `require` call, it will package this like an asset.\nIn some cases (like with the `bindings` package), the module path is generated\ndynamicaly and `pkg` won't be able to detect it. In this case, you should\nadd the `.node` file directly in the `assets` field in `package.json`.\n\nThe way Node.js requires native addon is different from a classic JS\nfile. It needs to have a file on disk to load it, but `pkg` only generates\none file. To circumvent this, `pkg` will create a temporary file on the\ndisk. These files will stay on the disk after the process has exited\nand will be used again on the next process launch.\n\nWhen a package, that contains a native module, is being installed,\nthe native module is compiled against current system-wide Node.js\nversion. Then, when you compile your project with `pkg`, pay attention\nto `--target` option. You should specify the same Node.js version\nas your system-wide Node.js to make compiled executable compatible\nwith `.node` files.\n\nNote that fully static Node binaries are not capable of loading native\nbindings, so you may not use Node bindings with `linuxstatic`.\n\n## API\n\n`const { exec } = require('pkg')`\n\n`exec(args)` takes an array of command line arguments and returns\na promise. For example:\n\n```js\nawait exec(['app.js', '--target', 'host', '--output', 'app.exe']);\n// do something with app.exe, run, test, upload, deploy, etc\n```\n\n## Troubleshooting\n\n### Error: ENOENT: no such file or directory, uv_chdir\n\nThis error can be caused by deleting the directory the application is\nrun from. Or, generally, deleting `process.cwd()` directory when the\napplication is running.\n\n### Error: ERR_INSPECTOR_NOT_AVAILABLE\n\nThis error can be caused by using `NODE_OPTIONS` variable to force to\nrun `node` with the debug mode enabled. Debugging options are disallowed\n, as **pkg** executables are usually used for production environments.\nIf you do need to use inspector, you can [build a debuggable Node.js](https://github.com/vercel/pkg/issues/93#issuecomment-301210543) yourself.\n\n### Error: require(...).internalModuleStat is not a function\n\nThis error can be caused by using `NODE_OPTIONS` variable with some\nbootstrap or `node` options causing conflicts with **pkg**. Some\nIDEs, such as **VS Code**, may add this env variable automatically.\n\nYou could check on **Unix systems** (Linux/macOS) in `bash`:\n\n```bash\n$ printenv | grep NODE\n```\n\n## Advanced\n\n### exploring virtual file system embedded in debug mode\n\nWhen you are using the `--debug` flag when building your executable,\n`pkg` add the ability to display the content of the virtual file system\nand the symlink table on the console, when the application starts,\nproviding that the environement variable DEBUG_PKG is set.\nThis feature can be useful to inspect if symlinks are correctly handled,\nand check that all the required files for your application are properly\nincorporated to the final executable.\n\n    $ pkg --debug app.js -o output\n    $ DEBUG_PKG=1 output\n\nor\n\n    C:\\> pkg --debug app.js -o output.exe\n    C:\\> set DEBUG_PKG=1\n    C:\\> output.exe\n\nNote: make sure not to use --debug flag in production.\n"
  },
  {
    "path": "dictionary/.eslintrc.json",
    "content": "{\n  \"parserOptions\": {\n    \"sourceType\": \"script\"\n  }\n}\n"
  },
  {
    "path": "dictionary/angular-bridge.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/any-promise.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/async.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/aws-sdk.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['apis/*.json', 'lib/services/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/babel-core.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/batch.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/bcrypt.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/better-sqlite3.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/bignum.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/bindings.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/blessed.js",
    "content": "'use strict';\n\n// https://github.com/chjj/blessed/issues/298\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/widgets/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/body-parser.js",
    "content": "'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",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['bin/*.txt'],\n  },\n};\n"
  },
  {
    "path": "dictionary/bson.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/buffermaker.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/bunyan.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/bunyan.js': [\"mv = require('mv' + '');\", \"mv = require('mv');\"],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/busboy.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/types/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/bytes.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/callsites.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/chokidar.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/coffee-script.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/coffee-script/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/colors.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/compression.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/compressjs.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/connect-mongo.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/connect-mongodb.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/connect-redis.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/connect.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/middleware/*.js'],\n    assets: [\n      'lib/public/**/*', // for connect@2.3\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/consolidate.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cookie-parser.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cookie.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cors.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cron.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/cross-env.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      // author is mistaken to point package.json.main to\n      // src/index.js (that is es6) instead of dist/index.js (es5)\n      'src/index.js': [{ do: 'erase' }, ''],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/cross-spawn-async.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/curve25519.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/data-preflight.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['src/view/**/*', 'src/js/view/**/*'],\n  },\n};\n"
  },
  {
    "path": "dictionary/debug.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/denymount.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/diff.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/drivelist.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'build/scripts.js': [\n        \"path.join(__dirname, '..', 'scripts')\",\n        \"path.join(path.dirname(process.execPath), 'drivelist')\",\n      ],\n      'lib/scripts.js': [\n        \"path.join(__dirname, '..', 'scripts')\",\n        \"path.join(path.dirname(process.execPath), 'drivelist')\", // for 4.0.0\n      ],\n    },\n    deployFiles: [\n      ['build/Release/drivelist.node', 'drivelist.node'],\n      ['scripts/darwin.sh', 'drivelist/darwin.sh'],\n      ['scripts/linux.sh', 'drivelist/linux.sh'],\n      ['scripts/win32.bat', 'drivelist/win32.bat'],\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/ed25519.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/ejs.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/elasticsearch.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/electron.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        'path.join(__dirname, fs',\n        \"path.join(path.dirname(process.execPath), 'electron', fs\",\n      ],\n    },\n    deployFiles: [\n      ['dist', 'electron/dist', 'directory'],\n      ['../sliced/index.js', 'node_modules/sliced/index.js'],\n      ['../deep-defaults/lib/index.js', 'node_modules/deep-defaults/index.js'],\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/emailjs.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/engine.io.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/epoll.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/errorhandler.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['public/**/*'],\n  },\n};\n"
  },
  {
    "path": "dictionary/errors.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/static/*'],\n  },\n};\n"
  },
  {
    "path": "dictionary/eslint.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/rules/*.js', 'lib/formatters/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/etcher-image-write.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/exceljs.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: [\n      // TODO look at exceljs and implement as\n      // many __dirname use cases as possible\n      'lib/**/*.xml',\n    ],\n    patches: {\n      'lib/stream/xlsx/workbook-writer.js': [\n        \"require.resolve('../../xlsx/xml/theme1.xml')\",\n        \"require('path').join(__dirname, '../../xlsx/xml/theme1.xml')\",\n      ],\n      'lib/xlsx/xlsx.js': [\n        \"require.resolve('./xml/theme1.xml')\",\n        \"require('path').join(__dirname, './xml/theme1.xml')\",\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/exiftool.exe.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"path.join(__dirname, 'vendor', 'exiftool.exe')\",\n        \"path.join(path.dirname(process.execPath), 'exiftool.exe')\",\n      ],\n    },\n    deployFiles: [['vendor/exiftool.exe', 'exiftool.exe']],\n  },\n};\n"
  },
  {
    "path": "dictionary/exiftool.pl.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"path.join(__dirname, 'vendor', 'exiftool')\",\n        \"path.join(path.dirname(process.execPath), 'exiftool')\",\n      ],\n    },\n    deployFiles: [['vendor/exiftool', 'exiftool']],\n  },\n};\n"
  },
  {
    "path": "dictionary/express-load.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/express-load.js': [\n        'entity = path.resolve(',\n        'entity = process.pkg.path.resolve(',\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/express-session.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/express.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/view.js': [\n        'path = join(this.root, path)',\n        'path = process.pkg.path.resolve(this.root, path)', // for 3.x\n        'loc = resolve(root, name)',\n        'loc = process.pkg.path.resolve(root, name)', // for 4.x\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/extender.js",
    "content": "'use strict';\n\nmodule.exports = {\n  // в declare.js грязный хак.\n  // если в тексте(!) функции есть подстрока \"super\"\n  // (см SUPER_REGEXP), то её надо оборачивать особым\n  // способом (см functionWrapper). поэтому все пакеты,\n  // которые зависят от declare.js - надо проработать.\n  // хотя бы те файлы, функции в которых попадают в\n  // functionWrapper\n};\n"
  },
  {
    "path": "dictionary/extsprintf.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/faye-websocket.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/feathers.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/findup-sync.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/floordate.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/fmt.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/formidable.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/fs-extra.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/fsevents.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/geoip-lite.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['data/*'],\n  },\n};\n"
  },
  {
    "path": "dictionary/github.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/routes.json'],\n  },\n};\n"
  },
  {
    "path": "dictionary/gm.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/google-closure-compiler-java.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"require.resolve('./compiler.jar')\",\n        \"require('path').join(require('path').dirname(process.execPath), 'compiler/compiler.jar')\",\n      ],\n    },\n    deployFiles: [['compiler.jar', 'compiler/compiler.jar']],\n  },\n};\n"
  },
  {
    "path": "dictionary/google-closure-compiler.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/node/closure-compiler.js': [\n        \"require.resolve('../../compiler.jar')\",\n        \"require('path').join(require('path').dirname(process.execPath), 'compiler/compiler.jar')\",\n      ],\n    },\n    deployFiles: [['compiler.jar', 'compiler/compiler.jar']],\n  },\n};\n"
  },
  {
    "path": "dictionary/googleapis.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['apis/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/got.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/graceful-fs.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'graceful-fs.js': [\n        { do: 'prepend' },\n        'if ((function() {\\n' +\n          \"  var version = require('./package.json').version;\\n\" +\n          \"  var major = parseInt(version.split('.')[0]);\\n\" +\n          '  if (major < 4) {\\n' +\n          \"    module.exports = require('fs');\\n\" +\n          '    return true;\\n' +\n          '  }\\n' +\n          '})()) return;\\n',\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/grpc.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    files: [\n      // suppress because hundreds of\n      // C++ files go inside executable\n    ],\n    assets: ['etc/*.pem', 'deps/grpc/etc/*.pem'],\n  },\n};\n"
  },
  {
    "path": "dictionary/gulp.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/hap-nodejs.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/heapdump.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/hoek.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/homebridge.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/http-proxy.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/http-server.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/image-size.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/indexof.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/inquirer.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/j.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'j.js': [\n        \"require('xl'+'sx')\",\n        \"require('xlsx')\",\n        \"require('xl'+'sjs')\",\n        \"require('xlsjs')\",\n        \"require('ha'+'rb')\",\n        \"require('harb')\",\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/jade.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/jsdom.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/json-stringify-date.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/json-stringify-safe.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/jsonwebtoken.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/kerberos.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/knex.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/later.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['later.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/level.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/leveldown.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'binding.js': ['__dirname', \"require('path').dirname(process.execPath)\"],\n    },\n    deployFiles: [['prebuilds', 'prebuilds', 'directory']],\n  },\n};\n"
  },
  {
    "path": "dictionary/levelup.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/liftoff.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        'resolve.sync(this.moduleName, {basedir: configBase || cwd, paths: paths})',\n        'resolve.sync(this.moduleName, {basedir: configBase || require.main.filename, paths: paths})',\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/lodash.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/log4js.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/appenders/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/logform.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/machinepack-urls.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['machines/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/markdown.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/mdns.js",
    "content": "'use strict';\n\nmodule.exports = {\n  // хоть bindings и объявлен в\n  // dependencies, но не используется\n};\n"
  },
  {
    "path": "dictionary/method-override.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/microjob.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'dist/worker-pool.js': [\n        'error.stack = message.error.stack;',\n        'error.stack = message.error.stack;\\n' +\n          'if (error.stack.indexOf(\"SyntaxError\") >= 0) {' +\n          'error.stack = \"Pkg: Try to specify your ' +\n          \"javascript file in 'assets' in config.\\\\n\\\" + error.stack;\" +\n          '};',\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/mime-types.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/mime.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/minimatch.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/minstache.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/module-deps.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/moment-timezone.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/moment.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['locale/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/mongodb-core.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/error.js': [\n        'return err;',\n        'if (err.message.indexOf(\"SyntaxError\") >= 0) {' +\n          'err.message = \"Pkg: Try to specify your ' +\n          \"javascript file in 'assets' in config. \\\" + err.message;\" +\n          '};\\n' +\n          'return err;',\n        'if (Error.captureStackTrace) {',\n        'if (this.message.indexOf(\"SyntaxError\") >= 0) {' +\n          'this.message = \"Pkg: Try to specify your ' +\n          \"javascript file in 'assets' in config. \\\" + this.message;\" +\n          '};\\n' +\n          'if (Error.captureStackTrace) {',\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/mongodb.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/mongodb/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/mongoose.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/drivers/node-mongodb-native/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/mongoskin.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/ms.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/msgpack.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/multer.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/muri.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/native-or-bluebird.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/natives.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/nconf.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/nconf/stores/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/nedb.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/negotiator.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/newrelic.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/nib.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/nightmare.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/nightmare.js': [\n        \"path.join(__dirname, 'runner.js')\",\n        \"path.join(path.dirname(process.execPath), 'nightmare/runner.js')\",\n      ],\n    },\n    deployFiles: [\n      ['lib/runner.js', 'nightmare/runner.js'],\n      ['lib/frame-manager.js', 'nightmare/frame-manager.js'],\n      ['lib/ipc.js', 'nightmare/ipc.js'],\n      ['lib/preload.js', 'nightmare/preload.js'],\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/node-forge.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['js/*.js', 'lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/node-libcurl.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-notifier.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'notifiers/balloon.js': [\n        \"__dirname, '../vendor/notifu/notifu'\",\n        \"path.dirname(process.execPath), 'notifier/notifu'\",\n      ],\n      'notifiers/notificationcenter.js': [\n        \"__dirname,\\n  '../vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier'\",\n        \"path.dirname(process.execPath), 'notifier/terminal-notifier'\",\n      ],\n      'notifiers/toaster.js': [\n        \"__dirname, '../vendor/snoreToast/snoretoast'\",\n        \"path.dirname(process.execPath), 'notifier/snoretoast'\",\n      ],\n    },\n    deployFiles: [\n      ['vendor/notifu/notifu.exe', 'notifier/notifu.exe'],\n      ['vendor/notifu/notifu64.exe', 'notifier/notifu64.exe'],\n      [\n        'vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier',\n        'notifier/terminal-notifier',\n      ],\n      ['vendor/snoreToast/snoretoast-x64.exe', 'notifier/snoretoast-x64.exe'],\n      ['vendor/snoreToast/snoretoast-x86.exe', 'notifier/snoretoast-x86.exe'],\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/node-pre-gyp.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/node-redis-pubsub.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-sass.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-uuid.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-xlsx.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/node-zookeeper-client.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/jute/specification.json'],\n  },\n};\n"
  },
  {
    "path": "dictionary/nodegit.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['dist/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/nodemailer-sendmail-transport.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/nodemailer.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/npm-registry-client.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/npm.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/nssocket.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/oauth2orize.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/octobat.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/open.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"path.join(__dirname, 'xdg-open')\",\n        \"path.join(path.dirname(process.execPath), 'xdg-open')\",\n      ],\n    },\n    deployFiles: [['xdg-open', 'xdg-open']],\n  },\n};\n"
  },
  {
    "path": "dictionary/opn.js",
    "content": "'use strict';\n\n// compatibility with 'open'\nmodule.exports = require('./open.js');\n"
  },
  {
    "path": "dictionary/optimist.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/passport-local.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/passport.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pg-cursor.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pg-query-stream.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pg-types.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/arrayParser.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pg.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pg.js.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pgpass.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/helper.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/phantom.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/phantom.js': [\n        \"__dirname + '/shim/index.js'\",\n        \"_path2.default.join(_path2.default.dirname(process.execPath), 'phantom/index.js')\",\n      ],\n    },\n    deployFiles: [\n      ['lib/shim/index.js', 'phantom/index.js'],\n      [\n        'lib/shim/function_bind_polyfill.js',\n        'phantom/function_bind_polyfill.js',\n      ],\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/phantomjs-prebuilt.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/phantomjs.js': [\n        '__dirname, location.location',\n        \"path.dirname(process.execPath), 'phantom', path.basename(location.location)\",\n      ],\n    },\n    deployFiles: [\n      ['lib/phantom/bin/phantomjs', 'phantom/phantomjs'],\n      ['lib/phantom/bin/phantomjs.exe', 'phantom/phantomjs.exe'],\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/pkginfo.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pm2.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/ProcessContainerFork.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pmx.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/pouchdb.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/primus-emitter.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/primus-spark-latency.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/primus.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/publicsuffixlist.js",
    "content": "'use strict';\n\nmodule.exports = {\n  dependencies: {\n    gulp: undefined,\n    'gulp-di': undefined,\n    'gulp-istanbul': undefined,\n    'gulp-jshint': undefined,\n    'gulp-mocha': undefined,\n    mocha: undefined,\n  },\n  pkg: {\n    assets: ['effective_tld_names.dat'],\n  },\n};\n"
  },
  {
    "path": "dictionary/pug.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/punt.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/puppeteer.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'utils/ChromiumDownloader.js': [\n        \"path.join(__dirname, '..', '.local-chromium')\",\n        \"path.join(path.dirname(process.execPath), 'puppeteer')\",\n      ],\n    },\n    deployFiles: [['.local-chromium', 'puppeteer', 'directory']],\n  },\n};\n"
  },
  {
    "path": "dictionary/pwd.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/q.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/raven.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/rc.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/utils.js': [\n        'process.cwd()',\n        \"require('path').dirname(require.main.filename)\",\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/readable-stream.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/rechoir.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/redis-parser.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/redis.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/regression.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/reload.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/reload-server.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/request.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/require-uncached.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/require_optional.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/s3.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/safe_datejs.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/sails.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n    patches: {\n      'lib/hooks/moduleloader/index.js': [\n        \"require('coffee-script/register')\",\n        '',\n      ],\n      'lib/app/configuration/index.js': [\n        'hook = require(hookBundled);',\n        'hook = require(hookBundled);' +\n          // force to take the whole package\n          \"require('sails-hook-sockets');\",\n      ],\n      'lib/hooks/grunt/index.js': [\n        'var child = ChildProcess.fork(',\n        '\\n' +\n          \"sails.log.warn('*******************************************************************');\\n\" +\n          \"sails.log.warn('** Pkg: Grunt hook is temporarily disabled in pkg-ed app         **');\\n\" +\n          \"sails.log.warn('** Instead it should be run before compilation to prepare files  **');\\n\" +\n          \"sails.log.warn('*******************************************************************');\\n\" +\n          \"sails.emit('hook:grunt:done');\\n\" +\n          'return cb_afterTaskStarted();(',\n      ],\n      'lib/hooks/orm/backwards-compatibility/upgrade-datastore.js': [\n        'if (!fs.existsSync(modulePath)) {',\n        'try { require(modulePath); } catch (e) {',\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/sax.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/scrypt.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/semver.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/sequelize.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/serialport.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/sha3.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/sharp.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/*.js'],\n    deployFiles: [\n      ['build/Release', 'sharp/build/Release', 'directory'],\n      ['vendor/lib', 'sharp/vendor/lib', 'directory'],\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/shelljs.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['src/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/sinon.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/socket.io-client.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: [\n      'lib/**/*.js', // for 0.9.17\n    ],\n    assets: [\n      'socket.io.js',\n      'dist/**/*', // for 0.9.17\n    ],\n  },\n};\n"
  },
  {
    "path": "dictionary/socket.io.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/index.js': [\n        \"require.resolve('socket.io-client/dist/socket.io.js.map')\",\n        \"require.resolve('socket.io-client/dist/socket.io.js.map', 'must-exclude')\",\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/sqip.js",
    "content": "'use strict';\n\n/**\n * primitive Binaries must be installed on the system.\n * e.g. go get -u github.com/fogleman/primitive\n */\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/sqlite3.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/steam-crypto.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['public.pub'],\n  },\n};\n"
  },
  {
    "path": "dictionary/steam-resources.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['steam_language/**/*'],\n    patches: {\n      'steam_language_parser/index.js': [\n        'process.chdir',\n        '// process.chdir',\n        \"'steammsg.steamd'\",\n        \"require('path').join(__dirname, '../steam_language', 'steammsg.steamd')\",\n      ],\n      'steam_language_parser/parser/token_analyzer.js': [\n        'text.value',\n        \"require('path').join(__dirname, '../../steam_language', text.value)\",\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/steam.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/stripe-webhook-middleware.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/stripe.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/strong-globalize.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/stylus.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/**/*.styl'],\n    log: function (log, opts) {\n      log.warn(\n        'Add { paths: [ __dirname ] } to ' +\n          'stylus options to resolve imports',\n        [opts.packagePath]\n      );\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/supervisor.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/svgo.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/**/*.js', 'plugins/*.js'],\n    assets: ['.svgo.yml'],\n  },\n};\n"
  },
  {
    "path": "dictionary/tabtab.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/tesseract.js.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['src/worker-script/node/index.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/throng.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/time.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/tinify.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/data/cacert.pem'],\n  },\n};\n"
  },
  {
    "path": "dictionary/tiny-worker.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: ['lib/noop.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/tmp.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/transformers.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/uglify-js.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    // assets, not scripts because of custom\n    // load_global (readFileSync + runInContext)\n    assets: ['lib/**/*.js', 'tools/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/umd.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    assets: [\n      'template.js', // for 2.1.0\n    ],\n    patches: {\n      'index.js': [\n        \"var rfile = require('rfile');\",\n        'var rfile = function(f) { ' +\n          \"require('fs').readFileSync(\" + // for 2.1.0\n          'require.resolve(f)' +\n          '); ' +\n          '};',\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/underscore.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/union.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/update-notifier.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/usage.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/providers/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/v8flags.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'index.js': [\n        \"execFile(process.execPath, ['--v8-options'],\",\n        \"execFile(process.execPath, ['--v8-options'], \" +\n          \"{ env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' } },\",\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/verror.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/voc.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/webdriverio.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['build/**/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/winston-uber.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/winston/transports/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/winston.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    scripts: ['lib/winston/transports/*.js'],\n  },\n};\n"
  },
  {
    "path": "dictionary/ws.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/xlsx.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'xlsx.js': [\n        \"require('js'+'zip')\",\n        \"require('jszip')\",\n        \"require('./js'+'zip')\",\n        \"require('./jszip')\",\n        \"require('./od' + 's')\",\n        \"require('./ods')\",\n      ],\n    },\n  },\n};\n"
  },
  {
    "path": "dictionary/xml2js.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/yargs.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "dictionary/zeromq.js",
    "content": "'use strict';\n\nmodule.exports = {\n  pkg: {\n    patches: {\n      'lib/native.js': [\n        'path.join(__dirname, \"..\")',\n        'path.dirname(process.execPath)',\n      ],\n    },\n    deployFiles: [['prebuilds', 'prebuilds', 'directory']],\n  },\n};\n"
  },
  {
    "path": "examples/.eslintrc.json",
    "content": "{\n  \"parserOptions\": {\n    \"sourceType\": \"script\"\n  },\n  \"rules\": {\n    \"no-path-concat\": \"off\",\n    \"no-var\": \"off\"\n  }\n}\n"
  },
  {
    "path": "examples/express/index.js",
    "content": "'use strict';\n\nvar express = require('express');\nvar app = express();\nvar Server = require('http').Server;\nvar server = new Server(app);\n\nserver.listen(8080);\n\n// __dirname is used here along with package.json.pkg.assets\n// see https://github.com/zeit/pkg#config and\n// https://github.com/zeit/pkg#snapshot-filesystem\napp.use('/', express.static(__dirname + '/views'));\n\napp.get('/', function (req, res) {\n  res.sendFile(__dirname + '/views/index.html');\n});\n"
  },
  {
    "path": "examples/express/package.json",
    "content": "{\n  \"name\": \"express-example\",\n  \"license\": \"ISC\",\n  \"bin\": \"index.js\",\n  \"dependencies\": {\n    \"express\": \"4.15.2\"\n  },\n  \"pkg\": {\n    \"assets\": [\n      \"views/**/*\"\n    ],\n    \"targets\": [\n      \"node8\"\n    ]\n  }\n}\n"
  },
  {
    "path": "examples/express/readme.md",
    "content": "# Express-Example\n\n> This example illustrates using `pkg` on a simple Express based app\n\n## Instructions\n\n1. Run `npm install`\n2. Run `pkg .`\n\nThat's it!\n\n## Post Success Notes\n\n- Upon success, `pkg` will create an executable named \"express-example\". This file can be found at the root of the example project directory.\n- To see the app in action, run the executable then navigate to http://localhost:8080/ in your browser.\n"
  },
  {
    "path": "examples/express/views/index.html",
    "content": "<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"lib/sakura.css\" type=\"text/css\" />\n  </head>\n  <body>\n    Hello, world!\n  </body>\n</html>\n"
  },
  {
    "path": "examples/express/views/lib/sakura.css",
    "content": "/* Sakura.css v1.0.0\n * ================\n * Minimal css theme.\n * Project: https://github.com/oxalorg/sakura\n */\n/* Body */\nhtml {\n  font-size: 62.5%;\n  font-family: serif;\n}\n\nbody {\n  font-size: 1.8rem;\n  line-height: 1.618;\n  max-width: 38em;\n  margin: auto;\n  color: #4a4a4a;\n  background-color: #f9f9f9;\n  padding: 13px;\n}\n\n@media (max-width: 684px) {\n  body {\n    font-size: 1.53rem;\n  }\n}\n@media (max-width: 382px) {\n  body {\n    font-size: 1.35rem;\n  }\n}\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n  line-height: 1.1;\n  font-family: Verdana, Geneva, sans-serif;\n  font-weight: 700;\n  overflow-wrap: break-word;\n  word-wrap: break-word;\n  -ms-word-break: break-all;\n  word-break: break-word;\n  -ms-hyphens: auto;\n  -moz-hyphens: auto;\n  -webkit-hyphens: auto;\n  hyphens: auto;\n}\n\nh1 {\n  font-size: 2.35em;\n}\n\nh2 {\n  font-size: 2em;\n}\n\nh3 {\n  font-size: 1.75em;\n}\n\nh4 {\n  font-size: 1.5em;\n}\n\nh5 {\n  font-size: 1.25em;\n}\n\nh6 {\n  font-size: 1em;\n}\n\nsmall,\nsub,\nsup {\n  font-size: 75%;\n}\n\nhr {\n  border-color: #2c8898;\n}\n\na {\n  text-decoration: none;\n  color: #2c8898;\n}\na:hover {\n  color: #982c61;\n  border-bottom: 2px solid #4a4a4a;\n}\n\nul {\n  padding-left: 1.4em;\n}\n\nli {\n  margin-bottom: 0.4em;\n}\n\nblockquote {\n  font-style: italic;\n  margin-left: 1.5em;\n  padding-left: 1em;\n  border-left: 3px solid #2c8898;\n}\n\nimg {\n  max-width: 100%;\n}\n\n/* Pre and Code */\npre {\n  background-color: #f1f1f1;\n  display: block;\n  padding: 1em;\n  overflow-x: auto;\n}\n\ncode {\n  font-size: 0.9em;\n  padding: 0 0.5em;\n  background-color: #f1f1f1;\n  white-space: pre-wrap;\n}\n\npre > code {\n  padding: 0;\n  background-color: transparent;\n  white-space: pre;\n}\n\n/* Tables */\ntable {\n  text-align: justify;\n  width: 100%;\n  border-collapse: collapse;\n}\n\ntd,\nth {\n  padding: 0.5em;\n  border-bottom: 1px solid #f1f1f1;\n}\n\n/* Buttons, forms and input */\ninput,\ntextarea {\n  border: 1px solid #4a4a4a;\n}\ninput:focus,\ntextarea:focus {\n  border: 1px solid #2c8898;\n}\n\ntextarea {\n  width: 100%;\n}\n\n.button,\nbutton,\ninput[type='submit'],\ninput[type='reset'],\ninput[type='button'] {\n  display: inline-block;\n  padding: 5px 10px;\n  text-align: center;\n  text-decoration: none;\n  white-space: nowrap;\n  background-color: #2c8898;\n  color: #f9f9f9;\n  border-radius: 1px;\n  border: 1px solid #2c8898;\n  cursor: pointer;\n  box-sizing: border-box;\n}\n.button[disabled],\nbutton[disabled],\ninput[type='submit'][disabled],\ninput[type='reset'][disabled],\ninput[type='button'][disabled] {\n  cursor: default;\n  opacity: 0.5;\n}\n.button:focus,\n.button:hover,\nbutton:focus,\nbutton:hover,\ninput[type='submit']:focus,\ninput[type='submit']:hover,\ninput[type='reset']:focus,\ninput[type='reset']:hover,\ninput[type='button']:focus,\ninput[type='button']:hover {\n  background-color: #982c61;\n  border-color: #982c61;\n  color: #f9f9f9;\n  outline: 0;\n}\n\ntextarea,\nselect,\ninput[type] {\n  color: #4a4a4a;\n  padding: 6px 10px;\n  /* The 6px vertically centers text on FF, ignored by Webkit */\n  margin-bottom: 10px;\n  background-color: #f1f1f1;\n  border: 1px solid #f1f1f1;\n  border-radius: 4px;\n  box-shadow: none;\n  box-sizing: border-box;\n}\ntextarea:focus,\nselect:focus,\ninput[type]:focus {\n  border: 1px solid #2c8898;\n  outline: 0;\n}\n\nlabel,\nlegend,\nfieldset {\n  display: block;\n  margin-bottom: 0.5rem;\n  font-weight: 600;\n}\n"
  },
  {
    "path": "lib/bin.ts",
    "content": "#!/usr/bin/env node\n\nimport { exec } from './index';\nimport { log } from './log';\n\nasync function main() {\n  if (process.env.CHDIR && process.env.CHDIR !== process.cwd()) {\n    // allow to override cwd by CHDIR env var\n    // https://github.com/resin-io/etcher/pull/1713\n    process.chdir(process.env.CHDIR);\n  }\n\n  await exec(process.argv.slice(2));\n}\n\nmain().catch((error) => {\n  if (!error.wasReported) log.error(error);\n  process.exit(2);\n});\n"
  },
  {
    "path": "lib/chmod.ts",
    "content": "import { chmod, stat } from 'fs-extra';\n\nexport async function plusx(file: string) {\n  const s = await stat(file);\n  const newMode = s.mode | 64 | 8 | 1;\n\n  if (s.mode === newMode) {\n    return;\n  }\n\n  const base8 = newMode.toString(8).slice(-3);\n  await chmod(file, base8);\n}\n"
  },
  {
    "path": "lib/common.ts",
    "content": "import assert from 'assert';\nimport fs from 'fs';\nimport path from 'path';\n\nexport const STORE_BLOB = 0;\nexport const STORE_CONTENT = 1;\nexport const STORE_LINKS = 2;\nexport const STORE_STAT = 3;\nexport const ALIAS_AS_RELATIVE = 0; // require(\"./file.js\") // file or directory\nexport const ALIAS_AS_RESOLVABLE = 1; // require(\"package\")\n\nconst win32 = process.platform === 'win32';\nconst hasURL = typeof URL !== 'undefined';\n\nfunction uppercaseDriveLetter(f: string) {\n  if (f.slice(1, 3) !== ':\\\\') return f;\n  return f[0].toUpperCase() + f.slice(1);\n}\n\nfunction removeTrailingSlashes(f: string) {\n  if (f === '/') {\n    return f; // dont remove from \"/\"\n  }\n\n  if (f.slice(1) === ':\\\\') {\n    return f; // dont remove from \"D:\\\"\n  }\n\n  let last = f.length - 1;\n\n  while (true) {\n    const char = f.charAt(last);\n\n    if (char === '\\\\') {\n      f = f.slice(0, -1);\n      last -= 1;\n    } else if (char === '/') {\n      f = f.slice(0, -1);\n      last -= 1;\n    } else {\n      break;\n    }\n  }\n  return f;\n}\n\nconst isUrl = (p: unknown): p is URL => hasURL && p instanceof URL;\n\nfunction pathToString(p: string | URL | Buffer, win: boolean): string {\n  let result: string;\n\n  if (Buffer.isBuffer(p)) {\n    result = p.toString();\n  } else if (isUrl(p)) {\n    result = win ? p.pathname.replace(/^\\//, '') : p.pathname;\n  } else {\n    result = p;\n  }\n\n  return result;\n}\n\nexport function isRootPath(p: string | URL | Buffer) {\n  let file = pathToString(p, false);\n\n  if (file === '.') {\n    file = path.resolve(file);\n  }\n\n  return path.dirname(file) === p;\n}\n\nexport function normalizePath(f: string | URL | Buffer) {\n  let file = pathToString(f, win32);\n\n  if (!/^.:$/.test(file)) {\n    file = path.normalize(file);\n  } // 'c:' -> 'c:.'\n\n  if (win32) {\n    file = uppercaseDriveLetter(file);\n  }\n\n  return removeTrailingSlashes(file);\n}\n\nexport function isPackageJson(file: string) {\n  return path.basename(file) === 'package.json';\n}\n\nexport function isDotJS(file: string) {\n  return path.extname(file) === '.js';\n}\n\nexport function isDotJSON(file: string) {\n  return path.extname(file) === '.json';\n}\n\nexport function isDotNODE(file: string) {\n  return path.extname(file) === '.node';\n}\n\nfunction replaceSlashes(file: string, slash: string) {\n  if (/^.:\\\\/.test(file)) {\n    if (slash === '/') {\n      return file.slice(2).replace(/\\\\/g, '/');\n    }\n  } else if (/^\\//.test(file)) {\n    if (slash === '\\\\') {\n      return `C:${file.replace(/\\//g, '\\\\')}`;\n    }\n  }\n\n  return file;\n}\n\nfunction injectSnapshot(file: string) {\n  if (/^.:\\\\/.test(file)) {\n    // C:\\path\\to\n    if (file.length === 3) {\n      // C:\\\n      file = file.slice(0, -1);\n    }\n    // by convention, on windows we use C:\\\\snapshot\n    return `C:\\\\snapshot${file.slice(2)}`;\n  }\n\n  if (/^\\//.test(file)) {\n    // /home/user/project\n    if (file.length === 1) {\n      // /\n      file = file.slice(0, -1);\n    }\n\n    return `/snapshot${file}`;\n  }\n\n  return file;\n}\n\nfunction longestCommonLength(s1: string, s2: string) {\n  const length = Math.min(s1.length, s2.length);\n\n  for (let i = 0; i < length; i += 1) {\n    if (s1.charCodeAt(i) !== s2.charCodeAt(i)) {\n      return i;\n    }\n  }\n\n  return length;\n}\n\nfunction withoutNodeModules(file: string) {\n  return file.split(`${path.sep}node_modules${path.sep}`)[0];\n}\n\nexport function retrieveDenominator(files: string[]) {\n  assert(files.length > 0);\n\n  let s1 = withoutNodeModules(files[0]) + path.sep;\n\n  for (let i = 1; i < files.length; i += 1) {\n    const s2 = withoutNodeModules(files[i]) + path.sep;\n    s1 = s1.slice(0, longestCommonLength(s1, s2));\n  }\n\n  if (s1 === '') {\n    return win32 ? 2 : 0;\n  }\n\n  return s1.lastIndexOf(path.sep);\n}\n\nexport function substituteDenominator(f: string, denominator: number) {\n  const rootLength = win32 ? 2 : 0;\n  return f.slice(0, rootLength) + f.slice(denominator);\n}\n\nexport function snapshotify(file: string, slash: string) {\n  return injectSnapshot(replaceSlashes(file, slash));\n}\n\nexport function insideSnapshot(f: Buffer | string | URL) {\n  f = pathToString(f, win32);\n\n  if (typeof f !== 'string') {\n    return false;\n  }\n\n  if (win32) {\n    const slice112 = f.slice(1, 12);\n\n    return (\n      slice112 === ':\\\\snapshot\\\\' ||\n      slice112 === ':/snapshot\\\\' ||\n      slice112 === ':\\\\snapshot/' ||\n      slice112 === ':/snapshot/' ||\n      slice112 === ':\\\\snapshot' ||\n      slice112 === ':/snapshot'\n    );\n  }\n\n  const slice010 = f.slice(0, 10);\n\n  return slice010 === '/snapshot/' || slice010 === '/snapshot';\n}\n\nexport function stripSnapshot(f: string) {\n  const file = normalizePath(f);\n\n  if (/^.:\\\\snapshot$/.test(file)) {\n    return `${file[0]}:\\\\**\\\\`;\n  }\n\n  if (/^.:\\\\snapshot\\\\/.test(file)) {\n    return `${file[0]}:\\\\**${file.slice(11)}`;\n  }\n\n  if (/^\\/snapshot$/.test(file)) {\n    return '/**/';\n  }\n\n  if (/^\\/snapshot\\//.test(file)) {\n    return `/**${file.slice(9)}`;\n  }\n\n  return f; // not inside\n}\n\nexport function removeUplevels(f: string) {\n  if (win32) {\n    while (true) {\n      if (f.slice(0, 3) === '..\\\\') {\n        f = f.slice(3);\n      } else if (f === '..') {\n        f = '.';\n      } else {\n        break;\n      }\n    }\n\n    return f;\n  }\n\n  while (true) {\n    if (f.slice(0, 3) === '../') {\n      f = f.slice(3);\n    } else if (f === '..') {\n      f = '.';\n    } else {\n      break;\n    }\n  }\n\n  return f;\n}\n\nexport function toNormalizedRealPath(requestPath: string) {\n  const file = normalizePath(requestPath);\n\n  if (fs.existsSync(file)) {\n    return fs.realpathSync(file);\n  }\n\n  return file;\n}\n"
  },
  {
    "path": "lib/compress_type.ts",
    "content": "export enum CompressType {\n  None = 0,\n  GZip = 1,\n  Brotli = 2,\n}\n"
  },
  {
    "path": "lib/detector.ts",
    "content": "import * as babelTypes from '@babel/types';\nimport * as babel from '@babel/parser';\nimport generate from '@babel/generator';\nimport { log } from './log';\n\nimport { ALIAS_AS_RELATIVE, ALIAS_AS_RESOLVABLE } from './common';\n\nfunction isLiteral(node: babelTypes.Node): node is babelTypes.Literal {\n  if (node == null) {\n    return false;\n  }\n\n  if (!node.type.endsWith('Literal')) {\n    return false;\n  }\n\n  if (node.type === 'TemplateLiteral' && node.expressions.length !== 0) {\n    return false;\n  }\n\n  return true;\n}\n\nfunction getLiteralValue(node: babelTypes.Literal) {\n  if (node.type === 'TemplateLiteral') {\n    return node.quasis[0].value.raw;\n  }\n\n  if (node.type === 'NullLiteral') {\n    throw new Error('Unexpected null in require expression');\n  }\n\n  if (node.type === 'RegExpLiteral') {\n    throw new Error('Unexpected regexp in require expression');\n  }\n\n  return node.value;\n}\n\nfunction reconstructSpecifiers(\n  specs: (\n    | babelTypes.ImportDefaultSpecifier\n    | babelTypes.ImportNamespaceSpecifier\n    | babelTypes.ImportSpecifier\n  )[]\n) {\n  if (!specs || !specs.length) {\n    return '';\n  }\n\n  const defaults = [];\n\n  for (const spec of specs) {\n    if (babelTypes.isImportDefaultSpecifier(spec)) {\n      defaults.push(spec.local.name);\n    }\n  }\n\n  const nonDefaults = [];\n\n  for (const spec of specs) {\n    if (babelTypes.isImportSpecifier(spec)) {\n      const importedName = babelTypes.isIdentifier(spec.imported)\n        ? spec.imported.name\n        : spec.imported.value;\n\n      if (spec.local.name === importedName) {\n        nonDefaults.push(spec.local.name);\n      } else {\n        nonDefaults.push(`${importedName} as ${spec.local.name}`);\n      }\n    }\n  }\n\n  if (nonDefaults.length) {\n    defaults.push(`{ ${nonDefaults.join(', ')} }`);\n  }\n\n  return defaults.join(', ');\n}\n\nfunction reconstruct(node: babelTypes.Node) {\n  let v = generate(node, { comments: false }).code.replace(/\\n/g, '');\n  let v2;\n\n  while (true) {\n    v2 = v.replace(/\\[ /g, '[').replace(/ \\]/g, ']').replace(/ {2}/g, ' ');\n\n    if (v2 === v) {\n      break;\n    }\n\n    v = v2;\n  }\n\n  return v2;\n}\n\ninterface Was {\n  v1: string | number | boolean;\n  v2?: string | number | boolean | null;\n  v3?: string;\n}\n\nfunction forge(pattern: string, was: Was) {\n  return pattern\n    .replace('{c1}', ', ')\n    .replace('{v1}', `\"${was.v1}\"`)\n    .replace('{c2}', was.v2 ? ', ' : '')\n    .replace('{v2}', was.v2 ? `\"${was.v2}\"` : '')\n    .replace('{c3}', was.v3 ? ' from ' : '')\n    .replace('{v3}', was.v3 ? was.v3 : '');\n}\n\nfunction valid2(v2?: Was['v2']) {\n  return (\n    v2 === undefined ||\n    v2 === null ||\n    v2 === 'must-exclude' ||\n    v2 === 'may-exclude'\n  );\n}\n\nfunction visitorRequireResolve(n: babelTypes.Node) {\n  if (!babelTypes.isCallExpression(n)) {\n    return null;\n  }\n\n  if (!babelTypes.isMemberExpression(n.callee)) {\n    return null;\n  }\n\n  const ci =\n    n.callee.object.type === 'Identifier' &&\n    n.callee.object.name === 'require' &&\n    n.callee.property.type === 'Identifier' &&\n    n.callee.property.name === 'resolve';\n\n  if (!ci) {\n    return null;\n  }\n\n  if (!n.arguments || !isLiteral(n.arguments[0])) {\n    return null;\n  }\n\n  return {\n    v1: getLiteralValue(n.arguments[0]),\n    v2: isLiteral(n.arguments[1]) ? getLiteralValue(n.arguments[1]) : null,\n  };\n}\n\nfunction visitorRequire(n: babelTypes.Node) {\n  if (!babelTypes.isCallExpression(n)) {\n    return null;\n  }\n\n  if (!babelTypes.isIdentifier(n.callee)) {\n    return null;\n  }\n\n  if (n.callee.name !== 'require') {\n    return null;\n  }\n\n  if (!n.arguments || !isLiteral(n.arguments[0])) {\n    return null;\n  }\n\n  return {\n    v1: getLiteralValue(n.arguments[0]),\n    v2: isLiteral(n.arguments[1]) ? getLiteralValue(n.arguments[1]) : null,\n  };\n}\n\nfunction visitorImport(n: babelTypes.Node) {\n  if (!babelTypes.isImportDeclaration(n)) {\n    return null;\n  }\n\n  return { v1: n.source.value, v3: reconstructSpecifiers(n.specifiers) };\n}\n\nfunction visitorPathJoin(n: babelTypes.Node) {\n  if (!babelTypes.isCallExpression(n)) {\n    return null;\n  }\n\n  if (!babelTypes.isMemberExpression(n.callee)) {\n    return null;\n  }\n\n  const ci =\n    n.callee.object &&\n    n.callee.object.type === 'Identifier' &&\n    n.callee.object.name === 'path' &&\n    n.callee.property &&\n    n.callee.property.type === 'Identifier' &&\n    n.callee.property.name === 'join';\n\n  if (!ci) {\n    return null;\n  }\n\n  const dn =\n    n.arguments[0] &&\n    n.arguments[0].type === 'Identifier' &&\n    n.arguments[0].name === '__dirname';\n\n  if (!dn) {\n    return null;\n  }\n\n  const f =\n    n.arguments && isLiteral(n.arguments[1]) && n.arguments.length === 2; // TODO concat them\n\n  if (!f) {\n    return null;\n  }\n\n  return { v1: getLiteralValue(n.arguments[1] as babelTypes.StringLiteral) };\n}\n\nexport function visitorSuccessful(node: babelTypes.Node, test = false) {\n  let was: Was | null = visitorRequireResolve(node);\n\n  if (was) {\n    if (test) {\n      return forge('require.resolve({v1}{c2}{v2})', was);\n    }\n\n    if (!valid2(was.v2)) {\n      return null;\n    }\n\n    return {\n      alias: was.v1,\n      aliasType: ALIAS_AS_RESOLVABLE,\n      mustExclude: was.v2 === 'must-exclude',\n      mayExclude: was.v2 === 'may-exclude',\n    };\n  }\n\n  was = visitorRequire(node);\n\n  if (was) {\n    if (test) {\n      return forge('require({v1}{c2}{v2})', was);\n    }\n\n    if (!valid2(was.v2)) {\n      return null;\n    }\n\n    return {\n      alias: was.v1,\n      aliasType: ALIAS_AS_RESOLVABLE,\n      mustExclude: was.v2 === 'must-exclude',\n      mayExclude: was.v2 === 'may-exclude',\n    };\n  }\n\n  was = visitorImport(node);\n\n  if (was) {\n    if (test) {\n      return forge('import {v3}{c3}{v1}', was);\n    }\n\n    return { alias: was.v1, aliasType: ALIAS_AS_RESOLVABLE };\n  }\n\n  was = visitorPathJoin(node);\n\n  if (was) {\n    if (test) {\n      return forge('path.join(__dirname{c1}{v1})', was);\n    }\n\n    return { alias: was.v1, aliasType: ALIAS_AS_RELATIVE, mayExclude: false };\n  }\n\n  return null;\n}\n\nfunction nonLiteralRequireResolve(n: babelTypes.Node) {\n  if (!babelTypes.isCallExpression(n)) {\n    return null;\n  }\n\n  if (!babelTypes.isMemberExpression(n.callee)) {\n    return null;\n  }\n\n  const ci =\n    n.callee.object.type === 'Identifier' &&\n    n.callee.object.name === 'require' &&\n    n.callee.property.type === 'Identifier' &&\n    n.callee.property.name === 'resolve';\n\n  if (!ci) {\n    return null;\n  }\n\n  if (isLiteral(n.arguments[0])) {\n    return null;\n  }\n\n  const m = n.arguments[1];\n\n  if (!m) {\n    return { v1: reconstruct(n.arguments[0]) };\n  }\n\n  if (!isLiteral(n.arguments[1])) {\n    return null;\n  }\n\n  return {\n    v1: reconstruct(n.arguments[0]),\n    v2: getLiteralValue(n.arguments[1]),\n  };\n}\n\nfunction nonLiteralRequire(n: babelTypes.Node) {\n  if (!babelTypes.isCallExpression(n)) {\n    return null;\n  }\n\n  if (!babelTypes.isIdentifier(n.callee)) {\n    return null;\n  }\n\n  if (n.callee.name !== 'require') {\n    return null;\n  }\n\n  if (isLiteral(n.arguments[0])) {\n    return null;\n  }\n\n  const m = n.arguments[1];\n\n  if (!m) {\n    return { v1: reconstruct(n.arguments[0]) };\n  }\n\n  if (!isLiteral(n.arguments[1])) {\n    return null;\n  }\n\n  return {\n    v1: reconstruct(n.arguments[0]),\n    v2: getLiteralValue(n.arguments[1]),\n  };\n}\n\nexport function visitorNonLiteral(n: babelTypes.Node) {\n  const was = nonLiteralRequireResolve(n) || nonLiteralRequire(n);\n\n  if (was) {\n    if (!valid2(was.v2)) {\n      return null;\n    }\n\n    return {\n      alias: was.v1,\n      mustExclude: was.v2 === 'must-exclude',\n      mayExclude: was.v2 === 'may-exclude',\n    };\n  }\n\n  return null;\n}\n\nfunction isRequire(n: babelTypes.Node) {\n  if (!babelTypes.isCallExpression(n)) {\n    return null;\n  }\n\n  if (!babelTypes.isIdentifier(n.callee)) {\n    return null;\n  }\n\n  if (n.callee.name !== 'require') {\n    return null;\n  }\n\n  const f = n.arguments && n.arguments[0];\n\n  if (!f) {\n    return null;\n  }\n\n  return { v1: reconstruct(n.arguments[0]) };\n}\n\nfunction isRequireResolve(n: babelTypes.Node) {\n  if (!babelTypes.isCallExpression(n)) {\n    return null;\n  }\n\n  if (!babelTypes.isMemberExpression(n.callee)) {\n    return null;\n  }\n\n  const ci =\n    n.callee.object.type === 'Identifier' &&\n    n.callee.object.name === 'require' &&\n    n.callee.property.type === 'Identifier' &&\n    n.callee.property.name === 'resolve';\n\n  if (!ci) {\n    return null;\n  }\n\n  const f = n.type === 'CallExpression' && n.arguments && n.arguments[0];\n\n  if (!f) {\n    return null;\n  }\n\n  return { v1: reconstruct(n.arguments[0]) };\n}\n\nexport function visitorMalformed(n: babelTypes.Node) {\n  const was = isRequireResolve(n) || isRequire(n);\n\n  if (was) {\n    return { alias: was.v1 };\n  }\n\n  return null;\n}\n\nexport function visitorUseSCWD(n: babelTypes.Node) {\n  if (!babelTypes.isCallExpression(n)) {\n    return null;\n  }\n\n  if (!babelTypes.isMemberExpression(n.callee)) {\n    return null;\n  }\n\n  const ci =\n    n.callee.object.type === 'Identifier' &&\n    n.callee.object.name === 'path' &&\n    n.callee.property.type === 'Identifier' &&\n    n.callee.property.name === 'resolve';\n\n  if (!ci) {\n    return null;\n  }\n\n  const was = { v1: n.arguments.map(reconstruct).join(', ') };\n\n  if (was) {\n    return { alias: was.v1 };\n  }\n\n  return null;\n}\n\ntype VisitorFunction = (node: babelTypes.Node, trying?: boolean) => boolean;\n\nfunction traverse(ast: babelTypes.File, visitor: VisitorFunction) {\n  // modified esprima-walk to support\n  // visitor return value and \"trying\" flag\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const stack: Array<[any, boolean]> = [[ast, false]];\n\n  for (let i = 0; i < stack.length; i += 1) {\n    const item = stack[i];\n    const [node] = item;\n\n    if (node) {\n      const trying = item[1] || babelTypes.isTryStatement(node);\n\n      if (visitor(node, trying)) {\n        for (const key in node) {\n          if (node[key as keyof babelTypes.File]) {\n            const child = node[key as keyof babelTypes.File];\n\n            if (child instanceof Array) {\n              for (let j = 0; j < child.length; j += 1) {\n                stack.push([child[j], trying]);\n              }\n            } else if (child && typeof child.type === 'string') {\n              stack.push([child, trying]);\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\nexport function parse(body: string) {\n  return babel.parse(body, {\n    allowImportExportEverywhere: true,\n    allowReturnOutsideFunction: true,\n  });\n}\n\nexport function detect(body: string, visitor: VisitorFunction) {\n  let json;\n\n  try {\n    json = parse(body);\n  } catch (error) {\n    log.warn(`Babel parse has failed: ${(error as Error).message}`);\n  }\n\n  if (!json) {\n    return;\n  }\n\n  traverse(json, visitor);\n}\n"
  },
  {
    "path": "lib/fabricator.ts",
    "content": "import { spawn, ChildProcessByStdio } from 'child_process';\nimport { Readable, Writable } from 'stream';\nimport { log } from './log';\nimport { Target } from './types';\n\nconst script = `\n  var vm = require('vm');\n  var module = require('module');\n  var stdin = Buffer.alloc(0);\n  process.stdin.on('data', function (data) {\n    stdin = Buffer.concat([ stdin, data ]);\n    if (stdin.length >= 4) {\n      var sizeOfSnap = stdin.readInt32LE(0);\n      if (stdin.length >= 4 + sizeOfSnap + 4) {\n        var sizeOfBody = stdin.readInt32LE(4 + sizeOfSnap);\n        if (stdin.length >= 4 + sizeOfSnap + 4 + sizeOfBody) {\n          var snap = stdin.toString('utf8', 4, 4 + sizeOfSnap);\n          var body = Buffer.alloc(sizeOfBody);\n          var startOfBody = 4 + sizeOfSnap + 4;\n          stdin.copy(body, 0, startOfBody, startOfBody + sizeOfBody);\n          stdin = Buffer.alloc(0);\n          var code = module.wrap(body);\n          var s = new vm.Script(code, {\n            filename: snap,\n            produceCachedData: true,\n            sourceless: true\n          });\n          if (!s.cachedDataProduced) {\n            console.error('Pkg: Cached data not produced.');\n            process.exit(2);\n          }\n          var h = Buffer.alloc(4);\n          var b = s.cachedData;\n          h.writeInt32LE(b.length, 0);\n          process.stdout.write(h);\n          process.stdout.write(b);\n        }\n      }\n    }\n  });\n  process.stdin.resume();\n`;\n\nconst children: Record<\n  string,\n  ChildProcessByStdio<Writable, Readable, null>\n> = {};\n\nexport function fabricate(\n  bakes: string[],\n  fabricator: Target,\n  snap: string,\n  body: Buffer,\n  cb: (error?: Error, buffer?: Buffer) => void\n) {\n  const activeBakes = bakes.filter((bake) => {\n    // list of bakes that don't influence the bytecode\n    const bake2 = bake.replace(/_/g, '-');\n\n    return !['--prof', '--v8-options', '--trace-opt', '--trace-deopt'].includes(\n      bake2\n    );\n  });\n\n  const cmd = fabricator.binaryPath;\n  const key = JSON.stringify([cmd, activeBakes]);\n  let child = children[key];\n\n  if (!child) {\n    const stderr = log.debugMode ? process.stdout : 'ignore';\n    children[key] = spawn(cmd, activeBakes.concat('-e', script), {\n      stdio: ['pipe', 'pipe', stderr],\n      env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },\n    });\n    child = children[key];\n  }\n\n  function kill() {\n    delete children[key];\n    child.kill();\n  }\n\n  let stdout = Buffer.alloc(0);\n\n  function onError(error: Error) {\n    // eslint-disable-next-line @typescript-eslint/no-use-before-define\n    removeListeners();\n    kill();\n    cb(\n      new Error(\n        `Failed to make bytecode ${fabricator.nodeRange}-${fabricator.arch} for file ${snap} error (${error.message})`\n      )\n    );\n  }\n\n  function onClose(code: number) {\n    // eslint-disable-next-line @typescript-eslint/no-use-before-define\n    removeListeners();\n    kill();\n    if (code !== 0) {\n      return cb(\n        new Error(\n          `Failed to make bytecode ${fabricator.nodeRange}-${fabricator.arch} for file ${snap}`\n        )\n      );\n    }\n\n    // eslint-disable-next-line no-console\n    console.log(stdout.toString());\n    return cb(new Error(`${cmd} closed unexpectedly`));\n  }\n\n  function onData(data: Buffer) {\n    stdout = Buffer.concat([stdout, data]);\n    if (stdout.length >= 4) {\n      const sizeOfBlob = stdout.readInt32LE(0);\n      if (stdout.length >= 4 + sizeOfBlob) {\n        const blob = Buffer.alloc(sizeOfBlob);\n        stdout.copy(blob, 0, 4, 4 + sizeOfBlob);\n        // eslint-disable-next-line @typescript-eslint/no-use-before-define\n        removeListeners();\n        return cb(undefined, blob);\n      }\n    }\n  }\n\n  function removeListeners() {\n    child.removeListener('error', onError);\n    child.removeListener('close', onClose);\n    child.stdin.removeListener('error', onError);\n    child.stdout.removeListener('error', onError);\n    child.stdout.removeListener('data', onData);\n  }\n\n  child.on('error', onError);\n  child.on('close', onClose);\n  child.stdin.on('error', onError);\n  child.stdout.on('error', onError);\n  child.stdout.on('data', onData);\n\n  const h = Buffer.alloc(4);\n  let b = Buffer.from(snap);\n  h.writeInt32LE(b.length, 0);\n  child.stdin.write(h);\n  child.stdin.write(b);\n  b = body;\n  h.writeInt32LE(b.length, 0);\n  child.stdin.write(h);\n  child.stdin.write(b);\n}\n\nexport function fabricateTwice(\n  bakes: string[],\n  fabricator: Target,\n  snap: string,\n  body: Buffer,\n  cb: (error?: Error, buffer?: Buffer) => void\n) {\n  fabricate(bakes, fabricator, snap, body, (error, buffer) => {\n    // node0 can not produce second time, even if first time produced fine,\n    // probably because of 'filename' cache. also, there are weird cases\n    // when node4 can not compile as well, for example file 'lib/js-yaml/dumper.js'\n    // of package js-yaml@3.9.0 does not get bytecode second time on node4-win-x64\n    if (error) return fabricate(bakes, fabricator, snap, body, cb);\n    cb(undefined, buffer);\n  });\n}\n\nexport function shutdown() {\n  for (const key in children) {\n    if (children[key]) {\n      const child = children[key];\n      delete children[key];\n      child.kill();\n    }\n  }\n}\n"
  },
  {
    "path": "lib/follow.ts",
    "content": "import { sync, SyncOpts } from 'resolve';\nimport fs from 'fs';\nimport path from 'path';\nimport { toNormalizedRealPath } from './common';\n\nimport type { PackageJson } from './types';\n\nconst PROOF = 'a-proof-that-main-is-captured.js';\n\nfunction parentDirectoriesContain(parent: string, directory: string) {\n  let currentParent = parent;\n\n  while (true) {\n    if (currentParent === directory) {\n      return true;\n    }\n\n    const newParent = path.dirname(currentParent);\n\n    if (newParent === currentParent) {\n      return false;\n    }\n\n    currentParent = newParent;\n  }\n}\n\ninterface FollowOptions extends Pick<SyncOpts, 'basedir' | 'extensions'> {\n  ignoreFile?: string;\n  catchReadFile?: (file: string) => void;\n  catchPackageFilter?: (config: PackageJson, base: string, dir: string) => void;\n}\n\nexport function follow(x: string, opts: FollowOptions) {\n  // TODO async version\n  return new Promise<string>((resolve) => {\n    resolve(\n      sync(x, {\n        basedir: opts.basedir,\n        extensions: opts.extensions,\n        isFile: (file) => {\n          if (\n            opts.ignoreFile &&\n            path.join(path.dirname(opts.ignoreFile), PROOF) === file\n          ) {\n            return true;\n          }\n\n          let stat;\n\n          try {\n            stat = fs.statSync(file);\n          } catch (e) {\n            const ex = e as NodeJS.ErrnoException;\n\n            if (ex && (ex.code === 'ENOENT' || ex.code === 'ENOTDIR'))\n              return false;\n\n            throw ex;\n          }\n\n          return stat.isFile() || stat.isFIFO();\n        },\n        isDirectory: (directory) => {\n          if (\n            opts.ignoreFile &&\n            parentDirectoriesContain(opts.ignoreFile, directory)\n          ) {\n            return false;\n          }\n\n          let stat;\n\n          try {\n            stat = fs.statSync(directory);\n          } catch (e) {\n            const ex = e as NodeJS.ErrnoException;\n\n            if (ex && (ex.code === 'ENOENT' || ex.code === 'ENOTDIR')) {\n              return false;\n            }\n\n            throw ex;\n          }\n\n          return stat.isDirectory();\n        },\n        readFileSync: (file) => {\n          if (opts.ignoreFile && opts.ignoreFile === file) {\n            return Buffer.from(`{\"main\":\"${PROOF}\"}`);\n          }\n\n          if (opts.catchReadFile) {\n            opts.catchReadFile(file);\n          }\n\n          return fs.readFileSync(file);\n        },\n        packageFilter: (config, base, dir) => {\n          if (opts.catchPackageFilter) {\n            opts.catchPackageFilter(config, base, dir);\n          }\n\n          return config;\n        },\n\n        /** function to synchronously resolve a potential symlink to its real path */\n        // realpathSync?: (file: string) => string;\n        realpathSync: (file) => {\n          const file2 = toNormalizedRealPath(file);\n          return file2;\n        },\n      })\n    );\n  });\n}\n"
  },
  {
    "path": "lib/help.ts",
    "content": "import chalk from 'chalk';\n\nexport default function help() {\n  // eslint-disable-next-line no-console\n  console.log(`\n  ${chalk.bold('pkg')} [options] <input>\n\n  ${chalk.dim('Options:')}\n\n    -h, --help           output usage information\n    -v, --version        output pkg version\n    -t, --targets        comma-separated list of targets (see examples)\n    -c, --config         package.json or any json file with top-level config\n    --options            bake v8 options into executable to run with them on\n    -o, --output         output file name or template for several files\n    --out-path           path to save output one or more executables\n    -d, --debug          show more information during packaging process [off]\n    -b, --build          don't download prebuilt base binaries, build them\n    --public             speed up and disclose the sources of top-level project\n    --public-packages    force specified packages to be considered public\n    --no-bytecode        skip bytecode generation and include source files as plain js\n    --no-native-build    skip native addons build\n    --no-dict            comma-separated list of packages names to ignore dictionaries. Use --no-dict * to disable all dictionaries\n    -C, --compress       [default=None] compression algorithm = Brotli or GZip\n\n  ${chalk.dim('Examples:')}\n\n  ${chalk.gray('–')} Makes executables for Linux, macOS and Windows\n    ${chalk.cyan('$ pkg index.js')}\n  ${chalk.gray('–')} Takes package.json from cwd and follows 'bin' entry\n    ${chalk.cyan('$ pkg .')}\n  ${chalk.gray('–')} Makes executable for particular target machine\n    ${chalk.cyan('$ pkg -t node14-win-arm64 index.js')}\n  ${chalk.gray('–')} Makes executables for target machines of your choice\n    ${chalk.cyan('$ pkg -t node16-linux,node18-linux,node18-win index.js')}\n  ${chalk.gray(\n    '–'\n  )} Bakes '--expose-gc' and '--max-heap-size=34' into executable\n    ${chalk.cyan('$ pkg --options \"expose-gc,max-heap-size=34\" index.js')}\n  ${chalk.gray('–')} Consider packageA and packageB to be public\n    ${chalk.cyan('$ pkg --public-packages \"packageA,packageB\" index.js')}\n  ${chalk.gray('–')} Consider all packages to be public\n    ${chalk.cyan('$ pkg --public-packages \"*\" index.js')}\n  ${chalk.gray('–')} Bakes '--expose-gc' into executable\n    ${chalk.cyan('$ pkg --options expose-gc index.js')}\n  ${chalk.gray(\n    '–'\n  )} reduce size of the data packed inside the executable with GZip\n    ${chalk.cyan('$ pkg --compress GZip index.js')}\n`);\n}\n"
  },
  {
    "path": "lib/index.ts",
    "content": "/* eslint-disable require-atomic-updates */\n\nimport assert from 'assert';\nimport {\n  existsSync,\n  mkdirp,\n  readFile,\n  remove,\n  stat,\n  readFileSync,\n  writeFileSync,\n  copyFileSync,\n} from 'fs-extra';\nimport minimist from 'minimist';\nimport { need, system } from 'pkg-fetch';\nimport path from 'path';\n\nimport { log, wasReported } from './log';\nimport help from './help';\nimport { isPackageJson } from './common';\nimport packer from './packer';\nimport { plusx } from './chmod';\nimport producer from './producer';\nimport refine from './refiner';\nimport { shutdown } from './fabricator';\nimport walk, { Marker, WalkerParams } from './walker';\nimport { Target, NodeTarget, SymLinks } from './types';\nimport { CompressType } from './compress_type';\nimport { patchMachOExecutable, signMachOExecutable } from './mach-o';\n\nconst { version } = JSON.parse(\n  readFileSync(path.join(__dirname, '../package.json'), 'utf-8')\n);\n\nfunction isConfiguration(file: string) {\n  return isPackageJson(file) || file.endsWith('.config.json');\n}\n\n// http://www.openwall.com/lists/musl/2012/12/08/4\n\nconst {\n  hostArch,\n  hostPlatform,\n  isValidNodeRange,\n  knownArchs,\n  knownPlatforms,\n  toFancyArch,\n  toFancyPlatform,\n} = system;\n// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\nconst hostNodeRange = `node${process.version.match(/^v(\\d+)/)![1]}`;\n\nfunction parseTargets(items: string[]): NodeTarget[] {\n  // [ 'node6-macos-x64', 'node6-linux-x64' ]\n  const targets: NodeTarget[] = [];\n\n  for (const item of items) {\n    const target = {\n      nodeRange: hostNodeRange,\n      platform: hostPlatform,\n      arch: hostArch,\n    };\n\n    if (item !== 'host') {\n      for (const token of item.split('-')) {\n        if (!token) {\n          continue;\n        }\n\n        if (isValidNodeRange(token)) {\n          target.nodeRange = token;\n          continue;\n        }\n\n        const p = toFancyPlatform(token);\n\n        if (knownPlatforms.indexOf(p) >= 0) {\n          target.platform = p;\n          continue;\n        }\n        const a = toFancyArch(token);\n\n        if (knownArchs.indexOf(a) >= 0) {\n          target.arch = a;\n          continue;\n        }\n\n        throw wasReported(`Unknown token '${token}' in '${item}'`);\n      }\n    }\n\n    targets.push(target as NodeTarget);\n  }\n\n  return targets;\n}\n\nfunction stringifyTarget(target: NodeTarget) {\n  const { nodeRange, platform, arch } = target;\n  return `${nodeRange}-${platform}-${arch}`;\n}\n\ninterface DifferentResult {\n  nodeRange?: boolean;\n  platform?: boolean;\n  arch?: boolean;\n}\n\nfunction differentParts(targets: NodeTarget[]): DifferentResult {\n  const nodeRanges: Record<string, boolean> = {};\n  const platforms: Record<string, boolean> = {};\n  const archs: Record<string, boolean> = {};\n\n  for (const target of targets) {\n    nodeRanges[target.nodeRange] = true;\n    platforms[target.platform] = true;\n    archs[target.arch] = true;\n  }\n\n  const result: DifferentResult = {};\n\n  if (Object.keys(nodeRanges).length > 1) {\n    result.nodeRange = true;\n  }\n\n  if (Object.keys(platforms).length > 1) {\n    result.platform = true;\n  }\n\n  if (Object.keys(archs).length > 1) {\n    result.arch = true;\n  }\n\n  return result;\n}\n\nfunction stringifyTargetForOutput(\n  output: string,\n  target: NodeTarget,\n  different: DifferentResult\n) {\n  const a = [output];\n\n  if (different.nodeRange) {\n    a.push(target.nodeRange);\n  }\n\n  if (different.platform) {\n    a.push(target.platform);\n  }\n\n  if (different.arch) {\n    a.push(target.arch);\n  }\n\n  return a.join('-');\n}\n\nfunction fabricatorForTarget({ nodeRange, arch }: NodeTarget) {\n  let fabPlatform = hostPlatform;\n\n  if (\n    hostArch !== arch &&\n    (hostPlatform === 'linux' || hostPlatform === 'alpine')\n  ) {\n    // With linuxstatic, it is possible to generate bytecode for different\n    // arch with simple QEMU configuration instead of the entire sysroot.\n    fabPlatform = 'linuxstatic';\n  }\n\n  return {\n    nodeRange,\n    platform: fabPlatform,\n    arch,\n  };\n}\n\nconst dryRunResults: Record<string, boolean> = {};\n\nasync function needWithDryRun({\n  forceBuild,\n  nodeRange,\n  platform,\n  arch,\n}: NodeTarget) {\n  const result = await need({\n    dryRun: true,\n    forceBuild,\n    nodeRange,\n    platform,\n    arch,\n  });\n  assert(['exists', 'fetched', 'built'].indexOf(result) >= 0);\n  dryRunResults[result] = true;\n}\n\nconst targetsCache: Record<string, string> = {};\n\nasync function needViaCache(target: NodeTarget) {\n  const s = stringifyTarget(target);\n  let c = targetsCache[s];\n\n  if (c) {\n    return c;\n  }\n\n  const { forceBuild, nodeRange, platform, arch } = target;\n\n  c = await need({\n    forceBuild,\n    nodeRange,\n    platform,\n    arch,\n  });\n\n  targetsCache[s] = c;\n\n  return c;\n}\n\nexport async function exec(argv2: string[]) {\n  const argv = minimist(argv2, {\n    boolean: [\n      'b',\n      'build',\n      'bytecode',\n      'native-build',\n      'd',\n      'debug',\n      'h',\n      'help',\n      'public',\n      'v',\n      'version',\n      'signature',\n    ],\n    string: [\n      '_',\n      'c',\n      'config',\n      'o',\n      'options',\n      'output',\n      'outdir',\n      'out-dir',\n      'out-path',\n      'public-packages',\n      'no-dict',\n      't',\n      'target',\n      'targets',\n      'C',\n      'compress',\n    ],\n    default: { bytecode: true, 'native-build': true, signature: true },\n  });\n\n  if (argv.h || argv.help) {\n    help();\n    return;\n  }\n\n  // version\n\n  if (argv.v || argv.version) {\n    // eslint-disable-next-line no-console\n    console.log(version);\n    return;\n  }\n\n  log.info(`pkg@${version}`);\n\n  // debug\n\n  log.debugMode = argv.d || argv.debug;\n\n  // forceBuild\n\n  const forceBuild = argv.b || argv.build;\n\n  // doCompress\n  const algo = argv.C || argv.compress || 'None';\n\n  let doCompress: CompressType = CompressType.None;\n  switch (algo.toLowerCase()) {\n    case 'brotli':\n    case 'br':\n      doCompress = CompressType.Brotli;\n      break;\n    case 'gzip':\n    case 'gz':\n      doCompress = CompressType.GZip;\n      break;\n    case 'none':\n      break;\n    default:\n      throw wasReported(\n        `Invalid compression algorithm ${algo} ( should be None, Brotli or Gzip)`\n      );\n  }\n  if (doCompress !== CompressType.None) {\n    // eslint-disable-next-line no-console\n    console.log('compression: ', CompressType[doCompress]);\n  }\n\n  // _\n\n  if (!argv._.length) {\n    throw wasReported('Entry file/directory is expected', [\n      'Pass --help to see usage information',\n    ]);\n  }\n\n  if (argv._.length > 1) {\n    throw wasReported('Not more than one entry file/directory is expected');\n  }\n\n  // input\n\n  let input = path.resolve(argv._[0]);\n\n  if (!existsSync(input)) {\n    throw wasReported('Input file does not exist', [input]);\n  }\n\n  if ((await stat(input)).isDirectory()) {\n    input = path.join(input, 'package.json');\n    if (!existsSync(input)) {\n      throw wasReported('Input file does not exist', [input]);\n    }\n  }\n\n  // inputJson\n\n  let inputJson;\n  let inputJsonName;\n\n  if (isConfiguration(input)) {\n    inputJson = JSON.parse(await readFile(input, 'utf-8'));\n    inputJsonName = inputJson.name;\n\n    if (inputJsonName) {\n      inputJsonName = inputJsonName.split('/').pop(); // @org/foo\n    }\n  }\n\n  // inputBin\n\n  let inputBin;\n\n  if (inputJson) {\n    let { bin } = inputJson;\n\n    if (bin) {\n      if (typeof bin === 'object') {\n        if (bin[inputJsonName]) {\n          bin = bin[inputJsonName];\n        } else {\n          bin = bin[Object.keys(bin)[0]]; // TODO multiple inputs to pkg them all?\n        }\n      }\n      inputBin = path.resolve(path.dirname(input), bin);\n      if (!existsSync(inputBin)) {\n        throw wasReported(\n          'Bin file does not exist (taken from package.json ' +\n            \"'bin' property)\",\n          [inputBin]\n        );\n      }\n    }\n  }\n\n  if (inputJson && !inputBin) {\n    throw wasReported(\"Property 'bin' does not exist in\", [input]);\n  }\n\n  // inputFin\n\n  const inputFin = inputBin || input;\n\n  // config\n\n  let config = argv.c || argv.config;\n\n  if (inputJson && config) {\n    throw wasReported(\"Specify either 'package.json' or config. Not both\");\n  }\n\n  // configJson\n\n  let configJson;\n\n  if (config) {\n    config = path.resolve(config);\n    if (!existsSync(config)) {\n      throw wasReported('Config file does not exist', [config]);\n    }\n\n    // eslint-disable-next-line import/no-dynamic-require, global-require\n    configJson = require(config); // may be either json or js\n\n    if (\n      !configJson.name &&\n      !configJson.files &&\n      !configJson.dependencies &&\n      !configJson.pkg\n    ) {\n      // package.json not detected\n      configJson = { pkg: configJson };\n    }\n  }\n\n  // output, outputPath\n\n  let output = argv.o || argv.output;\n  let outputPath = argv['out-path'] || argv.outdir || argv['out-dir'];\n  let autoOutput = false;\n\n  if (output && outputPath) {\n    throw wasReported(\"Specify either 'output' or 'out-path'. Not both\");\n  }\n\n  if (!output) {\n    let name;\n\n    if (inputJson) {\n      name = inputJsonName;\n\n      if (!name) {\n        throw wasReported(\"Property 'name' does not exist in\", [argv._[0]]);\n      }\n    } else if (configJson) {\n      name = configJson.name;\n    }\n\n    if (!name) {\n      name = path.basename(inputFin);\n    }\n\n    if (!outputPath) {\n      if (inputJson && inputJson.pkg) {\n        outputPath = inputJson.pkg.outputPath;\n      } else if (configJson && configJson.pkg) {\n        outputPath = configJson.pkg.outputPath;\n      }\n\n      outputPath = outputPath || '';\n    }\n\n    autoOutput = true;\n    const ext = path.extname(name);\n    output = name.slice(0, -ext.length || undefined);\n    output = path.resolve(outputPath || '', output);\n  } else {\n    output = path.resolve(output);\n  }\n\n  // targets\n\n  const sTargets = argv.t || argv.target || argv.targets || '';\n\n  if (typeof sTargets !== 'string') {\n    throw wasReported(`Something is wrong near ${JSON.stringify(sTargets)}`);\n  }\n\n  let targets = parseTargets(\n    sTargets.split(',').filter((t) => t)\n  ) as unknown as Array<NodeTarget & Partial<Target>>;\n\n  if (!targets.length) {\n    let jsonTargets;\n\n    if (inputJson && inputJson.pkg) {\n      jsonTargets = inputJson.pkg.targets;\n    } else if (configJson && configJson.pkg) {\n      jsonTargets = configJson.pkg.targets;\n    }\n\n    if (jsonTargets) {\n      targets = parseTargets(jsonTargets);\n    }\n  }\n\n  if (!targets.length) {\n    if (!autoOutput) {\n      targets = parseTargets(['host']);\n      assert(targets.length === 1);\n    } else {\n      targets = parseTargets(['linux', 'macos', 'win']);\n    }\n\n    log.info(\n      'Targets not specified. Assuming:',\n      `${targets.map((t) => stringifyTarget(t)).join(', ')}`\n    );\n  }\n\n  // differentParts\n\n  const different = differentParts(targets);\n\n  // targets[].output\n\n  for (const target of targets) {\n    let file;\n\n    if (targets.length === 1) {\n      file = output;\n    } else {\n      file = stringifyTargetForOutput(output, target, different);\n    }\n\n    if (target.platform === 'win' && path.extname(file) !== '.exe') {\n      file += '.exe';\n    }\n\n    target.output = file;\n  }\n\n  // bakes\n\n  const bakes = ((argv.options || '') as string)\n    .split(',')\n    .filter((bake) => bake)\n    .map((bake) => `--${bake}`);\n\n  // check if input is going\n  // to be overwritten by output\n\n  for (const target of targets) {\n    if (target.output === inputFin) {\n      if (autoOutput) {\n        target.output += `-${target.platform}`;\n      } else {\n        throw wasReported('Refusing to overwrite input file', [inputFin]);\n      }\n    }\n  }\n\n  // fetch targets\n\n  const { bytecode } = argv;\n\n  const nativeBuild = argv['native-build'];\n\n  for (const target of targets) {\n    target.forceBuild = forceBuild;\n\n    await needWithDryRun(target);\n\n    target.fabricator = fabricatorForTarget(target) as Target;\n\n    if (bytecode) {\n      await needWithDryRun({\n        ...target.fabricator,\n        forceBuild,\n      });\n    }\n  }\n\n  if (dryRunResults.fetched && !dryRunResults.built) {\n    log.info('Fetching base Node.js binaries to PKG_CACHE_PATH');\n  }\n\n  for (const target of targets) {\n    target.binaryPath = await needViaCache(target);\n    const f = target.fabricator;\n\n    if (f && bytecode) {\n      f.binaryPath = await needViaCache(f as NodeTarget);\n\n      if (f.platform === 'macos') {\n        // ad-hoc sign the base binary temporarily to generate bytecode\n        // due to the new mandatory signing requirement\n        const signedBinaryPath = `${f.binaryPath}-signed`;\n        await remove(signedBinaryPath);\n        copyFileSync(f.binaryPath, signedBinaryPath);\n        try {\n          signMachOExecutable(signedBinaryPath);\n        } catch {\n          throw wasReported('Cannot generate bytecode', [\n            'pkg fails to run \"codesign\" utility. Due to the mandatory signing',\n            'requirement of macOS, executables must be signed. Please ensure the',\n            'utility is installed and properly configured.',\n          ]);\n        }\n        f.binaryPath = signedBinaryPath;\n      }\n\n      if (f.platform !== 'win') {\n        await plusx(f.binaryPath);\n      }\n    }\n  }\n\n  // marker\n\n  let marker: Marker;\n\n  if (configJson) {\n    marker = {\n      config: configJson,\n      base: path.dirname(config),\n      configPath: config,\n    };\n  } else {\n    marker = {\n      config: inputJson || {}, // not `inputBin` because only `input`\n      base: path.dirname(input), // is the place for `inputJson`\n      configPath: input,\n    };\n  }\n\n  marker.toplevel = true;\n\n  // public\n\n  const params: WalkerParams = {};\n\n  if (argv.public) {\n    params.publicToplevel = true;\n  }\n\n  if (argv['public-packages']) {\n    params.publicPackages = argv['public-packages'].split(',');\n\n    if (params.publicPackages?.indexOf('*') !== -1) {\n      params.publicPackages = ['*'];\n    }\n  }\n\n  if (argv['no-dict']) {\n    params.noDictionary = argv['no-dict'].split(',');\n\n    if (params.noDictionary?.indexOf('*') !== -1) {\n      params.noDictionary = ['*'];\n    }\n  }\n\n  // records\n\n  let records;\n  let entrypoint = inputFin;\n  let symLinks: SymLinks;\n  const addition = isConfiguration(input) ? input : undefined;\n\n  const walkResult = await walk(marker, entrypoint, addition, params);\n  entrypoint = walkResult.entrypoint;\n\n  records = walkResult.records;\n  symLinks = walkResult.symLinks;\n\n  const refineResult = refine(records, entrypoint, symLinks);\n  entrypoint = refineResult.entrypoint;\n  records = refineResult.records;\n  symLinks = refineResult.symLinks;\n\n  const backpack = packer({ records, entrypoint, bytecode, symLinks });\n\n  log.debug('Targets:', JSON.stringify(targets, null, 2));\n\n  for (const target of targets) {\n    if (target.output && existsSync(target.output)) {\n      if ((await stat(target.output)).isFile()) {\n        await remove(target.output);\n      } else {\n        throw wasReported('Refusing to overwrite non-file output', [\n          target.output,\n        ]);\n      }\n    } else if (target.output) {\n      await mkdirp(path.dirname(target.output));\n    }\n\n    await producer({\n      backpack,\n      bakes,\n      slash: target.platform === 'win' ? '\\\\' : '/',\n      target: target as Target,\n      symLinks,\n      doCompress,\n      nativeBuild,\n    });\n\n    if (target.platform !== 'win' && target.output) {\n      if (argv.signature && target.platform === 'macos') {\n        // patch executable to allow code signing\n        const buf = patchMachOExecutable(readFileSync(target.output));\n        writeFileSync(target.output, buf);\n\n        try {\n          // sign executable ad-hoc to workaround the new mandatory signing requirement\n          // users can always replace the signature if necessary\n          signMachOExecutable(target.output);\n        } catch {\n          if (target.arch === 'arm64') {\n            log.warn('Unable to sign the macOS executable', [\n              'Due to the mandatory code signing requirement, before the',\n              'executable is distributed to end users, it must be signed.',\n              'Otherwise, it will be immediately killed by kernel on launch.',\n              'An ad-hoc signature is sufficient.',\n              'To do that, run pkg on a Mac, or transfer the executable to a Mac',\n              'and run \"codesign --sign - <executable>\", or (if you use Linux)',\n              'install \"ldid\" utility to PATH and then run pkg again',\n            ]);\n          }\n        }\n      }\n\n      await plusx(target.output);\n    }\n  }\n\n  shutdown();\n}\n"
  },
  {
    "path": "lib/log.js",
    "content": "export { log, wasReported } from 'pkg-fetch/lib-es5/log';\n"
  },
  {
    "path": "lib/mach-o.ts",
    "content": "import { execFileSync } from 'child_process';\n\nfunction parseCStr(buf: Buffer) {\n  for (let i = 0; i < buf.length; i += 1) {\n    if (buf[i] === 0) {\n      return buf.slice(0, i).toString();\n    }\n  }\n}\n\nfunction patchCommand(type: number, buf: Buffer, file: Buffer) {\n  // segment_64\n  if (type === 0x19) {\n    const name = parseCStr(buf.slice(0, 16));\n\n    if (name === '__LINKEDIT') {\n      const fileoff = buf.readBigUInt64LE(32);\n      const vmsizePatched = BigInt(file.length) - fileoff;\n      const filesizePatched = vmsizePatched;\n\n      buf.writeBigUInt64LE(vmsizePatched, 24);\n      buf.writeBigUInt64LE(filesizePatched, 40);\n    }\n  }\n\n  // symtab\n  if (type === 0x2) {\n    const stroff = buf.readUInt32LE(8);\n    const strsizePatched = file.length - stroff;\n\n    buf.writeUInt32LE(strsizePatched, 12);\n  }\n}\n\nfunction patchMachOExecutable(file: Buffer) {\n  const align = 8;\n  const hsize = 32;\n\n  const ncmds = file.readUInt32LE(16);\n  const buf = file.slice(hsize);\n\n  for (let offset = 0, i = 0; i < ncmds; i += 1) {\n    const type = buf.readUInt32LE(offset);\n\n    offset += 4;\n    const size = buf.readUInt32LE(offset) - 8;\n\n    offset += 4;\n    patchCommand(type, buf.slice(offset, offset + size), file);\n\n    offset += size;\n    if (offset & align) {\n      offset += align - (offset & align);\n    }\n  }\n\n  return file;\n}\n\nfunction signMachOExecutable(executable: string) {\n  try {\n    execFileSync('codesign', ['-f', '--sign', '-', executable], {\n      stdio: 'inherit',\n    });\n  } catch {\n    execFileSync('ldid', ['-Cadhoc', '-S', executable], { stdio: 'inherit' });\n  }\n}\n\nexport { patchMachOExecutable, signMachOExecutable };\n"
  },
  {
    "path": "lib/packer.ts",
    "content": "/* eslint-disable complexity */\n\nimport assert from 'assert';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\n  STORE_BLOB,\n  STORE_CONTENT,\n  STORE_LINKS,\n  STORE_STAT,\n  isDotJS,\n  isDotJSON,\n} from './common';\n\nimport { log, wasReported } from './log';\nimport { FileRecord, FileRecords, SymLinks } from './types';\n\nconst { version } = JSON.parse(\n  fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst bootstrapText = fs\n  .readFileSync(require.resolve('../prelude/bootstrap.js'), 'utf8')\n  .replace('%VERSION%', version);\n\nconst commonText = fs.readFileSync(require.resolve('./common'), 'utf8');\n\nconst diagnosticText = fs.readFileSync(\n  require.resolve('../prelude/diagnostic.js'),\n  'utf8'\n);\n\nfunction itemsToText<T extends unknown>(items: T[]) {\n  const len = items.length;\n  return len.toString() + (len % 10 === 1 ? ' item' : ' items');\n}\n\nfunction hasAnyStore(record: FileRecord) {\n  // discarded records like native addons\n  for (const store of [STORE_BLOB, STORE_CONTENT, STORE_LINKS, STORE_STAT]) {\n    if (record[store]) return true;\n  }\n  return false;\n}\n\ninterface PackerOptions {\n  records: FileRecords;\n  entrypoint: string;\n  bytecode: boolean;\n  symLinks: SymLinks;\n}\n\nexport interface Stripe {\n  snap: string;\n  skip?: boolean;\n  store: number;\n  file?: string;\n  buffer?: Buffer;\n}\n\nexport default function packer({\n  records,\n  entrypoint,\n  bytecode,\n}: PackerOptions) {\n  const stripes: Stripe[] = [];\n\n  for (const snap in records) {\n    if (records[snap]) {\n      const record = records[snap];\n      const { file } = record;\n\n      if (!hasAnyStore(record)) {\n        continue;\n      }\n\n      assert(record[STORE_STAT], 'packer: no STORE_STAT');\n      assert(\n        record[STORE_BLOB] ||\n          record[STORE_CONTENT] ||\n          record[STORE_LINKS] ||\n          record[STORE_STAT]\n      );\n\n      if (record[STORE_BLOB] && !bytecode) {\n        delete record[STORE_BLOB];\n        if (!record[STORE_CONTENT]) {\n          // TODO make a test for it?\n          throw wasReported(\n            '--no-bytecode and no source breaks final executable',\n            [\n              file,\n              'Please run with \"-d\" and without \"--no-bytecode\" first, and make',\n              'sure that debug log does not contain \"was included as bytecode\".',\n            ]\n          );\n        }\n      }\n      for (const store of [\n        STORE_BLOB,\n        STORE_CONTENT,\n        STORE_LINKS,\n        STORE_STAT,\n      ]) {\n        const value = record[store];\n\n        if (!value) {\n          continue;\n        }\n\n        if (store === STORE_BLOB || store === STORE_CONTENT) {\n          if (record.body === undefined) {\n            stripes.push({ snap, store, file });\n          } else if (Buffer.isBuffer(record.body)) {\n            stripes.push({ snap, store, buffer: record.body });\n          } else if (typeof record.body === 'string') {\n            stripes.push({ snap, store, buffer: Buffer.from(record.body) });\n          } else {\n            assert(false, 'packer: bad STORE_BLOB/STORE_CONTENT');\n          }\n        } else if (store === STORE_LINKS) {\n          if (Array.isArray(value)) {\n            const dedupedValue = [...new Set(value)];\n            log.debug('files & folders deduped = ', dedupedValue);\n            const buffer = Buffer.from(JSON.stringify(dedupedValue));\n            stripes.push({ snap, store, buffer });\n          } else {\n            assert(false, 'packer: bad STORE_LINKS');\n          }\n        } else if (store === STORE_STAT) {\n          if (typeof value === 'object') {\n            const newStat = { ...value };\n            const buffer = Buffer.from(JSON.stringify(newStat));\n            stripes.push({ snap, store, buffer });\n          } else {\n            assert(false, 'packer: unknown store');\n          }\n        }\n\n        if (record[STORE_CONTENT]) {\n          const disclosed = isDotJS(file) || isDotJSON(file);\n          log.debug(\n            disclosed\n              ? 'The file was included as DISCLOSED code (with sources)'\n              : 'The file was included as asset content',\n            file\n          );\n        } else if (record[STORE_BLOB]) {\n          log.debug('The file was included as bytecode (no sources)', file);\n        } else if (record[STORE_LINKS]) {\n          const link = record[STORE_LINKS];\n          log.debug(\n            `The directory files list was included (${itemsToText(link)})`,\n            file\n          );\n        }\n      }\n    }\n  }\n  const prelude =\n    `return (function (REQUIRE_COMMON, VIRTUAL_FILESYSTEM, DEFAULT_ENTRYPOINT, SYMLINKS, DICT, DOCOMPRESS) {\n        ${bootstrapText}${\n      log.debugMode ? diagnosticText : ''\n    }\\n})(function (exports) {\\n${commonText}\\n},\\n` +\n    `%VIRTUAL_FILESYSTEM%` +\n    `\\n,\\n` +\n    `%DEFAULT_ENTRYPOINT%` +\n    `\\n,\\n` +\n    `%SYMLINKS%` +\n    '\\n,\\n' +\n    '%DICT%' +\n    '\\n,\\n' +\n    '%DOCOMPRESS%' +\n    `\\n);`;\n\n  return { prelude, entrypoint, stripes };\n}\n"
  },
  {
    "path": "lib/producer.ts",
    "content": "import { createBrotliCompress, createGzip } from 'zlib';\nimport Multistream from 'multistream';\nimport assert from 'assert';\nimport { execFileSync } from 'child_process';\nimport fs from 'fs-extra';\nimport intoStream from 'into-stream';\nimport path from 'path';\nimport streamMeter from 'stream-meter';\nimport { Readable } from 'stream';\n\nimport { STORE_BLOB, STORE_CONTENT, isDotNODE, snapshotify } from './common';\nimport { log, wasReported } from './log';\nimport { fabricateTwice } from './fabricator';\nimport { platform, SymLinks, Target } from './types';\nimport { Stripe } from './packer';\nimport { CompressType } from './compress_type';\n\ninterface NotFound {\n  notFound: true;\n}\n\ninterface Placeholder {\n  position: number;\n  size: number;\n  padder: string;\n}\n\ntype PlaceholderTypes =\n  | 'BAKERY'\n  | 'PAYLOAD_POSITION'\n  | 'PAYLOAD_SIZE'\n  | 'PRELUDE_POSITION'\n  | 'PRELUDE_SIZE';\ntype PlaceholderMap = Record<PlaceholderTypes, Placeholder | NotFound>;\n\nfunction discoverPlaceholder(\n  binaryBuffer: Buffer,\n  searchString: string,\n  padder: string\n): Placeholder | NotFound {\n  const placeholder = Buffer.from(searchString);\n  const position = binaryBuffer.indexOf(placeholder);\n\n  if (position === -1) {\n    return { notFound: true };\n  }\n\n  return { position, size: placeholder.length, padder };\n}\n\nfunction injectPlaceholder(\n  fd: number,\n  placeholder: Placeholder | NotFound,\n  value: string | number | Buffer,\n  cb: (\n    err: NodeJS.ErrnoException | null,\n    written: number,\n    buffer: Buffer\n  ) => void\n) {\n  if ('notFound' in placeholder) {\n    assert(false, 'Placeholder for not found');\n  }\n\n  const { position, size, padder } = placeholder;\n  let stringValue: Buffer = Buffer.from('');\n\n  if (typeof value === 'number') {\n    stringValue = Buffer.from(value.toString());\n  } else if (typeof value === 'string') {\n    stringValue = Buffer.from(value);\n  } else {\n    stringValue = value;\n  }\n\n  const padding = Buffer.from(padder.repeat(size - stringValue.length));\n\n  stringValue = Buffer.concat([stringValue, padding]);\n  fs.write(fd, stringValue, 0, stringValue.length, position, cb);\n}\n\nfunction discoverPlaceholders(binaryBuffer: Buffer) {\n  return {\n    BAKERY: discoverPlaceholder(\n      binaryBuffer,\n      `\\0${'// BAKERY '.repeat(20)}`,\n      '\\0'\n    ),\n    PAYLOAD_POSITION: discoverPlaceholder(\n      binaryBuffer,\n      '// PAYLOAD_POSITION //',\n      ' '\n    ),\n    PAYLOAD_SIZE: discoverPlaceholder(binaryBuffer, '// PAYLOAD_SIZE //', ' '),\n    PRELUDE_POSITION: discoverPlaceholder(\n      binaryBuffer,\n      '// PRELUDE_POSITION //',\n      ' '\n    ),\n    PRELUDE_SIZE: discoverPlaceholder(binaryBuffer, '// PRELUDE_SIZE //', ' '),\n  };\n}\n\nfunction injectPlaceholders(\n  fd: number,\n  placeholders: PlaceholderMap,\n  values: Record<PlaceholderTypes, number | string | Buffer>,\n  cb: (error?: Error | null) => void\n) {\n  injectPlaceholder(fd, placeholders.BAKERY, values.BAKERY, (error) => {\n    if (error) {\n      return cb(error);\n    }\n\n    injectPlaceholder(\n      fd,\n      placeholders.PAYLOAD_POSITION,\n      values.PAYLOAD_POSITION,\n      (error2) => {\n        if (error2) {\n          return cb(error2);\n        }\n\n        injectPlaceholder(\n          fd,\n          placeholders.PAYLOAD_SIZE,\n          values.PAYLOAD_SIZE,\n          (error3) => {\n            if (error3) {\n              return cb(error3);\n            }\n\n            injectPlaceholder(\n              fd,\n              placeholders.PRELUDE_POSITION,\n              values.PRELUDE_POSITION,\n              (error4) => {\n                if (error4) {\n                  return cb(error4);\n                }\n\n                injectPlaceholder(\n                  fd,\n                  placeholders.PRELUDE_SIZE,\n                  values.PRELUDE_SIZE,\n                  cb\n                );\n              }\n            );\n          }\n        );\n      }\n    );\n  });\n}\n\nfunction makeBakeryValueFromBakes(bakes: string[]) {\n  const parts = [];\n\n  if (bakes.length) {\n    for (let i = 0; i < bakes.length; i += 1) {\n      parts.push(Buffer.from(bakes[i]));\n      parts.push(Buffer.alloc(1));\n    }\n\n    parts.push(Buffer.alloc(1));\n  }\n\n  return Buffer.concat(parts);\n}\n\nfunction replaceDollarWise(s: string, sf: string, st: string) {\n  return s.replace(sf, () => st);\n}\n\nfunction makePreludeBufferFromPrelude(prelude: string) {\n  return Buffer.from(\n    `(function(process, require, console, EXECPATH_FD, PAYLOAD_POSITION, PAYLOAD_SIZE) { ${prelude}\\n})` // dont remove \\n\n  );\n}\n\nfunction findPackageJson(nodeFile: string) {\n  let dir = nodeFile;\n\n  while (dir !== '/') {\n    dir = path.dirname(dir);\n\n    if (fs.existsSync(path.join(dir, 'package.json'))) {\n      break;\n    }\n  }\n\n  if (dir === '/') {\n    throw new Error(`package.json not found for \"${nodeFile}\"`);\n  }\n\n  return dir;\n}\n\nfunction nativePrebuildInstall(target: Target, nodeFile: string) {\n  const prebuildInstall = path.join(\n    __dirname,\n    '../node_modules/.bin/prebuild-install'\n  );\n  const dir = findPackageJson(nodeFile);\n  // parse the target node version from the binaryPath\n  const nodeVersion = path.basename(target.binaryPath).split('-')[1];\n\n  if (!/^v[0-9]+\\.[0-9]+\\.[0-9]+$/.test(nodeVersion)) {\n    throw new Error(`Couldn't find node version, instead got: ${nodeVersion}`);\n  }\n\n  const nativeFile = `${nodeFile}.${target.platform}.${nodeVersion}`;\n\n  if (fs.existsSync(nativeFile)) {\n    return nativeFile;\n  }\n\n  // prebuild-install will overwrite the target .node file, so take a backup\n  if (!fs.existsSync(`${nodeFile}.bak`)) {\n    fs.copyFileSync(nodeFile, `${nodeFile}.bak`);\n  }\n\n  const napiVersions = JSON.parse(\n    fs.readFileSync(path.join(dir, 'package.json'), { encoding: 'utf-8' })\n  )?.binary?.napi_versions;\n\n  const options = [\n    '--platform',\n    platform[target.platform],\n    '--arch',\n    target.arch,\n  ];\n\n  if (napiVersions == null) {\n    // TODO: consider target node version and supported n-api version\n    options.push('--target', nodeVersion);\n  }\n\n  // run prebuild\n  execFileSync(prebuildInstall, options, { cwd: dir });\n\n  // move the prebuild to a new name with a platform/version extension\n  fs.copyFileSync(nodeFile, nativeFile);\n\n  // put the backed up file back\n  fs.moveSync(`${nodeFile}.bak`, nodeFile, { overwrite: true });\n\n  return nativeFile;\n}\n\ninterface ProducerOptions {\n  backpack: { entrypoint: string; stripes: Stripe[]; prelude: string };\n  bakes: string[];\n  slash: string;\n  target: Target;\n  symLinks: SymLinks;\n  doCompress: CompressType;\n  nativeBuild: boolean;\n}\n\n/**\n * instead of creating a vfs dicionnary with actual path as key\n * we use a compression mechanism that can reduce significantly\n * the memory footprint of the vfs in the code.\n *\n * without vfs compression:\n *\n * vfs = {\n *   \"/folder1/folder2/file1.js\": {};\n *   \"/folder1/folder2/folder3/file2.js\": {};\n *   \"/folder1/folder2/folder3/file3.js\": {};\n * }\n *\n * with compression :\n *\n * fileDictionary = {\n *    \"folder1\": \"1\",\n *    \"folder2\": \"2\",\n *    \"file1\": \"3\",\n *    \"folder3\": \"4\",\n *    \"file2\": \"5\",\n *    \"file3\": \"6\",\n * }\n * vfs = {\n *   \"/1/2/3\": {};\n *   \"/1/2/4/5\": {};\n *   \"/1/2/4/6\": {};\n * }\n *\n * note: the key is computed in base36 for further compression.\n */\nconst fileDictionary: { [key: string]: string } = {};\nlet counter = 0;\nfunction getOrCreateHash(fileOrFolderName: string) {\n  let existingKey = fileDictionary[fileOrFolderName];\n  if (!existingKey) {\n    const newkey = counter;\n    counter += 1;\n    existingKey = newkey.toString(36);\n    fileDictionary[fileOrFolderName] = existingKey;\n  }\n  return existingKey;\n}\nconst separator = '/';\n\nfunction makeKey(\n  doCompression: CompressType,\n  fullpath: string,\n  slash: string\n): string {\n  if (doCompression === CompressType.None) return fullpath;\n  return fullpath.split(slash).map(getOrCreateHash).join(separator);\n}\n\nexport default function producer({\n  backpack,\n  bakes,\n  slash,\n  target,\n  symLinks,\n  doCompress,\n  nativeBuild,\n}: ProducerOptions) {\n  return new Promise<void>((resolve, reject) => {\n    if (!Buffer.alloc) {\n      throw wasReported(\n        'Your node.js does not have Buffer.alloc. Please upgrade!'\n      );\n    }\n\n    const { prelude } = backpack;\n    let { entrypoint, stripes } = backpack;\n    entrypoint = snapshotify(entrypoint, slash);\n    stripes = stripes.slice();\n\n    const vfs: Record<string, Record<string, [number, number]>> = {};\n\n    for (const stripe of stripes) {\n      let { snap } = stripe;\n      snap = snapshotify(snap, slash);\n      const vfsKey = makeKey(doCompress, snap, slash);\n      if (!vfs[vfsKey]) vfs[vfsKey] = {};\n    }\n\n    const snapshotSymLinks: SymLinks = {};\n\n    for (const [key, value] of Object.entries(symLinks)) {\n      const k = snapshotify(key, slash);\n      const v = snapshotify(value, slash);\n      const vfsKey = makeKey(doCompress, k, slash);\n      snapshotSymLinks[vfsKey] = makeKey(doCompress, v, slash);\n    }\n\n    let meter: streamMeter.StreamMeter;\n    let count = 0;\n\n    function pipeToNewMeter(s: Readable) {\n      meter = streamMeter();\n      return s.pipe(meter);\n    }\n    function pipeMayCompressToNewMeter(s: Readable): streamMeter.StreamMeter {\n      if (doCompress === CompressType.GZip) {\n        return pipeToNewMeter(s.pipe(createGzip()));\n      }\n      if (doCompress === CompressType.Brotli) {\n        return pipeToNewMeter(s.pipe(createBrotliCompress()));\n      }\n      return pipeToNewMeter(s);\n    }\n\n    function next(s: Readable) {\n      count += 1;\n      return pipeToNewMeter(s);\n    }\n\n    const binaryBuffer = fs.readFileSync(target.binaryPath);\n    const placeholders = discoverPlaceholders(binaryBuffer);\n\n    let track = 0;\n    let prevStripe: Stripe;\n\n    let payloadPosition: number;\n    let payloadSize: number;\n    let preludePosition: number;\n    let preludeSize: number;\n\n    new Multistream((cb) => {\n      if (count === 0) {\n        return cb(null, next(intoStream(binaryBuffer)));\n      }\n\n      if (count === 1) {\n        payloadPosition = meter.bytes;\n        return cb(null, next(intoStream(Buffer.alloc(0))));\n      }\n\n      if (count === 2) {\n        if (prevStripe && !prevStripe.skip) {\n          const { store } = prevStripe;\n          let { snap } = prevStripe;\n          snap = snapshotify(snap, slash);\n          const vfsKey = makeKey(doCompress, snap, slash);\n          vfs[vfsKey][store] = [track, meter.bytes];\n          track += meter.bytes;\n        }\n\n        if (stripes.length) {\n          // clone to prevent 'skip' propagate\n          // to other targets, since same stripe\n          // is used for several targets\n          const stripe = { ...(stripes.shift() as Stripe) };\n          prevStripe = stripe;\n\n          if (stripe.buffer) {\n            if (stripe.store === STORE_BLOB) {\n              const snap = snapshotify(stripe.snap, slash);\n              return fabricateTwice(\n                bakes,\n                target.fabricator,\n                snap,\n                stripe.buffer,\n                (error, buffer) => {\n                  if (error) {\n                    log.warn(error.message);\n                    stripe.skip = true;\n                    return cb(null, intoStream(Buffer.alloc(0)));\n                  }\n\n                  cb(\n                    null,\n                    pipeMayCompressToNewMeter(\n                      intoStream(buffer || Buffer.from(''))\n                    )\n                  );\n                }\n              );\n            }\n            return cb(\n              null,\n              pipeMayCompressToNewMeter(intoStream(stripe.buffer))\n            );\n          }\n\n          if (stripe.file) {\n            if (stripe.file === target.output) {\n              return cb(\n                wasReported(\n                  'Trying to take executable into executable',\n                  stripe.file\n                ),\n                null\n              );\n            }\n\n            assert.strictEqual(stripe.store, STORE_CONTENT); // others must be buffers from walker\n\n            if (isDotNODE(stripe.file) && nativeBuild) {\n              try {\n                const platformFile = nativePrebuildInstall(target, stripe.file);\n\n                if (fs.existsSync(platformFile)) {\n                  return cb(\n                    null,\n                    pipeMayCompressToNewMeter(fs.createReadStream(platformFile))\n                  );\n                }\n              } catch (err) {\n                log.debug(\n                  `prebuild-install failed[${stripe.file}]:`,\n                  (err as Error).message\n                );\n              }\n            }\n            return cb(\n              null,\n              pipeMayCompressToNewMeter(fs.createReadStream(stripe.file))\n            );\n          }\n\n          assert(false, 'producer: bad stripe');\n        } else {\n          payloadSize = track;\n          preludePosition = payloadPosition + payloadSize;\n          return cb(\n            null,\n            next(\n              intoStream(\n                makePreludeBufferFromPrelude(\n                  replaceDollarWise(\n                    replaceDollarWise(\n                      replaceDollarWise(\n                        replaceDollarWise(\n                          replaceDollarWise(\n                            prelude,\n                            '%VIRTUAL_FILESYSTEM%',\n                            JSON.stringify(vfs)\n                          ),\n                          '%DEFAULT_ENTRYPOINT%',\n                          JSON.stringify(entrypoint)\n                        ),\n                        '%SYMLINKS%',\n                        JSON.stringify(snapshotSymLinks)\n                      ),\n                      '%DICT%',\n                      JSON.stringify(fileDictionary)\n                    ),\n                    '%DOCOMPRESS%',\n                    JSON.stringify(doCompress)\n                  )\n                )\n              )\n            )\n          );\n        }\n      } else {\n        return cb(null, null);\n      }\n    })\n      .on('error', (error) => {\n        reject(error);\n      })\n      .pipe(fs.createWriteStream(target.output))\n      .on('error', (error) => {\n        reject(error);\n      })\n      .on('close', () => {\n        preludeSize = meter.bytes;\n        fs.open(target.output, 'r+', (error, fd) => {\n          if (error) return reject(error);\n          injectPlaceholders(\n            fd,\n            placeholders,\n            {\n              BAKERY: makeBakeryValueFromBakes(bakes),\n              PAYLOAD_POSITION: payloadPosition,\n              PAYLOAD_SIZE: payloadSize,\n              PRELUDE_POSITION: preludePosition,\n              PRELUDE_SIZE: preludeSize,\n            },\n            (error2) => {\n              if (error2) return reject(error2);\n              fs.close(fd, (error3) => {\n                if (error3) return reject(error3);\n                resolve();\n              });\n            }\n          );\n        });\n      });\n  });\n}\n"
  },
  {
    "path": "lib/refiner.ts",
    "content": "import path from 'path';\nimport chalk from 'chalk';\nimport {\n  STORE_LINKS,\n  retrieveDenominator,\n  substituteDenominator,\n} from './common';\nimport { FileRecords, SymLinks } from './types';\nimport { log } from './log';\n\nconst win32 = process.platform === 'win32';\n\nfunction hasParent(file: string, records: FileRecords) {\n  const dirname = path.dirname(file);\n\n  // root directory\n  if (dirname === file) {\n    return false;\n  }\n\n  return Boolean(records[dirname]);\n}\n\nfunction purgeTopDirectories(records: FileRecords) {\n  while (true) {\n    let found = false;\n\n    for (const file in records) {\n      if (records[file]) {\n        const record = records[file];\n        const links = record[STORE_LINKS];\n\n        if (links && links.length === 1) {\n          if (!hasParent(file, records)) {\n            const file2 = path.join(file, links[0]);\n            const record2 = records[file2];\n            const links2 = record2[STORE_LINKS];\n\n            if (links2 && links2.length === 1) {\n              const file3 = path.join(file2, links2[0]);\n              const record3 = records[file3];\n              const links3 = record3[STORE_LINKS];\n\n              if (links3) {\n                delete records[file];\n                log.debug(chalk.cyan('Deleting record file :', file));\n                found = true;\n              }\n            }\n          }\n        }\n      }\n    }\n\n    if (!found) break;\n  }\n}\n\nfunction denominate(\n  records: FileRecords,\n  entrypoint: string,\n  denominator: number,\n  symLinks: SymLinks\n) {\n  const newRecords: FileRecords = {};\n\n  const makeSnap = (file: string) => {\n    let snap = substituteDenominator(file, denominator);\n\n    if (win32) {\n      if (snap.slice(1) === ':') snap += '\\\\';\n    } else if (snap === '') {\n      snap = '/';\n    }\n\n    return snap;\n  };\n\n  for (const file in records) {\n    if (records[file]) {\n      const snap = makeSnap(file);\n      newRecords[snap] = records[file];\n    }\n  }\n\n  const tmpSymLinks = symLinks;\n  symLinks = {};\n\n  for (const [key, value] of Object.entries(tmpSymLinks)) {\n    const key1 = makeSnap(key);\n    const value1 = makeSnap(value);\n    symLinks[key1] = value1;\n  }\n\n  return {\n    records: newRecords,\n    entrypoint: substituteDenominator(entrypoint, denominator),\n    symLinks,\n  };\n}\n\nexport default function refiner(\n  records: FileRecords,\n  entrypoint: string,\n  symLinks: SymLinks\n) {\n  purgeTopDirectories(records);\n  const denominator = retrieveDenominator(Object.keys(records));\n  return denominate(records, entrypoint, denominator, symLinks);\n}\n"
  },
  {
    "path": "lib/types.ts",
    "content": "import type { log } from './log';\n\nexport interface FileRecord {\n  file: string;\n  body?: Buffer | string;\n  // This could be improved a bit. making this stricter opens up a lot of\n  // changes that need to be made throughout the code though\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  [key: number]: any;\n}\n\nexport type FileRecords = Record<string, FileRecord>;\n\ntype License =\n  | string\n  | {\n      type: string;\n    };\n\nexport type Patches = Record<\n  string,\n  string & { do: 'erase' | 'prepend' | 'append' }[]\n>;\n\nexport type ConfigDictionary = Record<\n  string,\n  {\n    pkg?: {\n      dependencies?: Record<string, string>;\n    };\n    dependencies?: Record<string, string>;\n  }\n>;\n\nexport interface PkgOptions {\n  scripts?: string[];\n  log?: (logger: typeof log, context: Record<string, string>) => void;\n  assets?: string[];\n  deployFiles?: string[];\n  patches?: Patches;\n  dictionary: ConfigDictionary;\n}\n\nexport interface PackageJson {\n  name?: string;\n  private?: boolean;\n  licenses?: License;\n  license?: License;\n  main?: string;\n  dependencies?: Record<string, string>;\n  files?: string[];\n  pkg?: PkgOptions;\n}\n\nexport const platform = {\n  macos: 'darwin',\n  win: 'win32',\n  linux: 'linux',\n};\n\nexport interface NodeTarget {\n  nodeRange: string;\n  arch: string;\n  platform: keyof typeof platform;\n  forceBuild?: boolean;\n}\n\nexport interface Target extends NodeTarget {\n  binaryPath: string;\n  output: string;\n  fabricator: Target;\n}\n\nexport type SymLinks = Record<string, string>;\n"
  },
  {
    "path": "lib/walker.ts",
    "content": "/* eslint-disable require-atomic-updates */\n\nimport assert from 'assert';\nimport fs from 'fs-extra';\nimport isCore from 'is-core-module';\nimport globby from 'globby';\nimport path from 'path';\nimport chalk from 'chalk';\n\nimport {\n  ALIAS_AS_RELATIVE,\n  ALIAS_AS_RESOLVABLE,\n  STORE_BLOB,\n  STORE_CONTENT,\n  STORE_LINKS,\n  STORE_STAT,\n  isDotJS,\n  isDotJSON,\n  isDotNODE,\n  isPackageJson,\n  normalizePath,\n  toNormalizedRealPath,\n} from './common';\n\nimport { follow } from './follow';\nimport { log, wasReported } from './log';\nimport * as detector from './detector';\nimport {\n  ConfigDictionary,\n  FileRecord,\n  FileRecords,\n  Patches,\n  PackageJson,\n  SymLinks,\n} from './types';\n\nexport interface Marker {\n  hasDictionary?: boolean;\n  activated?: boolean;\n  toplevel?: boolean;\n  public?: boolean;\n  hasDeployFiles?: boolean;\n  config?: PackageJson;\n  configPath: string;\n  base: string;\n}\n\ninterface Task {\n  file: string;\n  data?: unknown;\n  reason?: string;\n  marker?: Marker;\n  store: number;\n}\n\ninterface Derivative {\n  alias: string;\n  mayExclude?: boolean;\n  mustExclude?: boolean;\n  aliasType: number;\n  fromDependencies?: boolean;\n}\n\n// Note: as a developer, you can set the PKG_STRICT_VER variable.\n//       this will turn on some assertion in the walker code below\n//       to assert that each file content/state that we appending\n//       to the virtual file system applies to  a real file,\n//       not a symlink.\n//       By default assertion are disabled as they can have a\n//       performance hit.\nconst strictVerify = Boolean(process.env.PKG_STRICT_VER);\n\nconst win32 = process.platform === 'win32';\n\nfunction unlikelyJavascript(file: string) {\n  return ['.css', '.html', '.json', '.vue'].includes(path.extname(file));\n}\n\nfunction isPublic(config: PackageJson) {\n  if (config.private) {\n    return false;\n  }\n\n  const { licenses } = config;\n  let { license } = config;\n\n  if (licenses) {\n    license = licenses;\n  }\n\n  if (license && !Array.isArray(license)) {\n    license = typeof license === 'string' ? license : license.type;\n  }\n\n  if (Array.isArray(license)) {\n    license = license.map((c) => String(c.type || c)).join(',');\n  }\n\n  if (!license) {\n    return false;\n  }\n\n  if (/^\\(/.test(license)) {\n    license = license.slice(1);\n  }\n\n  if (/\\)$/.test(license)) {\n    license = license.slice(0, -1);\n  }\n\n  license = license.toLowerCase();\n  const allLicenses = Array.prototype.concat(\n    license.split(' or '),\n    license.split(' and '),\n    license.split('/'),\n    license.split(',')\n  );\n  let result = false;\n  const foss = [\n    'isc',\n    'mit',\n    'apache-2.0',\n    'apache 2.0',\n    'public domain',\n    'bsd',\n    'bsd-2-clause',\n    'bsd-3-clause',\n    'wtfpl',\n    'cc-by-3.0',\n    'x11',\n    'artistic-2.0',\n    'gplv3',\n    'mpl',\n    'mplv2.0',\n    'unlicense',\n    'apache license 2.0',\n    'zlib',\n    'mpl-2.0',\n    'nasa-1.3',\n    'apache license, version 2.0',\n    'lgpl-2.1+',\n    'cc0-1.0',\n  ];\n\n  for (const c of allLicenses) {\n    result = foss.indexOf(c) >= 0;\n\n    if (result) {\n      break;\n    }\n  }\n\n  return result;\n}\n\nfunction upon(p: string, base: string) {\n  if (typeof p !== 'string') {\n    throw wasReported('Config items must be strings. See examples');\n  }\n\n  let negate = false;\n\n  if (p[0] === '!') {\n    p = p.slice(1);\n    negate = true;\n  }\n\n  p = path.join(base, p);\n\n  if (win32) {\n    p = p.replace(/\\\\/g, '/');\n  }\n\n  if (negate) {\n    p = `!${p}`;\n  }\n\n  return p;\n}\n\nfunction collect(ps: string[]) {\n  return globby.sync(ps, { dot: true });\n}\n\nfunction expandFiles(efs: string | string[], base: string) {\n  if (!Array.isArray(efs)) {\n    efs = [efs];\n  }\n\n  efs = collect(efs.map((p) => upon(p, base)));\n\n  return efs;\n}\n\nasync function stepRead(record: FileRecord) {\n  if (strictVerify) {\n    assert(record.file === toNormalizedRealPath(record.file));\n  }\n\n  let body;\n\n  try {\n    body = await fs.readFile(record.file);\n  } catch (error) {\n    const exception = error as NodeJS.ErrnoException;\n    log.error(`Cannot read file, ${exception.code}`, record.file);\n    throw wasReported(exception.message);\n  }\n\n  record.body = body;\n}\n\nfunction stepStrip(record: FileRecord) {\n  let body = (record.body || '').toString('utf8');\n\n  if (/^\\ufeff/.test(body)) {\n    body = body.replace(/^\\ufeff/, '');\n  }\n\n  if (/^#!/.test(body)) {\n    body = body.replace(/^#![^\\n]*\\n/, '\\n');\n  }\n\n  record.body = body;\n}\n\nfunction stepDetect(\n  record: FileRecord,\n  marker: Marker,\n  derivatives: Derivative[]\n) {\n  let { body = '' } = record;\n\n  if (body instanceof Buffer) {\n    body = body.toString();\n  }\n\n  try {\n    detector.detect(body, (node, trying) => {\n      const { toplevel } = marker;\n      let d = detector.visitorSuccessful(node) as unknown as Derivative;\n\n      if (d) {\n        if (d.mustExclude) {\n          return false;\n        }\n\n        d.mayExclude = d.mayExclude || trying;\n        derivatives.push(d);\n\n        return false;\n      }\n\n      d = detector.visitorNonLiteral(node) as unknown as Derivative;\n\n      if (d) {\n        if (typeof d === 'object' && d.mustExclude) {\n          return false;\n        }\n\n        const debug = !toplevel || d.mayExclude || trying;\n        const level = debug ? 'debug' : 'warn';\n        log[level](`Cannot resolve '${d.alias}'`, [\n          record.file,\n          'Dynamic require may fail at run time, because the requested file',\n          'is unknown at compilation time and not included into executable.',\n          \"Use a string literal as an argument for 'require', or leave it\",\n          \"as is and specify the resolved file name in 'scripts' option.\",\n        ]);\n        return false;\n      }\n\n      d = detector.visitorMalformed(node) as unknown as Derivative;\n\n      if (d) {\n        // there is no 'mustExclude'\n        const debug = !toplevel || trying;\n        const level = debug ? 'debug' : 'warn'; // there is no 'mayExclude'\n        log[level](`Malformed requirement for '${d.alias}'`, [record.file]);\n        return false;\n      }\n\n      d = detector.visitorUseSCWD(node) as unknown as Derivative;\n\n      if (d) {\n        // there is no 'mustExclude'\n        const level = 'debug'; // there is no 'mayExclude'\n        log[level](`Path.resolve(${d.alias}) is ambiguous`, [\n          record.file,\n          \"It resolves relatively to 'process.cwd' by default, however\",\n          \"you may want to use 'path.dirname(require.main.filename)'\",\n        ]);\n\n        return false;\n      }\n\n      return true; // can i go inside?\n    });\n  } catch (error) {\n    log.error((error as Error).message, record.file);\n    throw wasReported((error as Error).message);\n  }\n}\n\nfunction findCommonJunctionPoint(file: string, realFile: string) {\n  // find common denominator => where the link changes\n  while (toNormalizedRealPath(path.dirname(file)) === path.dirname(realFile)) {\n    file = path.dirname(file);\n    realFile = path.dirname(realFile);\n  }\n\n  return { file, realFile };\n}\n\nexport interface WalkerParams {\n  publicToplevel?: boolean;\n  publicPackages?: string[];\n  noDictionary?: string[];\n}\n\nclass Walker {\n  private params: WalkerParams;\n\n  private symLinks: SymLinks;\n\n  private patches: Patches;\n\n  private tasks: Task[];\n\n  private records: FileRecords;\n\n  private dictionary: ConfigDictionary;\n\n  constructor() {\n    this.tasks = [];\n    this.records = {};\n    this.dictionary = {};\n    this.patches = {};\n    this.params = {};\n    this.symLinks = {};\n  }\n\n  appendRecord({ file, store }: Task) {\n    if (this.records[file]) {\n      return;\n    }\n\n    if (\n      store === STORE_BLOB ||\n      store === STORE_CONTENT ||\n      store === STORE_LINKS\n    ) {\n      // make sure we have a real file\n      if (strictVerify) {\n        assert(file === toNormalizedRealPath(file));\n      }\n    }\n\n    this.records[file] = { file };\n  }\n\n  private append(task: Task) {\n    if (strictVerify) {\n      assert(typeof task.file === 'string');\n      assert(task.file === normalizePath(task.file));\n    }\n\n    this.appendRecord(task);\n    this.tasks.push(task);\n\n    const what = {\n      [STORE_BLOB]: 'Bytecode of',\n      [STORE_CONTENT]: 'Content of',\n      [STORE_LINKS]: 'Directory',\n      [STORE_STAT]: 'Stat info of',\n    }[task.store];\n\n    if (task.reason) {\n      log.debug(\n        `${what} ${task.file} is added to queue. It was required from ${task.reason}`\n      );\n    } else {\n      log.debug(`${what} ${task.file} is added to queue.`);\n    }\n  }\n\n  appendSymlink(file: string, realFile: string) {\n    const a = findCommonJunctionPoint(file, realFile);\n    file = a.file;\n    realFile = a.realFile;\n\n    if (!this.symLinks[file]) {\n      const dn = path.dirname(file);\n      this.appendFileInFolder({\n        file: dn,\n        store: STORE_LINKS,\n        data: path.basename(file),\n      });\n\n      log.debug(`adding symlink ${file}  => ${path.relative(file, realFile)}`);\n      this.symLinks[file] = realFile;\n\n      this.appendStat({\n        file: realFile,\n        store: STORE_STAT,\n      });\n      this.appendStat({\n        file: dn,\n        store: STORE_STAT,\n      });\n      this.appendStat({\n        file,\n        store: STORE_STAT,\n      });\n    }\n  }\n\n  appendStat(task: Task) {\n    assert(task.store === STORE_STAT);\n    this.append(task);\n  }\n\n  appendFileInFolder(task: Task) {\n    if (strictVerify) {\n      assert(task.store === STORE_LINKS);\n      assert(typeof task.file === 'string');\n    }\n    const realFile = toNormalizedRealPath(task.file);\n    if (realFile === task.file) {\n      this.append(task);\n      return;\n    }\n    this.append({ ...task, file: realFile });\n    this.appendStat({\n      file: task.file,\n      store: STORE_STAT,\n    });\n    this.appendStat({\n      file: path.dirname(task.file),\n      store: STORE_STAT,\n    });\n  }\n\n  appendBlobOrContent(task: Task) {\n    if (strictVerify) {\n      assert(task.file === normalizePath(task.file));\n    }\n\n    assert(task.store === STORE_BLOB || task.store === STORE_CONTENT);\n    assert(typeof task.file === 'string');\n    const realFile = toNormalizedRealPath(task.file);\n\n    if (realFile === task.file) {\n      this.append(task);\n      return;\n    }\n\n    this.append({ ...task, file: realFile });\n    this.appendSymlink(task.file, realFile);\n    this.appendStat({\n      file: task.file,\n      store: STORE_STAT,\n    });\n  }\n\n  async appendFilesFromConfig(marker: Marker) {\n    const { config, configPath, base } = marker;\n    const pkgConfig = config?.pkg;\n\n    if (pkgConfig) {\n      let { scripts } = pkgConfig;\n\n      if (scripts) {\n        scripts = expandFiles(scripts, base);\n\n        for (const script of scripts) {\n          const stat = await fs.stat(script);\n\n          if (stat.isFile()) {\n            if (!isDotJS(script) && !isDotJSON(script) && !isDotNODE(script)) {\n              log.warn(\"Non-javascript file is specified in 'scripts'.\", [\n                'Pkg will probably fail to parse. Specify *.js in glob.',\n                script,\n              ]);\n            }\n\n            this.appendBlobOrContent({\n              file: normalizePath(script),\n              marker,\n              store: STORE_BLOB,\n              reason: configPath,\n            });\n          }\n        }\n      }\n\n      let { assets } = pkgConfig;\n\n      if (assets) {\n        assets = expandFiles(assets, base);\n\n        for (const asset of assets) {\n          log.debug(' Adding asset : .... ', asset);\n          const stat = await fs.stat(asset);\n\n          if (stat.isFile()) {\n            this.appendBlobOrContent({\n              file: normalizePath(asset),\n              marker,\n              store: STORE_CONTENT,\n              reason: configPath,\n            });\n          }\n        }\n      }\n    } else if (config) {\n      let { files } = config;\n\n      if (files) {\n        files = expandFiles(files, base);\n\n        for (let file of files) {\n          file = normalizePath(file);\n          const stat = await fs.stat(file);\n\n          if (stat.isFile()) {\n            // 1) remove sources of top-level(!) package 'files' i.e. ship as BLOB\n            // 2) non-source (non-js) files of top-level package are shipped as CONTENT\n            // 3) parsing some js 'files' of non-top-level packages fails, hence all CONTENT\n            if (marker.toplevel) {\n              this.appendBlobOrContent({\n                file,\n                marker,\n                store: isDotJS(file) ? STORE_BLOB : STORE_CONTENT,\n                reason: configPath,\n              });\n            } else {\n              this.appendBlobOrContent({\n                file,\n                marker,\n                store: STORE_CONTENT,\n                reason: configPath,\n              });\n            }\n          }\n        }\n      }\n    }\n  }\n\n  async stepActivate(marker: Marker, derivatives: Derivative[]) {\n    if (!marker) {\n      assert(false);\n    }\n\n    if (marker.activated) {\n      return;\n    }\n\n    const { config, base } = marker;\n\n    if (!config) {\n      assert(false);\n    }\n\n    const { name } = config;\n\n    if (name) {\n      const d = this.dictionary[name];\n\n      if (d) {\n        if (\n          typeof config.dependencies === 'object' &&\n          typeof d.dependencies === 'object'\n        ) {\n          Object.assign(config.dependencies, d.dependencies);\n          delete d.dependencies;\n        }\n\n        Object.assign(config, d);\n        marker.hasDictionary = true;\n      }\n    }\n\n    const { dependencies } = config;\n\n    if (typeof dependencies === 'object') {\n      for (const dependency in dependencies) {\n        // it may be `undefined` - overridden\n        // in dictionary (see publicsuffixlist)\n        if (dependencies[dependency]) {\n          derivatives.push({\n            alias: dependency,\n            aliasType: ALIAS_AS_RESOLVABLE,\n            fromDependencies: true,\n          });\n\n          derivatives.push({\n            alias: `${dependency}/package.json`,\n            aliasType: ALIAS_AS_RESOLVABLE,\n            fromDependencies: true,\n          });\n        }\n      }\n    }\n\n    const pkgConfig = config.pkg;\n\n    if (pkgConfig) {\n      const { patches } = pkgConfig;\n\n      if (patches) {\n        for (const key in patches) {\n          if (patches[key]) {\n            const p = path.join(base, key);\n            this.patches[p] = patches[key];\n          }\n        }\n      }\n\n      const { deployFiles } = pkgConfig;\n\n      if (deployFiles) {\n        marker.hasDeployFiles = true;\n\n        for (const deployFile of deployFiles) {\n          const type = deployFile[2] || 'file';\n          log.warn(`Cannot include ${type} %1 into executable.`, [\n            `The ${type} must be distributed with executable as %2.`,\n            `%1: ${path.relative(\n              process.cwd(),\n              path.join(base, deployFile[0])\n            )}`,\n            `%2: path-to-executable/${deployFile[1]}`,\n          ]);\n        }\n      }\n\n      if (pkgConfig.log) {\n        pkgConfig.log(log, { packagePath: base });\n      }\n    }\n\n    await this.appendFilesFromConfig(marker);\n    marker.public = isPublic(config);\n\n    if (!marker.public && marker.toplevel) {\n      marker.public = this.params.publicToplevel;\n    }\n\n    if (!marker.public && !marker.toplevel && this.params.publicPackages) {\n      marker.public =\n        this.params.publicPackages[0] === '*' ||\n        (!!name && this.params.publicPackages.indexOf(name) !== -1);\n    }\n\n    marker.activated = true;\n    // assert no further work with config\n    delete marker.config;\n  }\n\n  hasPatch(record: FileRecord) {\n    const patch = this.patches[record.file];\n\n    if (!patch) {\n      return;\n    }\n\n    return true;\n  }\n\n  stepPatch(record: FileRecord) {\n    const patch = this.patches[record.file];\n\n    if (!patch) {\n      return;\n    }\n\n    let body = (record.body || '').toString('utf8');\n\n    for (let i = 0; i < patch.length; i += 2) {\n      if (typeof patch[i] === 'object') {\n        if (patch[i].do === 'erase') {\n          body = patch[i + 1];\n        } else if (patch[i].do === 'prepend') {\n          body = patch[i + 1] + body;\n        } else if (patch[i].do === 'append') {\n          body += patch[i + 1];\n        }\n      } else if (typeof patch[i] === 'string') {\n        // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n        // function escapeRegExp\n        const esc = patch[i].replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n        const regexp = new RegExp(esc, 'g');\n        body = body.replace(regexp, patch[i + 1]);\n      }\n    }\n\n    record.body = body;\n  }\n\n  async stepDerivatives_ALIAS_AS_RELATIVE(\n    record: FileRecord,\n    marker: Marker,\n    derivative: Derivative\n  ) {\n    const file = normalizePath(\n      path.join(path.dirname(record.file), derivative.alias)\n    );\n\n    let stat;\n\n    try {\n      stat = await fs.stat(file);\n    } catch (error) {\n      const { toplevel } = marker;\n      const exception = error as NodeJS.ErrnoException;\n      const debug = !toplevel && exception.code === 'ENOENT';\n      const level = debug ? 'debug' : 'warn';\n      log[level](`Cannot stat, ${exception.code}`, [\n        file,\n        `The file was required from '${record.file}'`,\n      ]);\n    }\n\n    if (stat && stat.isFile()) {\n      this.appendBlobOrContent({\n        file,\n        marker,\n        store: STORE_CONTENT,\n        reason: record.file,\n      });\n    }\n  }\n\n  async stepDerivatives_ALIAS_AS_RESOLVABLE(\n    record: FileRecord,\n    marker: Marker,\n    derivative: Derivative\n  ) {\n    const newPackages: { packageJson: string; marker?: Marker }[] = [];\n\n    const catchReadFile = (file: string) => {\n      assert(isPackageJson(file), `walker: ${file} must be package.json`);\n      newPackages.push({ packageJson: file });\n    };\n\n    const catchPackageFilter = (config: PackageJson, base: string) => {\n      const newPackage = newPackages[newPackages.length - 1];\n      newPackage.marker = { config, configPath: newPackage.packageJson, base };\n    };\n\n    let newFile = '';\n    let failure: Error | undefined;\n\n    const basedir = path.dirname(record.file);\n    try {\n      newFile = await follow(derivative.alias, {\n        basedir,\n        // default is extensions: ['.js'], but\n        // it is not enough because 'typos.json'\n        // is not taken in require('./typos')\n        // in 'normalize-package-data/lib/fixer.js'\n        extensions: ['.js', '.json', '.node'],\n        catchReadFile,\n        catchPackageFilter,\n      });\n    } catch (error) {\n      failure = error as Error;\n    }\n\n    if (failure) {\n      const { toplevel } = marker;\n      const mainNotFound =\n        newPackages.length > 0 && !newPackages[0].marker?.config?.main;\n      const debug =\n        !toplevel ||\n        derivative.mayExclude ||\n        (mainNotFound && derivative.fromDependencies);\n      const level = debug ? 'debug' : 'warn';\n\n      if (mainNotFound) {\n        const message = \"Entry 'main' not found in %1\";\n        log[level](message, [\n          `%1: ${newPackages[0].packageJson}`,\n          `%2: ${record.file}`,\n        ]);\n      } else {\n        log[level](`${chalk.yellow(failure.message)}  in ${record.file}`);\n      }\n\n      return;\n    }\n\n    let newPackageForNewRecords;\n\n    for (const newPackage of newPackages) {\n      let newFile2;\n\n      try {\n        newFile2 = await follow(derivative.alias, {\n          basedir: path.dirname(record.file),\n          extensions: ['.js', '.json', '.node'],\n          ignoreFile: newPackage.packageJson,\n        });\n        if (strictVerify) {\n          assert(newFile2 === normalizePath(newFile2));\n        }\n      } catch (_) {\n        // not setting is enough\n      }\n\n      if (newFile2 !== newFile) {\n        newPackageForNewRecords = newPackage;\n        break;\n      }\n    }\n\n    if (newPackageForNewRecords) {\n      if (strictVerify) {\n        assert(\n          newPackageForNewRecords.packageJson ===\n            normalizePath(newPackageForNewRecords.packageJson)\n        );\n      }\n      this.appendBlobOrContent({\n        file: newPackageForNewRecords.packageJson,\n        marker: newPackageForNewRecords.marker,\n        store: STORE_CONTENT,\n        reason: record.file,\n      });\n    }\n\n    this.appendBlobOrContent({\n      file: newFile,\n      marker: newPackageForNewRecords ? newPackageForNewRecords.marker : marker,\n      store: STORE_BLOB,\n      reason: record.file,\n    });\n  }\n\n  async stepDerivatives(\n    record: FileRecord,\n    marker: Marker,\n    derivatives: Derivative[]\n  ) {\n    for (const derivative of derivatives) {\n      // TODO: actually use the target node version\n      if (isCore(derivative.alias, '99.0.0')) continue;\n\n      switch (derivative.aliasType) {\n        case ALIAS_AS_RELATIVE:\n          await this.stepDerivatives_ALIAS_AS_RELATIVE(\n            record,\n            marker,\n            derivative\n          );\n          break;\n        case ALIAS_AS_RESOLVABLE:\n          await this.stepDerivatives_ALIAS_AS_RESOLVABLE(\n            record,\n            marker,\n            derivative\n          );\n          break;\n        default:\n          assert(false, `walker: unknown aliasType ${derivative.aliasType}`);\n      }\n    }\n  }\n\n  async step_STORE_ANY(record: FileRecord, marker: Marker, store: number) {\n    if (strictVerify) {\n      assert(record.file === toNormalizedRealPath(record.file));\n    }\n    if (record[store] !== undefined) return;\n    record[store] = false; // default is discard\n\n    this.appendStat({\n      file: record.file,\n      store: STORE_STAT,\n    });\n\n    const derivatives1: Derivative[] = [];\n    await this.stepActivate(marker, derivatives1);\n    await this.stepDerivatives(record, marker, derivatives1);\n\n    if (store === STORE_BLOB) {\n      if (unlikelyJavascript(record.file) || isDotNODE(record.file)) {\n        this.appendBlobOrContent({\n          file: record.file,\n          marker,\n          store: STORE_CONTENT,\n        });\n        return; // discard\n      }\n\n      if (marker.public || marker.hasDictionary) {\n        this.appendBlobOrContent({\n          file: record.file,\n          marker,\n          store: STORE_CONTENT,\n        });\n      }\n    }\n\n    if (store === STORE_BLOB || this.hasPatch(record)) {\n      if (!record.body) {\n        await stepRead(record);\n        this.stepPatch(record);\n\n        if (store === STORE_BLOB) {\n          stepStrip(record);\n        }\n      }\n\n      if (store === STORE_BLOB) {\n        const derivatives2: Derivative[] = [];\n        stepDetect(record, marker, derivatives2);\n        await this.stepDerivatives(record, marker, derivatives2);\n      }\n    }\n\n    record[store] = true;\n  }\n\n  step_STORE_LINKS(record: FileRecord, data: unknown) {\n    if (strictVerify) {\n      assert(\n        record.file === toNormalizedRealPath(record.file),\n        ' expecting real file !!!'\n      );\n    }\n\n    if (record[STORE_LINKS]) {\n      record[STORE_LINKS].push(data);\n      return;\n    }\n\n    record[STORE_LINKS] = [data];\n\n    if (record[STORE_STAT]) {\n      return;\n    }\n    this.appendStat({\n      file: record.file,\n      store: STORE_STAT,\n    });\n  }\n\n  async step_STORE_STAT(record: FileRecord) {\n    if (record[STORE_STAT]) return;\n\n    const realPath = toNormalizedRealPath(record.file);\n    if (realPath !== record.file) {\n      this.appendStat({\n        file: realPath,\n        store: STORE_STAT,\n      });\n    }\n\n    try {\n      const valueStat = await fs.stat(record.file);\n\n      const value = {\n        mode: valueStat.mode,\n        size: valueStat.isFile() ? valueStat.size : 0,\n        isFileValue: valueStat.isFile(),\n        isDirectoryValue: valueStat.isDirectory(),\n        isSocketValue: valueStat.isSocket(),\n        isSymbolicLinkValue: valueStat.isSymbolicLink(),\n      };\n      record[STORE_STAT] = value;\n    } catch (error) {\n      const exception = error as NodeJS.ErrnoException;\n      log.error(`Cannot stat, ${exception.code}`, record.file);\n      throw wasReported(exception.message);\n    }\n\n    if (path.dirname(record.file) !== record.file) {\n      // root directory\n      this.appendFileInFolder({\n        file: path.dirname(record.file),\n        store: STORE_LINKS,\n        data: path.basename(record.file),\n      });\n    }\n  }\n\n  async step(task: Task) {\n    const { file, store, data } = task;\n    const record = this.records[file];\n\n    switch (store) {\n      case STORE_BLOB:\n      case STORE_CONTENT:\n        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n        await this.step_STORE_ANY(record, task.marker!, store);\n        break;\n      case STORE_LINKS:\n        this.step_STORE_LINKS(record, data);\n        break;\n      case STORE_STAT:\n        await this.step_STORE_STAT(record);\n        break;\n      default:\n        assert(false, `walker: unknown store ${store}`);\n    }\n  }\n\n  async readDictionary(marker: Marker) {\n    if (this.params.noDictionary?.[0] === '*') {\n      return;\n    }\n    const dd = path.join(__dirname, '../dictionary');\n    const files = await fs.readdir(dd);\n\n    for (const file of files) {\n      if (/\\.js$/.test(file)) {\n        const name = file.slice(0, -3);\n\n        if (this.params.noDictionary?.includes(file)) {\n          continue;\n        }\n        // eslint-disable-next-line import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires\n        const config = require(path.join(dd, file));\n        this.dictionary[name] = config;\n      }\n    }\n\n    const pkgConfig = marker.config?.pkg;\n\n    if (pkgConfig) {\n      const { dictionary } = pkgConfig;\n\n      if (dictionary) {\n        for (const name in dictionary) {\n          if (dictionary[name]) {\n            this.dictionary[name] = { pkg: dictionary[name] };\n          }\n        }\n      }\n    }\n  }\n\n  async start(\n    marker: Marker,\n    entrypoint: string,\n    addition: string | undefined,\n    params: WalkerParams\n  ) {\n    this.params = params;\n    this.symLinks = {};\n\n    await this.readDictionary(marker);\n\n    entrypoint = normalizePath(entrypoint);\n\n    this.appendBlobOrContent({\n      file: entrypoint,\n      marker,\n      store: STORE_BLOB,\n    });\n\n    if (addition) {\n      addition = normalizePath(addition);\n      this.appendBlobOrContent({\n        file: addition,\n        marker,\n        store: STORE_CONTENT,\n      });\n    }\n\n    const { tasks } = this;\n\n    for (let i = 0; i < tasks.length; i += 1) {\n      // NO MULTIPLE WORKERS! THIS WILL LEAD TO NON-DETERMINISTIC\n      // ORDER. one-by-one fifo is the only way to iterate tasks\n      await this.step(tasks[i]);\n    }\n\n    return {\n      symLinks: this.symLinks,\n      records: this.records,\n      entrypoint: normalizePath(entrypoint),\n    };\n  }\n}\n\nexport default async function walker(...args: Parameters<Walker['start']>) {\n  const w = new Walker();\n  return w.start(...args);\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"pkg\",\n  \"version\": \"5.8.1\",\n  \"description\": \"Package your Node.js project into an executable\",\n  \"main\": \"lib-es5/index.js\",\n  \"license\": \"MIT\",\n  \"repository\": \"vercel/pkg\",\n  \"types\": \"lib-es5/index.d.ts\",\n  \"bin\": {\n    \"pkg\": \"lib-es5/bin.js\"\n  },\n  \"files\": [\n    \"lib-es5/*.js\",\n    \"lib-es5/index.d.ts\",\n    \"dictionary/*.js\",\n    \"prelude/*.js\"\n  ],\n  \"prettier\": {\n    \"singleQuote\": true\n  },\n  \"dependencies\": {\n    \"@babel/generator\": \"7.18.2\",\n    \"@babel/parser\": \"7.18.4\",\n    \"@babel/types\": \"7.19.0\",\n    \"chalk\": \"^4.1.2\",\n    \"fs-extra\": \"^9.1.0\",\n    \"globby\": \"^11.1.0\",\n    \"into-stream\": \"^6.0.0\",\n    \"is-core-module\": \"2.9.0\",\n    \"minimist\": \"^1.2.6\",\n    \"multistream\": \"^4.1.0\",\n    \"pkg-fetch\": \"3.5.2\",\n    \"prebuild-install\": \"7.1.1\",\n    \"resolve\": \"^1.22.0\",\n    \"stream-meter\": \"^1.0.4\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"7.18.2\",\n    \"@types/babel__generator\": \"7.6.4\",\n    \"@types/fs-extra\": \"9.0.13\",\n    \"@types/is-core-module\": \"2.2.0\",\n    \"@types/minimist\": \"1.2.2\",\n    \"@types/multistream\": \"4.1.0\",\n    \"@types/node\": \"14.18.20\",\n    \"@types/resolve\": \"1.20.2\",\n    \"@types/stream-meter\": \"0.0.22\",\n    \"@typescript-eslint/eslint-plugin\": \"4.33.0\",\n    \"@typescript-eslint/parser\": \"4.33.0\",\n    \"eslint\": \"7.32.0\",\n    \"eslint-config-airbnb-base\": \"14.2.1\",\n    \"eslint-config-airbnb-typescript\": \"12.3.1\",\n    \"eslint-config-prettier\": \"8.5.0\",\n    \"eslint-plugin-import\": \"2.26.0\",\n    \"json-stable-stringify\": \"^1.0.1\",\n    \"lint-staged\": \"^10.5.4\",\n    \"mkdirp\": \"^1.0.4\",\n    \"prettier\": \"2.6.2\",\n    \"rimraf\": \"^3.0.2\",\n    \"simple-git-hooks\": \">=2.8.0\",\n    \"typescript\": \"4.7.2\"\n  },\n  \"scripts\": {\n    \"clean\": \"rimraf lib-es5\",\n    \"build\": \"npm run clean && tsc\",\n    \"start\": \"tsc --watch\",\n    \"lint\": \"npm run lint:style && npm run lint:code\",\n    \"lint:style\": \"prettier -c \\\"{lib,prelude,test}/**/*.{ts,js}\\\"\",\n    \"lint:code\": \"eslint lib prelude test\",\n    \"fix\": \"npm run lint:style -- -w && npm run lint:code -- --fix\",\n    \"prepare\": \"npm run build\",\n    \"prepublishOnly\": \"npm run lint\",\n    \"test\": \"npm run build && npm run test:18 && npm run test:16 && npm run test:14 && npm run test:host\",\n    \"test:18\": \"node test/test.js node18 no-npm\",\n    \"test:16\": \"node test/test.js node16 no-npm\",\n    \"test:14\": \"node test/test.js node14 no-npm\",\n    \"test:host\": \"node test/test.js host only-npm\"\n  },\n  \"simple-git-hooks\": {\n    \"pre-commit\": \"npx lint-staged\"\n  },\n  \"lint-staged\": {\n    \"*.{js,css,md,json}\": \"prettier --write\"\n  }\n}\n"
  },
  {
    "path": "prelude/.eslintrc.json",
    "content": "{\n  \"parserOptions\": {\n    \"sourceType\": \"script\"\n  },\n  \"rules\": {\n    \"no-var\": \"off\",\n    \"vars-on-top\": \"off\"\n  }\n}\n"
  },
  {
    "path": "prelude/bootstrap.js",
    "content": "/* eslint-disable import/no-unresolved */\n/* eslint-disable global-require */\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable prefer-rest-params */\n/* eslint-disable prefer-spread */\n\n/* global EXECPATH_FD */\n/* global PAYLOAD_POSITION */\n/* global PAYLOAD_SIZE */\n/* global REQUIRE_COMMON */\n/* global VIRTUAL_FILESYSTEM */\n/* global DEFAULT_ENTRYPOINT */\n/* global DICT */\n/* global DOCOMPRESS */\n/* global SYMLINKS */\n\n'use strict';\n\nconst childProcess = require('child_process');\nconst { createHash } = require('crypto');\nconst fs = require('fs');\nconst { isRegExp } = require('util').types;\nconst Module = require('module');\nconst path = require('path');\nconst { promisify, _extend } = require('util');\nconst { Script } = require('vm');\nconst { tmpdir } = require('os');\nconst util = require('util');\nconst {\n  brotliDecompress,\n  brotliDecompressSync,\n  gunzip,\n  gunzipSync,\n} = require('zlib');\n\nconst common = {};\nREQUIRE_COMMON(common);\n\nconst {\n  STORE_BLOB,\n  STORE_CONTENT,\n  STORE_LINKS,\n  STORE_STAT,\n  isRootPath,\n  normalizePath,\n  insideSnapshot,\n  stripSnapshot,\n  removeUplevels,\n} = common;\n\nlet FLAG_ENABLE_PROJECT = false;\nconst NODE_VERSION_MAJOR = process.version.match(/^v(\\d+)/)[1] | 0;\nconst NODE_VERSION_MINOR = process.version.match(/^v\\d+.(\\d+)/)[1] | 0;\n\n// /////////////////////////////////////////////////////////////////\n// ENTRYPOINT //////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\n// set ENTRYPOINT and ARGV0 here because\n// they can be altered during process run\nconst ARGV0 = process.argv[0];\nconst EXECPATH = process.execPath;\nlet ENTRYPOINT = process.argv[1];\n\nif (process.env.PKG_EXECPATH === 'PKG_INVOKE_NODEJS') {\n  return { undoPatch: true };\n}\n\nif (NODE_VERSION_MAJOR < 12 || require('worker_threads').isMainThread) {\n  if (process.argv[1] !== 'PKG_DUMMY_ENTRYPOINT') {\n    // expand once patchless is introduced, that\n    // will obviously lack any work in node_main.cc\n    throw new Error('PKG_DUMMY_ENTRYPOINT EXPECTED');\n  }\n}\n\nif (process.env.PKG_EXECPATH === EXECPATH) {\n  process.argv.splice(1, 1);\n\n  if (process.argv[1] && process.argv[1] !== '-') {\n    // https://github.com/nodejs/node/blob/1a96d83a223ff9f05f7d942fb84440d323f7b596/lib/internal/bootstrap/node.js#L269\n    process.argv[1] = path.resolve(process.argv[1]);\n  }\n} else {\n  process.argv[1] = DEFAULT_ENTRYPOINT;\n}\n\n[, ENTRYPOINT = DEFAULT_ENTRYPOINT] = process.argv;\ndelete process.env.PKG_EXECPATH;\n\n// /////////////////////////////////////////////////////////////////\n// EXECSTAT ////////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\nconst EXECSTAT = fs.statSync(EXECPATH);\n\nEXECSTAT.atimeMs = EXECSTAT.atime.getTime();\nEXECSTAT.mtimeMs = EXECSTAT.mtime.getTime();\nEXECSTAT.ctimeMs = EXECSTAT.ctime.getTime();\nEXECSTAT.birthtimeMs = EXECSTAT.birthtime.getTime();\n\n// /////////////////////////////////////////////////////////////////\n// MOUNTPOINTS /////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\nconst mountpoints = [];\n\nfunction insideMountpoint(f) {\n  if (!insideSnapshot(f)) return null;\n  const file = normalizePath(f);\n  const found = mountpoints\n    .map((mountpoint) => {\n      const { interior, exterior } = mountpoint;\n      if (isRegExp(interior) && interior.test(file))\n        return file.replace(interior, exterior);\n      if (interior === file) return exterior;\n      const left = interior + path.sep;\n      if (file.slice(0, left.length) !== left) return null;\n      return exterior + file.slice(left.length - 1);\n    })\n    .filter((result) => result);\n\n  if (found.length >= 2) throw new Error('UNEXPECTED-00');\n  if (found.length === 0) return null;\n  return found[0];\n}\n\nfunction readdirMountpoints(path_) {\n  return mountpoints\n    .filter(({ interior }) => {\n      if (isRegExp(interior)) return interior.test(path_);\n      return path.dirname(interior) === path_;\n    })\n    .map(({ interior, exterior }) => {\n      if (isRegExp(interior)) return path_.replace(interior, exterior);\n      return path.basename(interior);\n    });\n}\n\nfunction translate(f) {\n  const result = insideMountpoint(f);\n  if (!result) throw new Error('UNEXPECTED-05');\n  return result;\n}\n\nfunction cloneArgs(args_) {\n  return Array.prototype.slice.call(args_);\n}\n\nfunction translateNth(args_, index, f) {\n  const args = cloneArgs(args_);\n  args[index] = translate(f);\n  return args;\n}\n\nfunction createMountpoint(interior, exterior) {\n  // TODO validate\n  mountpoints.push({ interior, exterior });\n}\n\nconst DEFAULT_COPY_CHUNK_SIZE = 10 * 1024 * 1024; // 10 MB\nfunction copyInChunks(\n  source,\n  target,\n  chunkSize = DEFAULT_COPY_CHUNK_SIZE,\n  fs_ = fs\n) {\n  const sourceFile = fs_.openSync(source, 'r');\n  const targetFile = fs_.openSync(target, 'w');\n\n  let bytesRead = 1;\n  while (bytesRead > 0) {\n    const buffer = Buffer.alloc(chunkSize);\n    bytesRead = fs_.readSync(sourceFile, buffer, 0, chunkSize);\n    fs_.writeSync(targetFile, buffer, 0, bytesRead);\n  }\n\n  fs_.closeSync(sourceFile);\n  fs_.closeSync(targetFile);\n}\n\n// TODO: replace this with fs.cpSync when we drop Node < 16\nfunction copyFolderRecursiveSync(source, target) {\n  // Build target folder\n  const targetFolder = path.join(target, path.basename(source));\n\n  // Check if target folder needs to be created or integrated\n  if (!fs.existsSync(targetFolder)) {\n    fs.mkdirSync(targetFolder);\n  }\n\n  // Copy\n  if (fs.lstatSync(source).isDirectory()) {\n    const files = fs.readdirSync(source);\n\n    for (const file of files) {\n      // Build source name\n      const curSource = path.join(source, file);\n\n      // Call this function recursively as long as source is a directory\n      if (fs.lstatSync(curSource).isDirectory()) {\n        copyFolderRecursiveSync(curSource, targetFolder);\n      } else {\n        // Current source is a file, it must be available on the real filesystem\n        // instead of the virtual snapshot file system to load it by process.dlopen.\n        //\n        // Before we try to copy we do some checks.\n        // See https://github.com/vercel/pkg/issues/1589 for more details.\n\n        // Build target file name\n        const curTarget = path.join(targetFolder, path.basename(curSource));\n\n        if (fs.existsSync(curTarget)) {\n          // Target file already exists, read source and target file...\n          const curSourceContent = fs.readFileSync(curSource, {\n            encoding: 'binary',\n          });\n          const curTargetContent = fs.readFileSync(curTarget, {\n            encoding: 'binary',\n          });\n\n          // ...and calculate checksum from source and target file\n          const curSourceHash = createHash('sha256')\n            .update(curSourceContent)\n            .digest('hex');\n          const curTargetHash = createHash('sha256')\n            .update(curTargetContent)\n            .digest('hex');\n\n          // If checksums are equal then there is nothing to do here\n          // ==> target already exists and is up-to-date\n          if (curSourceHash === curTargetHash) {\n            continue;\n          }\n        }\n\n        // Target must be copied because it either does not exist or is outdated.\n        // Due to the possibility that mutliple instances of this app start simultaneously,\n        // the copy action might fail. Only one starting instance gets write access.\n        //\n        // We don't catch any error here because it does not make sense to go ahead and to\n        // try to load the file while another instance has not yet finished the copy action.\n        // If the app start fails then the user should try to start the app later again.\n        // Unfortunately, we cannot implement delayed retries ourselves because process.dlopen\n        // is a synchronous function, promises are not supported.\n        fs.copyFileSync(curSource, curTarget);\n      }\n    }\n  }\n}\n\nfunction createDirRecursively(dir) {\n  if (!fs.existsSync(dir)) {\n    createDirRecursively(path.join(dir, '..'));\n    fs.mkdirSync(dir);\n  }\n}\n\n/*\n\n// TODO move to some test\n\ncreateMountpoint(\"d:\\\\snapshot\\\\countly\\\\plugins-ext\", \"d:\\\\deploy\\\\countly\\\\v16.02\\\\plugins-ext\");\n\nconsole.log(insideMountpoint(\"d:\\\\snapshot\"));\nconsole.log(insideMountpoint(\"d:\\\\snapshot\\\\\"));\nconsole.log(insideMountpoint(\"d:\\\\snapshot\\\\countly\"));\nconsole.log(insideMountpoint(\"d:\\\\snapshot\\\\countly\\\\\"));\nconsole.log(insideMountpoint(\"d:\\\\snapshot\\\\countly\\\\plugins-ext\"));\nconsole.log(insideMountpoint(\"d:\\\\snapshot\\\\countly\\\\plugins-ext\\\\\"));\nconsole.log(insideMountpoint(\"d:\\\\snapshot\\\\countly\\\\plugins-ext\\\\1234\"));\n\nconsole.log(translate(\"d:\\\\snapshot\\\\countly\\\\plugins-ext\"));\nconsole.log(translate(\"d:\\\\snapshot\\\\countly\\\\plugins-ext\\\\\"));\nconsole.log(translate(\"d:\\\\snapshot\\\\countly\\\\plugins-ext\\\\1234\"));\n\nconsole.log(translateNth([], 0, \"d:\\\\snapshot\\\\countly\\\\plugins-ext\"));\nconsole.log(translateNth([], 0, \"d:\\\\snapshot\\\\countly\\\\plugins-ext\\\\\"));\nconsole.log(translateNth([], 0, \"d:\\\\snapshot\\\\countly\\\\plugins-ext\\\\1234\"));\n\nconsole.log(translateNth([\"\", \"r+\"], 0, \"d:\\\\snapshot\\\\countly\\\\plugins-ext\"));\nconsole.log(translateNth([\"\", \"rw\"], 0, \"d:\\\\snapshot\\\\countly\\\\plugins-ext\\\\\"));\nconsole.log(translateNth([\"\", \"a+\"], 0, \"d:\\\\snapshot\\\\countly\\\\plugins-ext\\\\1234\"));\n*/\nconst dictRev = {};\nconst separator = '/';\nlet maxKey = Object.values(DICT).length;\n\nfunction replace(k) {\n  let v = DICT[k];\n  // we have found a part of a missing file => let record for latter use\n  if (v === undefined) {\n    maxKey += 1;\n    v = maxKey.toString(36);\n    DICT[k] = v;\n    dictRev[v] = k;\n  }\n  return v;\n}\n\nfunction findVirtualFileSystemKey(path_, slash) {\n  const normalizedPath = normalizePath(path_);\n  if (!DOCOMPRESS) {\n    return normalizedPath;\n  }\n  const a = normalizedPath.split(slash).map(replace).join(separator);\n  return a || normalizedPath;\n}\n\nObject.entries(DICT).forEach(([k, v]) => {\n  dictRev[v] = k;\n});\n\nfunction toOriginal(fShort) {\n  if (!DOCOMPRESS) {\n    return fShort;\n  }\n  return fShort\n    .split(separator)\n    .map((x) => dictRev[x])\n    .join(path.sep);\n}\n\nconst symlinksEntries = Object.entries(SYMLINKS);\n\n// separator for substitution depends on platform;\nconst sepsep = DOCOMPRESS ? separator : path.sep;\n\nfunction findVirtualFileSystemKeyAndFollowLinks(path_) {\n  let vfsKey = findVirtualFileSystemKey(path_, path.sep);\n  let needToSubstitute = true;\n  while (needToSubstitute) {\n    needToSubstitute = false;\n    for (const [k, v] of symlinksEntries) {\n      if (vfsKey.startsWith(`${k}${sepsep}`) || vfsKey === k) {\n        vfsKey = vfsKey.replace(k, v);\n        needToSubstitute = true;\n        break;\n      }\n    }\n  }\n  return vfsKey;\n}\n\nfunction realpathFromSnapshot(path_) {\n  const realPath = toOriginal(findVirtualFileSystemKeyAndFollowLinks(path_));\n  return realPath;\n}\n\nfunction findVirtualFileSystemEntry(path_) {\n  const vfsKey = findVirtualFileSystemKeyAndFollowLinks(path_);\n  return VIRTUAL_FILESYSTEM[vfsKey];\n}\n\n// /////////////////////////////////////////////////////////////////\n// PROJECT /////////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\nconst xpdn = path.dirname(EXECPATH);\nconst maxUplevels = xpdn.split(path.sep).length;\nfunction projectToFilesystem(f) {\n  const relatives = [];\n  relatives.push(\n    removeUplevels(path.relative(path.dirname(DEFAULT_ENTRYPOINT), f))\n  );\n\n  if (relatives[0].slice(0, 'node_modules'.length) === 'node_modules') {\n    // one more relative without starting 'node_modules'\n    relatives.push(relatives[0].slice('node_modules'.length + 1));\n  }\n\n  const uplevels = [];\n  for (let i = 0, u = ''; i < maxUplevels; i += 1) {\n    uplevels.push(u);\n    u += '/..';\n  }\n\n  const results = [];\n  uplevels.forEach((uplevel) => {\n    relatives.forEach((relative) => {\n      results.push(path.join(xpdn, uplevel, relative));\n    });\n  });\n  return results;\n}\n\nfunction projectToNearby(f) {\n  return path.join(xpdn, path.basename(f));\n}\nfunction findNativeAddonSyncFreeFromRequire(path_) {\n  if (!insideSnapshot(path_)) throw new Error(`UNEXPECTED-10 ${path_}`);\n  if (path_.slice(-5) !== '.node') return null; // leveldown.node.js\n  // check nearby first to prevent .node tampering\n  const projector = projectToNearby(path_);\n  if (fs.existsSync(projector)) return projector;\n  const projectors = projectToFilesystem(path_);\n  for (let i = 0; i < projectors.length; i += 1) {\n    if (fs.existsSync(projectors[i])) return projectors[i];\n  }\n  return null;\n}\n\nfunction findNativeAddonSyncUnderRequire(path_) {\n  if (!FLAG_ENABLE_PROJECT) return null;\n  return findNativeAddonSyncFreeFromRequire(path_);\n}\n\n// /////////////////////////////////////////////////////////////////\n// FLOW UTILS //////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\nfunction asap(cb) {\n  process.nextTick(cb);\n}\n\nfunction dezalgo(cb) {\n  if (!cb) return cb;\n\n  let sync = true;\n  asap(() => {\n    sync = false;\n  });\n\n  return function zalgoSafe() {\n    const args = arguments;\n    if (sync) {\n      asap(() => {\n        cb.apply(undefined, args);\n      });\n    } else {\n      cb.apply(undefined, args);\n    }\n  };\n}\n\nfunction rethrow(error, arg) {\n  if (error) throw error;\n  return arg;\n}\n\n// /////////////////////////////////////////////////////////////////\n// PAYLOAD /////////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\nif (typeof PAYLOAD_POSITION !== 'number' || typeof PAYLOAD_SIZE !== 'number') {\n  throw new Error('MUST HAVE PAYLOAD');\n}\n\nfunction readPayload(buffer, offset, length, position, callback) {\n  fs.read(\n    EXECPATH_FD,\n    buffer,\n    offset,\n    length,\n    PAYLOAD_POSITION + position,\n    callback\n  );\n}\n\nfunction readPayloadSync(buffer, offset, length, position) {\n  return fs.readSync(\n    EXECPATH_FD,\n    buffer,\n    offset,\n    length,\n    PAYLOAD_POSITION + position\n  );\n}\n\nfunction payloadCopyUni(\n  source,\n  target,\n  targetStart,\n  sourceStart,\n  sourceEnd,\n  cb\n) {\n  const cb2 = cb || rethrow;\n  if (sourceStart >= source[1]) return cb2(null, 0);\n  if (sourceEnd >= source[1]) [, sourceEnd] = source;\n  const payloadPos = source[0] + sourceStart;\n  const targetPos = targetStart;\n  const targetEnd = targetStart + sourceEnd - sourceStart;\n  if (cb) {\n    readPayload(target, targetPos, targetEnd - targetPos, payloadPos, cb);\n  } else {\n    return readPayloadSync(\n      target,\n      targetPos,\n      targetEnd - targetPos,\n      payloadPos\n    );\n  }\n}\n\nfunction payloadCopyMany(source, target, targetStart, sourceStart, cb) {\n  const payloadPos = source[0] + sourceStart;\n  let targetPos = targetStart;\n  const targetEnd = targetStart + source[1] - sourceStart;\n  readPayload(\n    target,\n    targetPos,\n    targetEnd - targetPos,\n    payloadPos,\n    (error, chunkSize) => {\n      if (error) return cb(error);\n      sourceStart += chunkSize;\n      targetPos += chunkSize;\n      if (chunkSize !== 0 && targetPos < targetEnd) {\n        payloadCopyMany(source, target, targetPos, sourceStart, cb);\n      } else {\n        return cb();\n      }\n    }\n  );\n}\n\nfunction payloadCopyManySync(source, target, targetStart, sourceStart) {\n  let payloadPos = source[0] + sourceStart;\n  let targetPos = targetStart;\n  const targetEnd = targetStart + source[1] - sourceStart;\n  while (true) {\n    const chunkSize = readPayloadSync(\n      target,\n      targetPos,\n      targetEnd - targetPos,\n      payloadPos\n    );\n    payloadPos += chunkSize;\n    targetPos += chunkSize;\n    if (!(chunkSize !== 0 && targetPos < targetEnd)) break;\n  }\n}\n\nconst GZIP = 1;\nconst BROTLI = 2;\nfunction payloadFile(pointer, cb) {\n  const target = Buffer.alloc(pointer[1]);\n  payloadCopyMany(pointer, target, 0, 0, (error) => {\n    if (error) return cb(error);\n    if (DOCOMPRESS === GZIP) {\n      gunzip(target, (error2, target2) => {\n        if (error2) return cb(error2);\n        cb(null, target2);\n      });\n    } else if (DOCOMPRESS === BROTLI) {\n      brotliDecompress(target, (error2, target2) => {\n        if (error2) return cb(error2);\n        cb(null, target2);\n      });\n    } else {\n      return cb(null, target);\n    }\n  });\n}\n\nfunction payloadFileSync(pointer) {\n  const target = Buffer.alloc(pointer[1]);\n  payloadCopyManySync(pointer, target, 0, 0);\n  if (DOCOMPRESS === GZIP) {\n    const target1 = gunzipSync(target);\n    return target1;\n  }\n  if (DOCOMPRESS === BROTLI) {\n    const target1 = brotliDecompressSync(target);\n    return target1;\n  }\n  return target;\n}\n\n// /////////////////////////////////////////////////////////////////\n// SETUP PROCESS ///////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\n(() => {\n  process.pkg = {};\n  process.versions.pkg = '%VERSION%';\n  process.pkg.mount = createMountpoint;\n  process.pkg.entrypoint = ENTRYPOINT;\n  process.pkg.defaultEntrypoint = DEFAULT_ENTRYPOINT;\n})();\n\n// /////////////////////////////////////////////////////////////////\n// PATH.RESOLVE REPLACEMENT ////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\n(() => {\n  process.pkg.path = {};\n  process.pkg.path.resolve = function resolve() {\n    const args = cloneArgs(arguments);\n    args.unshift(path.dirname(ENTRYPOINT));\n    return path.resolve.apply(path, args);\n  };\n})();\n\n// /////////////////////////////////////////////////////////////////\n// PATCH FS ////////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\n(() => {\n  const ancestor = {\n    openSync: fs.openSync,\n    open: fs.open,\n    readSync: fs.readSync,\n    read: fs.read,\n    writeSync: fs.writeSync,\n    write: fs.write,\n    closeSync: fs.closeSync,\n    close: fs.close,\n    readFileSync: fs.readFileSync,\n    readFile: fs.readFile,\n    // writeFileSync: fs.writeFileSync, // based on openSync/writeSync/closeSync\n    // writeFile:     fs.writeFile, // based on open/write/close\n    readdirSync: fs.readdirSync,\n    readdir: fs.readdir,\n    realpathSync: fs.realpathSync,\n    realpath: fs.realpath,\n    statSync: fs.statSync,\n    stat: fs.stat,\n    lstatSync: fs.lstatSync,\n    lstat: fs.lstat,\n    fstatSync: fs.fstatSync,\n    fstat: fs.fstat,\n    existsSync: fs.existsSync,\n    exists: fs.exists,\n    accessSync: fs.accessSync,\n    access: fs.access,\n    mkdirSync: fs.mkdirSync,\n    mkdir: fs.mkdir,\n    createReadStream: fs.createReadStream,\n    copyFileSync: fs.copyFileSync,\n    copyFile: fs.copyFile,\n  };\n\n  ancestor.realpathSync.native = fs.realpathSync;\n  ancestor.realpath.native = fs.realpath;\n\n  const windows = process.platform === 'win32';\n\n  const docks = {};\n  const ENOTDIR = windows ? 4052 : 20;\n  const ENOENT = windows ? 4058 : 2;\n  const EISDIR = windows ? 4068 : 21;\n\n  function assertEncoding(encoding) {\n    if (encoding && !Buffer.isEncoding(encoding)) {\n      throw new Error(`Unknown encoding: ${encoding}`);\n    }\n  }\n\n  function maybeCallback(args) {\n    const cb = args[args.length - 1];\n    return typeof cb === 'function' ? cb : rethrow;\n  }\n\n  function error_ENOENT(fileOrDirectory, path_) {\n    const error = new Error(\n      `${fileOrDirectory} '${stripSnapshot(path_)}' ` +\n        `was not included into executable at compilation stage. ` +\n        `Please recompile adding it as asset or script.`\n    );\n    error.errno = -ENOENT;\n    error.code = 'ENOENT';\n    error.path = path_;\n    error.pkg = true;\n    return error;\n  }\n\n  function error_EISDIR(path_) {\n    const error = new Error('EISDIR: illegal operation on a directory, read');\n    error.errno = -EISDIR;\n    error.code = 'EISDIR';\n    error.path = path_;\n    error.pkg = true;\n    return error;\n  }\n\n  function error_ENOTDIR(path_) {\n    const error = new Error(`ENOTDIR: not a directory, scandir '${path_}'`);\n    error.errno = -ENOTDIR;\n    error.code = 'ENOTDIR';\n    error.path = path_;\n    error.pkg = true;\n    return error;\n  }\n\n  // ///////////////////////////////////////////////////////////////\n  // open //////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function removeTemporaryFolderAndContent(folder) {\n    if (!folder) return;\n    if (NODE_VERSION_MAJOR <= 14) {\n      if (NODE_VERSION_MAJOR <= 10) {\n        // folder must be empty\n        for (const f of fs.readdirSync(folder)) {\n          fs.unlinkSync(path.join(folder, f));\n        }\n        fs.rmdirSync(folder);\n      } else {\n        fs.rmdirSync(folder, { recursive: true });\n      }\n    } else {\n      fs.rmSync(folder, { recursive: true });\n    }\n  }\n  const temporaryFiles = {};\n  const os = require('os');\n  let tmpFolder = '';\n  process.on('beforeExit', () => {\n    removeTemporaryFolderAndContent(tmpFolder);\n  });\n  function deflateSync(snapshotFilename) {\n    if (!tmpFolder) {\n      tmpFolder = fs.mkdtempSync(path.join(os.tmpdir(), 'pkg-'));\n    }\n    const content = fs.readFileSync(snapshotFilename, { encoding: 'binary' });\n    // content is already unzipped !\n\n    const hash = createHash('sha256').update(content).digest('hex');\n    const fName = path.join(tmpFolder, hash);\n    fs.writeFileSync(fName, content, 'binary');\n    return fName;\n  }\n\n  const uncompressExternally = function uncompressExternally(dock) {\n    if (!dock.externalFilename) {\n      const snapshotFilename = dock.path;\n      let t = temporaryFiles[snapshotFilename];\n      if (!t) {\n        const tmpFile = deflateSync(snapshotFilename);\n        t = { tmpFile };\n        temporaryFiles[snapshotFilename] = t;\n      }\n      dock.externalFilename = t.tmpFile;\n    }\n    return dock.externalFilename;\n  };\n\n  function uncompressExternallyPath(path_) {\n    const entity = findVirtualFileSystemEntry(path_);\n    const dock = { path: path_, entity, position: 0 };\n    return uncompressExternally(dock);\n  }\n\n  function uncompressExternallyAndOpen(dock) {\n    const externalFile = uncompressExternally(dock);\n    const fd = fs.openSync(externalFile, 'r');\n    return fd;\n  }\n\n  function openFromSnapshot(path_, uncompress, cb) {\n    const cb2 = cb || rethrow;\n    const entity = findVirtualFileSystemEntry(path_);\n    if (!entity) return cb2(error_ENOENT('File or directory', path_));\n    const dock = { path: path_, entity, position: 0 };\n\n    const nullDevice = windows ? '\\\\\\\\.\\\\NUL' : '/dev/null';\n    if (cb) {\n      ancestor.open.call(fs, nullDevice, 'r', (error, fd) => {\n        if (error) return cb(error);\n        if (DOCOMPRESS) {\n          dock._externalFile = uncompressExternallyAndOpen(dock);\n        }\n        docks[fd] = dock;\n        cb(null, fd);\n      });\n    } else {\n      const fd = ancestor.openSync.call(fs, nullDevice, 'r');\n      if (DOCOMPRESS) {\n        dock._externalFile = uncompressExternallyAndOpen(dock);\n      }\n      docks[fd] = dock;\n      return fd;\n    }\n  }\n\n  fs.createReadStream = function createReadStream(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.createReadStream.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.createReadStream.apply(\n        fs,\n        translateNth(arguments, 0, path_)\n      );\n    }\n    const stream = ancestor.createReadStream.apply(fs, arguments);\n    return stream;\n  };\n  fs.openSync = function openSync(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.openSync.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.openSync.apply(fs, translateNth(arguments, 0, path_));\n    }\n    return openFromSnapshot(path_, DOCOMPRESS);\n  };\n\n  fs.open = function open(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.open.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.open.apply(fs, translateNth(arguments, 0, path_));\n    }\n    const callback = dezalgo(maybeCallback(arguments));\n    openFromSnapshot(path_, DOCOMPRESS, callback);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // read //////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function readFromSnapshotSub(\n    entityContent,\n    dock,\n    buffer,\n    offset,\n    length,\n    position,\n    cb\n  ) {\n    if (DOCOMPRESS) {\n      // note: source contains info about a compressed file and source[1] does not reflect\n      //       the actual size of the file.\n      //       so random access reading of a compressed virtual file, requires read from\n      //       an externally decompressed file\n      if (!dock._externalFile) {\n        dock._externalFile = uncompressExternallyAndOpen(dock);\n      } else {\n        position = position === undefined ? 0 : position;\n      }\n      return fs.read(dock._externalFile, buffer, offset, length, position, cb);\n    }\n    let p;\n    if (position !== null && position !== undefined) {\n      p = position;\n    } else {\n      p = dock.position;\n    }\n    if (cb) {\n      payloadCopyUni(\n        entityContent,\n        buffer,\n        offset,\n        p,\n        p + length,\n        (error, bytesRead, buffer2) => {\n          if (error) return cb(error);\n          dock.position = p + bytesRead;\n          cb(null, bytesRead, buffer2);\n        }\n      );\n    } else {\n      const bytesRead = payloadCopyUni(\n        entityContent,\n        buffer,\n        offset,\n        p,\n        p + length\n      );\n      dock.position = p + bytesRead;\n      return bytesRead;\n    }\n  }\n\n  function readFromSnapshot(fd, buffer, offset, length, position, cb) {\n    const dock = docks[fd];\n\n    if (dock && dock._externalFile) {\n      if (cb) {\n        return ancestor.read(\n          dock._externalFile,\n          buffer,\n          offset,\n          length,\n          position,\n          cb\n        );\n      }\n      return ancestor.readSync(\n        dock._externalFile,\n        buffer,\n        offset,\n        length,\n        position\n      );\n    }\n    const cb2 = cb || rethrow;\n    if (offset < 0 && NODE_VERSION_MAJOR >= 14)\n      return cb2(\n        new Error(\n          `The value of \"offset\" is out of range. It must be >= 0. Received ${offset}`\n        )\n      );\n    if (offset < 0 && NODE_VERSION_MAJOR >= 10)\n      return cb2(\n        new Error(\n          `The value of \"offset\" is out of range. It must be >= 0 && <= ${buffer.length.toString()}. Received ${offset}`\n        )\n      );\n    if (offset < 0) return cb2(new Error('Offset is out of bounds'));\n    if (offset >= buffer.length) return cb2(null, 0);\n    if (offset + length > buffer.length && NODE_VERSION_MAJOR >= 14)\n      return cb2(\n        new Error(\n          `The value of \"length\" is out of range. It must be <= ${(\n            buffer.length - offset\n          ).toString()}. Received ${length.toString()}`\n        )\n      );\n    if (offset + length > buffer.length && NODE_VERSION_MAJOR >= 10)\n      return cb2(\n        new Error(\n          `The value of \"length\" is out of range. It must be >= 0 && <= ${(\n            buffer.length - offset\n          ).toString()}. Received ${length.toString()}`\n        )\n      );\n    if (offset + length > buffer.length)\n      return cb2(new Error('Length extends beyond buffer'));\n\n    const { entity } = dock;\n    const entityLinks = entity[STORE_LINKS];\n    if (entityLinks) return cb2(error_EISDIR(dock.path));\n    const entityContent = entity[STORE_CONTENT];\n    if (entityContent)\n      return readFromSnapshotSub(\n        entityContent,\n        dock,\n        buffer,\n        offset,\n        length,\n        position,\n        cb\n      );\n    return cb2(new Error('UNEXPECTED-15'));\n  }\n\n  fs.readSync = function readSync(fd, buffer, offset, length, position) {\n    if (!docks[fd]) {\n      return ancestor.readSync.apply(fs, arguments);\n    }\n    return readFromSnapshot(fd, buffer, offset, length, position);\n  };\n\n  fs.read = function read(fd, buffer, offset, length, position) {\n    if (!docks[fd]) {\n      return ancestor.read.apply(fs, arguments);\n    }\n\n    const callback = dezalgo(maybeCallback(arguments));\n    readFromSnapshot(fd, buffer, offset, length, position, callback);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // write /////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function writeToSnapshot(cb) {\n    const cb2 = cb || rethrow;\n    return cb2(new Error('Cannot write to packaged file'));\n  }\n\n  fs.writeSync = function writeSync(fd) {\n    if (!docks[fd]) {\n      return ancestor.writeSync.apply(fs, arguments);\n    }\n\n    return writeToSnapshot();\n  };\n\n  fs.write = function write(fd) {\n    if (!docks[fd]) {\n      return ancestor.write.apply(fs, arguments);\n    }\n    const callback = dezalgo(maybeCallback(arguments));\n    return writeToSnapshot(callback);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // close /////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  const closeFromSnapshot = (fd, cb) => {\n    const dock = docks[fd];\n    if (dock._externalFile) {\n      ancestor.closeSync(dock._externalFile);\n      dock._externalFile = undefined;\n    }\n    delete docks[fd];\n    if (cb) {\n      ancestor.close.call(fs, fd, cb);\n    } else {\n      return ancestor.closeSync.call(fs, fd);\n    }\n  };\n\n  fs.closeSync = function closeSync(fd) {\n    if (!docks[fd]) {\n      return ancestor.closeSync.apply(fs, arguments);\n    }\n    return closeFromSnapshot(fd);\n  };\n\n  fs.close = function close(fd) {\n    if (!docks[fd]) {\n      return ancestor.close.apply(fs, arguments);\n    }\n\n    const callback = dezalgo(maybeCallback(arguments));\n    closeFromSnapshot(fd, callback);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // readFile //////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function readFileOptions(options, hasCallback) {\n    if (!options || (hasCallback && typeof options === 'function')) {\n      return { encoding: null, flag: 'r' };\n    }\n    if (typeof options === 'string') {\n      return { encoding: options, flag: 'r' };\n    }\n    if (typeof options === 'object') {\n      return options;\n    }\n    return null;\n  }\n\n  function readFileFromSnapshotSub(entityContent, cb) {\n    if (cb) {\n      payloadFile(entityContent, cb);\n    } else {\n      return payloadFileSync(entityContent);\n    }\n  }\n\n  function readFileFromSnapshot(path_, cb) {\n    const cb2 = cb || rethrow;\n\n    const entity = findVirtualFileSystemEntry(path_);\n    if (!entity) return cb2(error_ENOENT('File', path_));\n\n    const entityLinks = entity[STORE_LINKS];\n    if (entityLinks) return cb2(error_EISDIR(path_));\n\n    const entityContent = entity[STORE_CONTENT];\n    if (entityContent) return readFileFromSnapshotSub(entityContent, cb);\n\n    const entityBlob = entity[STORE_BLOB];\n    if (entityBlob) {\n      return cb2(null, Buffer.from('source-code-not-available'));\n    }\n    // why return empty buffer?\n    // otherwise this error will arise:\n    // Error: UNEXPECTED-20\n    //     at readFileFromSnapshot (e:0)\n    //     at Object.fs.readFileSync (e:0)\n    //     at Object.Module._extensions..js (module.js:421:20)\n    //     at Module.load (module.js:357:32)\n    //     at Function.Module._load (module.js:314:12)\n    //     at Function.Module.runMain (e:0)\n    //     at startup (node.js:140:18)\n    //     at node.js:1001:3\n\n    return cb2(new Error('UNEXPECTED-20'));\n  }\n\n  fs.readFileSync = function readFileSync(path_, options_) {\n    if (path_ === 'dirty-hack-for-testing-purposes') {\n      return path_;\n    }\n\n    if (!insideSnapshot(path_)) {\n      return ancestor.readFileSync.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.readFileSync.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    const options = readFileOptions(options_, false);\n\n    if (!options) {\n      return ancestor.readFileSync.apply(fs, arguments);\n    }\n\n    const { encoding } = options;\n    assertEncoding(encoding);\n\n    let buffer = readFileFromSnapshot(path_);\n    if (encoding) buffer = buffer.toString(encoding);\n    return buffer;\n  };\n\n  fs.readFile = function readFile(path_, options_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.readFile.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.readFile.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    const options = readFileOptions(options_, true);\n\n    if (!options) {\n      return ancestor.readFile.apply(fs, arguments);\n    }\n\n    const { encoding } = options;\n    assertEncoding(encoding);\n\n    const callback = dezalgo(maybeCallback(arguments));\n    readFileFromSnapshot(path_, (error, buffer) => {\n      if (error) return callback(error);\n      if (encoding) buffer = buffer.toString(encoding);\n      callback(null, buffer);\n    });\n  };\n\n  fs.copyFile = function copyFile(src, dest, flags, callback) {\n    if (!insideSnapshot(path.resolve(src))) {\n      ancestor.copyFile(src, dest, flags, callback);\n      return;\n    }\n    if (typeof flags === 'function') {\n      callback = flags;\n      flags = 0;\n    } else if (typeof callback !== 'function') {\n      throw new TypeError('Callback must be a function');\n    }\n\n    function _streamCopy() {\n      fs.createReadStream(src)\n        .on('error', callback)\n        .pipe(fs.createWriteStream(dest))\n        .on('error', callback)\n        .on('finish', callback);\n    }\n\n    if (flags & fs.constants.COPYFILE_EXCL) {\n      fs.stat(dest, (statError) => {\n        if (!statError) {\n          callback(\n            Object.assign(new Error('File already exists'), {\n              code: 'EEXIST',\n            })\n          );\n          return;\n        }\n        if (statError.code !== 'ENOENT') {\n          callback(statError);\n          return;\n        }\n        _streamCopy();\n      });\n    } else {\n      _streamCopy();\n    }\n  };\n\n  fs.copyFileSync = function copyFileSync(src, dest, flags) {\n    if (!insideSnapshot(path.resolve(src))) {\n      ancestor.copyFileSync(src, dest, flags);\n      return;\n    }\n\n    if (flags & fs.constants.COPYFILE_EXCL) {\n      try {\n        fs.statSync(dest);\n      } catch (statError) {\n        if (statError.code !== 'ENOENT') throw statError;\n        copyInChunks(src, dest, DEFAULT_COPY_CHUNK_SIZE, fs);\n        return;\n      }\n\n      throw Object.assign(new Error('File already exists'), { code: 'EEXIST' });\n    }\n    copyInChunks(src, dest, DEFAULT_COPY_CHUNK_SIZE, fs);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // writeFile /////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  // writeFileSync based on openSync/writeSync/closeSync\n  // writeFile based on open/write/close\n\n  // ///////////////////////////////////////////////////////////////\n  // readdir ///////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function readdirOptions(options, hasCallback) {\n    if (!options || (hasCallback && typeof options === 'function')) {\n      return { encoding: null };\n    }\n    if (typeof options === 'string') {\n      return { encoding: options };\n    }\n    if (typeof options === 'object') {\n      return options;\n    }\n    return null;\n  }\n\n  function Dirent(name, type) {\n    this.name = name;\n    this.type = type;\n  }\n\n  Dirent.prototype.isDirectory = function isDirectory() {\n    return this.type === 2;\n  };\n\n  Dirent.prototype.isFile = function isFile() {\n    return this.type === 1;\n  };\n\n  const noop = () => false;\n  Dirent.prototype.isBlockDevice = noop;\n  Dirent.prototype.isCharacterDevice = noop;\n  Dirent.prototype.isSocket = noop;\n  Dirent.prototype.isFIFO = noop;\n\n  Dirent.prototype.isSymbolicLink = (fileOrFolderName) =>\n    Boolean(SYMLINKS[fileOrFolderName]);\n\n  function getFileTypes(path_, entries) {\n    return entries.map((entry) => {\n      const ff = path.join(path_, entry);\n      const entity = findVirtualFileSystemEntry(ff);\n      if (!entity) return undefined;\n      if (entity[STORE_BLOB] || entity[STORE_CONTENT])\n        return new Dirent(entry, 1);\n      if (entity[STORE_LINKS]) return new Dirent(entry, 2);\n      throw new Error('UNEXPECTED-24');\n    });\n  }\n\n  function readdirRoot(path_, options, cb) {\n    function addSnapshot(entries) {\n      if (options && options.withFileTypes) {\n        entries.push(new Dirent('snapshot', 2));\n      } else {\n        entries.push('snapshot');\n      }\n    }\n\n    if (cb) {\n      ancestor.readdir(path_, options, (error, entries) => {\n        if (error) return cb(error);\n        addSnapshot(entries);\n        cb(null, entries);\n      });\n    } else {\n      const entries = ancestor.readdirSync(path_, options);\n      addSnapshot(entries);\n      return entries;\n    }\n  }\n\n  function readdirFromSnapshotSub(entityLinks, path_, cb) {\n    if (cb) {\n      payloadFile(entityLinks, (error, buffer) => {\n        if (error) return cb(error);\n        cb(null, JSON.parse(buffer).concat(readdirMountpoints(path_)));\n      });\n    } else {\n      const buffer = payloadFileSync(entityLinks);\n      return JSON.parse(buffer).concat(readdirMountpoints(path_));\n    }\n  }\n\n  function readdirFromSnapshot(path_, cb) {\n    const cb2 = cb || rethrow;\n    const entity = findVirtualFileSystemEntry(path_);\n\n    if (!entity) {\n      return cb2(error_ENOENT('Directory', path_));\n    }\n\n    const entityBlob = entity[STORE_BLOB];\n    if (entityBlob) {\n      return cb2(error_ENOTDIR(path_));\n    }\n\n    const entityContent = entity[STORE_CONTENT];\n    if (entityContent) {\n      return cb2(error_ENOTDIR(path_));\n    }\n\n    const entityLinks = entity[STORE_LINKS];\n    if (entityLinks) {\n      return readdirFromSnapshotSub(entityLinks, path_, cb);\n    }\n    return cb2(new Error('UNEXPECTED-25'));\n  }\n\n  fs.readdirSync = function readdirSync(path_, options_) {\n    const isRoot = isRootPath(path_);\n\n    if (!insideSnapshot(path_) && !isRoot) {\n      return ancestor.readdirSync.apply(fs, arguments);\n    }\n\n    if (insideMountpoint(path_)) {\n      return ancestor.readdirSync.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    const options = readdirOptions(options_, false);\n\n    if (isRoot) {\n      return readdirRoot(path_, options);\n    }\n\n    if (!options) {\n      return ancestor.readdirSync.apply(fs, arguments);\n    }\n\n    let entries = readdirFromSnapshot(path_);\n    if (options.withFileTypes) entries = getFileTypes(path_, entries);\n    return entries;\n  };\n\n  fs.readdir = function readdir(path_, options_) {\n    const isRoot = isRootPath(path_);\n\n    if (!insideSnapshot(path_) && !isRoot) {\n      return ancestor.readdir.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.readdir.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    const options = readdirOptions(options_, true);\n    const callback = dezalgo(maybeCallback(arguments));\n\n    if (isRoot) {\n      return readdirRoot(path_, options, callback);\n    }\n\n    if (!options) {\n      return ancestor.readdir.apply(fs, arguments);\n    }\n\n    readdirFromSnapshot(path_, (error, entries) => {\n      if (error) return callback(error);\n      if (options.withFileTypes) entries = getFileTypes(path_, entries);\n      callback(null, entries);\n    });\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // realpath //////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  fs.realpathSync = function realpathSync(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.realpathSync.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      // app should not know real file name\n      return path_;\n    }\n\n    const realPath = realpathFromSnapshot(path_);\n    return realPath;\n  };\n\n  fs.realpath = function realpath(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.realpath.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      // app should not know real file name\n      return path_;\n    }\n\n    const callback = dezalgo(maybeCallback(arguments));\n    callback(null, realpathFromSnapshot(path_));\n  };\n\n  fs.realpathSync.native = fs.realpathSync;\n  fs.realpath.native = fs.realpath;\n\n  // ///////////////////////////////////////////////////////////////\n  // stat //////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function restore(s) {\n    s.blksize = 4096;\n    s.blocks = 0;\n    s.dev = 0;\n    s.gid = 20;\n    s.ino = 0;\n    s.nlink = 0;\n    s.rdev = 0;\n    s.uid = 500;\n\n    s.atime = new Date(EXECSTAT.atime);\n    s.mtime = new Date(EXECSTAT.mtime);\n    s.ctime = new Date(EXECSTAT.ctime);\n    s.birthtime = new Date(EXECSTAT.birthtime);\n\n    s.atimeMs = EXECSTAT.atimeMs;\n    s.mtimeMs = EXECSTAT.mtimeMs;\n    s.ctimeMs = EXECSTAT.ctimeMs;\n    s.birthtimeMs = EXECSTAT.birthtimeMs;\n\n    const { isFileValue } = s;\n    const { isDirectoryValue } = s;\n    const { isSocketValue } = s;\n    const { isSymbolicLinkValue } = s;\n\n    delete s.isFileValue;\n    delete s.isDirectoryValue;\n    delete s.isSocketValue;\n    delete s.isSymbolicLinkValue;\n\n    s.isBlockDevice = noop;\n    s.isCharacterDevice = noop;\n    s.isFile = function isFile() {\n      return isFileValue;\n    };\n    s.isDirectory = function isDirectory() {\n      return isDirectoryValue;\n    };\n    s.isSocket = function isSocket() {\n      return isSocketValue;\n    };\n    s.isSymbolicLink = function isSymbolicLink() {\n      return isSymbolicLinkValue;\n    };\n    s.isFIFO = noop;\n\n    return s;\n  }\n\n  function findNativeAddonForStat(path_, cb) {\n    const cb2 = cb || rethrow;\n    const foundPath = findNativeAddonSyncUnderRequire(path_);\n    if (!foundPath) return cb2(error_ENOENT('File or directory', path_));\n    if (cb) {\n      ancestor.stat.call(fs, foundPath, cb);\n    } else {\n      return ancestor.statSync.call(fs, foundPath);\n    }\n  }\n\n  function statFromSnapshotSub(entityStat, cb) {\n    if (cb) {\n      payloadFile(entityStat, (error, buffer) => {\n        if (error) return cb(error);\n        cb(null, restore(JSON.parse(buffer)));\n      });\n    } else {\n      const buffer = payloadFileSync(entityStat);\n      return restore(JSON.parse(buffer));\n    }\n  }\n\n  function statFromSnapshot(path_, cb) {\n    const cb2 = cb || rethrow;\n    const entity = findVirtualFileSystemEntry(path_);\n    if (!entity) return findNativeAddonForStat(path_, cb);\n    const entityStat = entity[STORE_STAT];\n    if (entityStat) return statFromSnapshotSub(entityStat, cb);\n    return cb2(new Error('UNEXPECTED-35'));\n  }\n\n  fs.statSync = function statSync(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.statSync.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.statSync.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    return statFromSnapshot(path_);\n  };\n\n  fs.stat = function stat(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.stat.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.stat.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    const callback = dezalgo(maybeCallback(arguments));\n    statFromSnapshot(path_, callback);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // lstat /////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  fs.lstatSync = function lstatSync(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.lstatSync.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.lstatSync.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    return statFromSnapshot(path_);\n  };\n\n  fs.lstat = function lstat(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.lstat.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.lstat.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    const callback = dezalgo(maybeCallback(arguments));\n    statFromSnapshot(path_, callback);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // fstat /////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function fstatFromSnapshot(fd, cb) {\n    const cb2 = cb || rethrow;\n    const { entity } = docks[fd];\n    const entityStat = entity[STORE_STAT];\n    if (entityStat) return statFromSnapshotSub(entityStat, cb);\n    return cb2(new Error('UNEXPECTED-40'));\n  }\n\n  fs.fstatSync = function fstatSync(fd) {\n    if (!docks[fd]) {\n      return ancestor.fstatSync.apply(fs, arguments);\n    }\n\n    return fstatFromSnapshot(fd);\n  };\n\n  fs.fstat = function fstat(fd) {\n    if (!docks[fd]) {\n      return ancestor.fstat.apply(fs, arguments);\n    }\n\n    const callback = dezalgo(maybeCallback(arguments));\n    fstatFromSnapshot(fd, callback);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // exists ////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function findNativeAddonForExists(path_) {\n    const foundPath = findNativeAddonSyncFreeFromRequire(path_);\n    if (!foundPath) return false;\n    return ancestor.existsSync.call(fs, foundPath);\n  }\n\n  function existsFromSnapshot(path_) {\n    const entity = findVirtualFileSystemEntry(path_);\n    if (!entity) return findNativeAddonForExists(path_);\n    return true;\n  }\n\n  fs.existsSync = function existsSync(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.existsSync.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.existsSync.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    return existsFromSnapshot(path_);\n  };\n\n  fs.exists = function exists(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.exists.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.exists.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    const callback = dezalgo(maybeCallback(arguments));\n    callback(existsFromSnapshot(path_));\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // access ////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function accessFromSnapshot(path_, cb) {\n    const cb2 = cb || rethrow;\n    const entity = findVirtualFileSystemEntry(path_);\n    if (!entity) return cb2(error_ENOENT('File or directory', path_));\n    return cb2(null, undefined);\n  }\n\n  fs.accessSync = function accessSync(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.accessSync.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.accessSync.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    return accessFromSnapshot(path_);\n  };\n\n  fs.access = function access(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.access.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.access.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    const callback = dezalgo(maybeCallback(arguments));\n    accessFromSnapshot(path_, callback);\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // mkdir /////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function mkdirFailInSnapshot(path_, cb) {\n    const cb2 = cb || rethrow;\n    return cb2(\n      new Error('Cannot mkdir in a snapshot. Try mountpoints instead.')\n    );\n  }\n\n  fs.mkdirSync = function mkdirSync(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.mkdirSync.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.mkdirSync.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    return mkdirFailInSnapshot(path_);\n  };\n\n  fs.mkdir = function mkdir(path_) {\n    if (!insideSnapshot(path_)) {\n      return ancestor.mkdir.apply(fs, arguments);\n    }\n    if (insideMountpoint(path_)) {\n      return ancestor.mkdir.apply(fs, translateNth(arguments, 0, path_));\n    }\n\n    mkdirFailInSnapshot(path_, dezalgo(maybeCallback(arguments)));\n  };\n\n  // ///////////////////////////////////////////////////////////////\n  // promises ////////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  if (fs.promises !== undefined) {\n    const ancestor_promises = {\n      open: fs.promises.open,\n      read: fs.promises.read,\n      write: fs.promises.write,\n      readFile: fs.promises.readFile,\n      readdir: fs.promises.readdir,\n      realpath: fs.promises.realpath,\n      stat: fs.promises.stat,\n      lstat: fs.promises.lstat,\n      fstat: fs.promises.fstat,\n      access: fs.promises.access,\n      copyFile: fs.promises.copyFile,\n    };\n\n    fs.promises.open = async function open(path_) {\n      if (!insideSnapshot(path_)) {\n        return ancestor_promises.open.apply(this, arguments);\n      }\n      if (insideMountpoint(path_)) {\n        return ancestor_promises.open.apply(\n          this,\n          translateNth(arguments, 0, path_)\n        );\n      }\n      const externalFile = uncompressExternallyPath(path_);\n      arguments[0] = externalFile;\n      const fd = await ancestor_promises.open.apply(this, arguments);\n      if (typeof fd === 'object') {\n        fd._pkg = { externalFile, file: path_ };\n      }\n      return fd;\n    };\n    fs.promises.readFile = async function readFile(path_) {\n      if (!insideSnapshot(path_)) {\n        return ancestor_promises.readFile.apply(this, arguments);\n      }\n      if (insideMountpoint(path_)) {\n        return ancestor_promises.readFile.apply(\n          this,\n          translateNth(arguments, 0, path_)\n        );\n      }\n      const externalFile = uncompressExternallyPath(path_);\n      arguments[0] = externalFile;\n      return ancestor_promises.readFile.apply(this, arguments);\n    };\n\n    fs.promises.write = async function write(fd) {\n      if (fd._pkg) {\n        throw new Error(\n          `[PKG] Cannot write into Snapshot file : ${fd._pkg.file}`\n        );\n      }\n      return ancestor_promises.write.apply(this, arguments);\n    };\n\n    // this one use promisify on purpose\n    fs.promises.readdir = util.promisify(fs.readdir);\n    fs.promises.copyFile = util.promisify(fs.copyFile);\n    fs.promises.stat = util.promisify(fs.stat);\n    fs.promises.lstat = util.promisify(fs.lstat);\n\n    /*\n    fs.promises.read = util.promisify(fs.read);\n    fs.promises.realpath = util.promisify(fs.realpath);\n    fs.promises.fstat = util.promisify(fs.fstat);\n    fs.promises.access = util.promisify(fs.access);\n  */\n  }\n\n  // ///////////////////////////////////////////////////////////////\n  // INTERNAL //////////////////////////////////////////////////////\n  // ///////////////////////////////////////////////////////////////\n\n  function makeLong(f) {\n    return path._makeLong(f);\n  }\n\n  function revertMakingLong(f) {\n    if (/^\\\\\\\\\\?\\\\/.test(f)) return f.slice(4);\n    return f;\n  }\n\n  function findNativeAddonForInternalModuleStat(path_) {\n    const fNative = findNativeAddonSyncUnderRequire(path_);\n    if (!fNative) return -ENOENT;\n    return process.binding('fs').internalModuleStat(makeLong(fNative));\n  }\n\n  fs.internalModuleStat = function internalModuleStat(long) {\n    // from node comments:\n    // Used to speed up module loading. Returns 0 if the path refers to\n    // a file, 1 when it's a directory or < 0 on error (usually -ENOENT).\n    // The speedup comes from not creating thousands of Stat and Error objects.\n\n    const path_ = revertMakingLong(long);\n\n    if (!insideSnapshot(path_)) {\n      return process.binding('fs').internalModuleStat(long);\n    }\n    if (insideMountpoint(path_)) {\n      return process\n        .binding('fs')\n        .internalModuleStat(makeLong(translate(path_)));\n    }\n\n    const entity = findVirtualFileSystemEntry(path_);\n\n    if (!entity) {\n      return findNativeAddonForInternalModuleStat(path_);\n    }\n\n    const entityBlob = entity[STORE_BLOB];\n    if (entityBlob) {\n      return 0;\n    }\n\n    const entityContent = entity[STORE_CONTENT];\n    if (entityContent) {\n      return 0;\n    }\n\n    const entityLinks = entity[STORE_LINKS];\n    if (entityLinks) {\n      return 1;\n    }\n\n    return -ENOENT;\n  };\n\n  fs.internalModuleReadJSON = function internalModuleReadJSON(long) {\n    // from node comments:\n    // Used to speed up module loading. Returns the contents of the file as\n    // a string or undefined when the file cannot be opened. The speedup\n    // comes from not creating Error objects on failure.\n    // For newer node versions (after https://github.com/nodejs/node/pull/33229 ):\n    // Returns an array [string, boolean].\n    //\n    const returnArray =\n      (NODE_VERSION_MAJOR === 12 && NODE_VERSION_MINOR >= 19) ||\n      (NODE_VERSION_MAJOR === 14 && NODE_VERSION_MINOR >= 5) ||\n      NODE_VERSION_MAJOR >= 15;\n\n    const path_ = revertMakingLong(long);\n    const bindingFs = process.binding('fs');\n    const readFile = (\n      bindingFs.internalModuleReadFile || bindingFs.internalModuleReadJSON\n    ).bind(bindingFs);\n    if (!insideSnapshot(path_)) {\n      return readFile(long);\n    }\n    if (insideMountpoint(path_)) {\n      return readFile(makeLong(translate(path_)));\n    }\n\n    const entity = findVirtualFileSystemEntry(path_);\n\n    if (!entity) {\n      return returnArray ? [undefined, false] : undefined;\n    }\n\n    const entityContent = entity[STORE_CONTENT];\n    if (!entityContent) {\n      return returnArray ? [undefined, false] : undefined;\n    }\n    return returnArray\n      ? [payloadFileSync(entityContent).toString(), true]\n      : payloadFileSync(entityContent).toString();\n  };\n\n  fs.internalModuleReadFile = fs.internalModuleReadJSON;\n})();\n\n// /////////////////////////////////////////////////////////////////\n// PATCH MODULE ////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n\n(() => {\n  const ancestor = {\n    require: Module.prototype.require,\n    _compile: Module.prototype._compile,\n    _resolveFilename: Module._resolveFilename,\n    runMain: Module.runMain,\n  };\n\n  Module.prototype.require = function require(path_) {\n    try {\n      return ancestor.require.apply(this, arguments);\n    } catch (error) {\n      if (\n        (error.code === 'ENOENT' || error.code === 'MODULE_NOT_FOUND') &&\n        !insideSnapshot(path_) &&\n        !path.isAbsolute(path_)\n      ) {\n        if (!error.pkg) {\n          error.pkg = true;\n          error.message +=\n            '\\n' +\n            '1) If you want to compile the package/file into ' +\n            'executable, please pay attention to compilation ' +\n            \"warnings and specify a literal in 'require' call. \" +\n            \"2) If you don't want to compile the package/file \" +\n            \"into executable and want to 'require' it from \" +\n            'filesystem (likely plugin), specify an absolute ' +\n            \"path in 'require' call using process.cwd() or \" +\n            'process.execPath.';\n        }\n      }\n      throw error;\n    }\n  };\n\n  let im;\n  let makeRequireFunction;\n\n  if (NODE_VERSION_MAJOR <= 9) {\n    im = require('internal/module');\n    makeRequireFunction = im.makeRequireFunction;\n  } else {\n    if (NODE_VERSION_MAJOR <= 18) {\n      im = require('internal/modules/cjs/helpers');\n    } else {\n      im = require('internal/modules/helpers');\n    }\n    makeRequireFunction = im.makeRequireFunction;\n    // TODO esm modules along with cjs\n  }\n\n  Module.prototype._compile = function _compile(content, filename_) {\n    if (!insideSnapshot(filename_)) {\n      return ancestor._compile.apply(this, arguments);\n    }\n    if (insideMountpoint(filename_)) {\n      // DON'T TRANSLATE! otherwise __dirname gets real name\n      return ancestor._compile.apply(this, arguments);\n    }\n\n    const entity = findVirtualFileSystemEntry(filename_);\n\n    if (!entity) {\n      // let user try to \"_compile\" a packaged file\n      return ancestor._compile.apply(this, arguments);\n    }\n\n    const entityBlob = entity[STORE_BLOB];\n    const entityContent = entity[STORE_CONTENT];\n\n    if (entityBlob) {\n      const options = {\n        filename: filename_,\n        lineOffset: 0,\n        displayErrors: true,\n        cachedData: payloadFileSync(entityBlob),\n        sourceless: !entityContent,\n      };\n\n      const code = entityContent\n        ? Module.wrap(payloadFileSync(entityContent))\n        : undefined;\n\n      const script = new Script(code, options);\n      const wrapper = script.runInThisContext(options);\n      if (!wrapper) process.exit(4); // for example VERSION_MISMATCH\n      const dirname = path.dirname(filename_);\n      const rqfn = makeRequireFunction(this);\n      const args = [this.exports, rqfn, this, filename_, dirname];\n      return wrapper.apply(this.exports, args);\n    }\n\n    if (entityContent) {\n      if (entityBlob) throw new Error('UNEXPECTED-50');\n      // content is already in utf8 and without BOM (that is expected\n      // by stock _compile), but entityContent is still a Buffer\n      return ancestor._compile.apply(this, arguments);\n    }\n\n    throw new Error('UNEXPECTED-55');\n  };\n\n  Module._resolveFilename = function _resolveFilename() {\n    let filename;\n    let flagWasOn = false;\n    try {\n      filename = ancestor._resolveFilename.apply(this, arguments);\n    } catch (error) {\n      if (error.code !== 'MODULE_NOT_FOUND') throw error;\n\n      FLAG_ENABLE_PROJECT = true;\n      const savePathCache = Module._pathCache;\n      Module._pathCache = Object.create(null);\n      try {\n        filename = ancestor._resolveFilename.apply(this, arguments);\n        flagWasOn = true;\n      } finally {\n        Module._pathCache = savePathCache;\n        FLAG_ENABLE_PROJECT = false;\n      }\n    }\n    if (!insideSnapshot(filename)) {\n      return filename;\n    }\n    if (insideMountpoint(filename)) {\n      return filename;\n    }\n\n    if (flagWasOn) {\n      FLAG_ENABLE_PROJECT = true;\n      try {\n        const found = findNativeAddonSyncUnderRequire(filename);\n        if (found) filename = found;\n      } finally {\n        FLAG_ENABLE_PROJECT = false;\n      }\n    }\n\n    return filename;\n  };\n\n  Module.runMain = function runMain() {\n    Module._load(ENTRYPOINT, null, true);\n    process._tickCallback();\n  };\n})();\n\n// /////////////////////////////////////////////////////////////////\n// PATCH CHILD_PROCESS /////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n(() => {\n  const ancestor = {\n    spawn: childProcess.spawn,\n    spawnSync: childProcess.spawnSync,\n    execFile: childProcess.execFile,\n    execFileSync: childProcess.execFileSync,\n    exec: childProcess.exec,\n    execSync: childProcess.execSync,\n  };\n\n  function setOptsEnv(args) {\n    let pos = args.length - 1;\n    if (typeof args[pos] === 'function') pos -= 1;\n    if (typeof args[pos] !== 'object' || Array.isArray(args[pos])) {\n      pos += 1;\n      args.splice(pos, 0, {});\n    }\n    const opts = args[pos];\n    if (!opts.env) opts.env = _extend({}, process.env);\n    if (opts.env.PKG_EXECPATH === 'PKG_INVOKE_NODEJS') return;\n    opts.env.PKG_EXECPATH = EXECPATH;\n  }\n\n  function startsWith2(args, index, name, impostor) {\n    const qsName = `\"${name} `;\n    if (args[index].slice(0, qsName.length) === qsName) {\n      args[index] = `\"${impostor} ${args[index].slice(qsName.length)}`;\n      return true;\n    }\n    const sName = `${name} `;\n    if (args[index].slice(0, sName.length) === sName) {\n      args[index] = `${impostor} ${args[index].slice(sName.length)}`;\n      return true;\n    }\n    if (args[index] === name) {\n      args[index] = impostor;\n      return true;\n    }\n    return false;\n  }\n\n  function startsWith(args, index, name) {\n    const qName = `\"${name}\"`;\n    const qEXECPATH = `\"${EXECPATH}\"`;\n    const jsName = JSON.stringify(name);\n    const jsEXECPATH = JSON.stringify(EXECPATH);\n    return (\n      startsWith2(args, index, name, EXECPATH) ||\n      startsWith2(args, index, qName, qEXECPATH) ||\n      startsWith2(args, index, jsName, jsEXECPATH)\n    );\n  }\n\n  function modifyLong(args, index) {\n    if (!args[index]) return;\n    return (\n      startsWith(args, index, 'node') ||\n      startsWith(args, index, ARGV0) ||\n      startsWith(args, index, ENTRYPOINT) ||\n      startsWith(args, index, EXECPATH)\n    );\n  }\n\n  function modifyShort(args) {\n    if (!args[0]) return;\n    if (!Array.isArray(args[1])) {\n      args.splice(1, 0, []);\n    }\n    if (\n      args[0] === 'node' ||\n      args[0] === ARGV0 ||\n      args[0] === ENTRYPOINT ||\n      args[0] === EXECPATH\n    ) {\n      args[0] = EXECPATH;\n    } else {\n      for (let i = 1; i < args[1].length; i += 1) {\n        const mbc = args[1][i - 1];\n        if (mbc === '-c' || mbc === '/c') {\n          modifyLong(args[1], i);\n        }\n      }\n    }\n  }\n\n  childProcess.spawn = function spawn() {\n    const args = cloneArgs(arguments);\n    setOptsEnv(args);\n    modifyShort(args);\n    return ancestor.spawn.apply(childProcess, args);\n  };\n\n  childProcess.spawnSync = function spawnSync() {\n    const args = cloneArgs(arguments);\n    setOptsEnv(args);\n    modifyShort(args);\n    return ancestor.spawnSync.apply(childProcess, args);\n  };\n\n  childProcess.execFile = function execFile() {\n    const args = cloneArgs(arguments);\n    setOptsEnv(args);\n    modifyShort(args);\n    return ancestor.execFile.apply(childProcess, args);\n  };\n\n  childProcess.execFileSync = function execFileSync() {\n    const args = cloneArgs(arguments);\n    setOptsEnv(args);\n    modifyShort(args);\n    return ancestor.execFileSync.apply(childProcess, args);\n  };\n\n  childProcess.exec = function exec() {\n    const args = cloneArgs(arguments);\n    setOptsEnv(args);\n    modifyLong(args, 0);\n    return ancestor.exec.apply(childProcess, args);\n  };\n\n  childProcess.execSync = function execSync() {\n    const args = cloneArgs(arguments);\n    setOptsEnv(args);\n    modifyLong(args, 0);\n    return ancestor.execSync.apply(childProcess, args);\n  };\n})();\n\n// /////////////////////////////////////////////////////////////////\n// PROMISIFY ///////////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n(() => {\n  const { custom } = promisify;\n  const { customPromisifyArgs } = require('internal/util');\n\n  // /////////////////////////////////////////////////////////////\n  // FS //////////////////////////////////////////////////////////\n  // /////////////////////////////////////////////////////////////\n\n  Object.defineProperty(fs.exists, custom, {\n    value(path_) {\n      return new Promise((resolve) => {\n        fs.exists(path_, (exists) => {\n          resolve(exists);\n        });\n      });\n    },\n  });\n\n  Object.defineProperty(fs.read, customPromisifyArgs, {\n    value: ['bytesRead', 'buffer'],\n  });\n\n  Object.defineProperty(fs.write, customPromisifyArgs, {\n    value: ['bytesWritten', 'buffer'],\n  });\n\n  // /////////////////////////////////////////////////////////////\n  // CHILD_PROCESS ///////////////////////////////////////////////\n  // /////////////////////////////////////////////////////////////\n\n  const customPromiseExecFunction =\n    (o) =>\n    (...args) => {\n      let resolve;\n      let reject;\n      const p = new Promise((res, rej) => {\n        resolve = res;\n        reject = rej;\n      });\n\n      p.child = o.apply(\n        undefined,\n        args.concat((error, stdout, stderr) => {\n          if (error !== null) {\n            error.stdout = stdout;\n            error.stderr = stderr;\n            reject(error);\n          } else {\n            resolve({ stdout, stderr });\n          }\n        })\n      );\n\n      return p;\n    };\n\n  Object.defineProperty(childProcess.exec, custom, {\n    value: customPromiseExecFunction(childProcess.exec),\n  });\n\n  Object.defineProperty(childProcess.execFile, custom, {\n    value: customPromiseExecFunction(childProcess.execFile),\n  });\n})();\n\n// /////////////////////////////////////////////////////////////////\n// PATCH PROCESS ///////////////////////////////////////////////////\n// /////////////////////////////////////////////////////////////////\n(() => {\n  const ancestor = {\n    dlopen: process.dlopen,\n  };\n\n  function revertMakingLong(f) {\n    if (/^\\\\\\\\\\?\\\\/.test(f)) return f.slice(4);\n    return f;\n  }\n\n  process.dlopen = function dlopen() {\n    const args = cloneArgs(arguments);\n    const modulePath = revertMakingLong(args[1]);\n    const moduleBaseName = path.basename(modulePath);\n    const moduleFolder = path.dirname(modulePath);\n\n    if (insideSnapshot(modulePath)) {\n      const moduleContent = fs.readFileSync(modulePath);\n\n      // Node addon files and .so cannot be read with fs directly, they are loaded with process.dlopen which needs a filesystem path\n      // we need to write the file somewhere on disk first and then load it\n      // the hash is needed to be sure we reload the module in case it changes\n      const hash = createHash('sha256').update(moduleContent).digest('hex');\n\n      // Example: /tmp/pkg/<hash>\n      const tmpFolder = path.join(tmpdir(), 'pkg', hash);\n\n      createDirRecursively(tmpFolder);\n\n      // Example: moduleFolder = /snapshot/appname/node_modules/sharp/build/Release\n      const parts = moduleFolder.split(path.sep);\n      const mIndex = parts.indexOf('node_modules') + 1;\n\n      let newPath;\n\n      // it's a node addon file contained in node_modules folder\n      // we copy the entire module folder in tmp folder\n      if (mIndex > 0) {\n        // Example: modulePackagePath = sharp/build/Release\n        const modulePackagePath = parts.slice(mIndex).join(path.sep);\n        // Example: modulePkgFolder = /snapshot/appname/node_modules/sharp\n        const modulePkgFolder = parts.slice(0, mIndex + 1).join(path.sep);\n\n        // here we copy all files from the snapshot module folder to temporary folder\n        // we keep the module folder structure to prevent issues with modules that are statically\n        // linked using relative paths (Fix #1075)\n        copyFolderRecursiveSync(modulePkgFolder, tmpFolder);\n\n        // Example: /tmp/pkg/<hash>/sharp/build/Release/sharp.node\n        newPath = path.join(tmpFolder, modulePackagePath, moduleBaseName);\n      } else {\n        const tmpModulePath = path.join(tmpFolder, moduleBaseName);\n\n        if (!fs.existsSync(tmpModulePath)) {\n          fs.copyFileSync(modulePath, tmpModulePath);\n        }\n\n        // load the copied file in the temporary folder\n        newPath = tmpModulePath;\n      }\n\n      // replace the path with the new module path\n      args[1] = newPath;\n    }\n\n    return ancestor.dlopen.apply(process, args);\n  };\n})();\n"
  },
  {
    "path": "prelude/diagnostic.js",
    "content": "/* eslint-disable global-require */\n/* eslint-disable no-console */\n/* global DICT */\n\n'use strict';\n\n(function installDiagnostic() {\n  const fs = require('fs');\n  const path = require('path');\n  const win32 = process.platform === 'win32';\n\n  if (process.env.DEBUG_PKG === '2') {\n    console.log(Object.entries(DICT));\n  }\n  function dumpLevel(filename, level, tree) {\n    let totalSize = 0;\n    const d = fs.readdirSync(filename);\n    for (let j = 0; j < d.length; j += 1) {\n      const f = path.join(filename, d[j]);\n      const realPath = fs.realpathSync(f);\n      const isSymbolicLink2 = f !== realPath;\n\n      const s = fs.statSync(f);\n      totalSize += s.size;\n\n      if (s.isDirectory() && !isSymbolicLink2) {\n        const tree1 = [];\n        totalSize += dumpLevel(f, level + 1, tree1);\n        const str =\n          (' '.padStart(level * 2, ' ') + d[j]).padEnd(40, ' ') +\n          (totalSize.toString().padStart(10, ' ') +\n            (isSymbolicLink2 ? `=> ${realPath}` : ' '));\n        tree.push(str);\n        tree1.forEach((x) => tree.push(x));\n      } else {\n        const str =\n          (' '.padStart(level * 2, ' ') + d[j]).padEnd(40, ' ') +\n          (s.size.toString().padStart(10, ' ') +\n            (isSymbolicLink2 ? `=> ${realPath}` : ' '));\n        tree.push(str);\n      }\n    }\n    return totalSize;\n  }\n  function wrap(obj, name) {\n    const f = fs[name];\n    obj[name] = (...args) => {\n      const args1 = Object.values(args);\n      console.log(\n        `fs.${name}`,\n        args1.filter((x) => typeof x === 'string')\n      );\n      return f.apply(this, args1);\n    };\n  }\n  if (process.env.DEBUG_PKG) {\n    console.log('------------------------------- virtual file system');\n    const startFolder = win32 ? 'C:\\\\snapshot' : '/snapshot';\n    console.log(startFolder);\n\n    const tree = [];\n    const totalSize = dumpLevel(startFolder, 1, tree);\n    console.log(tree.join('\\n'));\n\n    console.log('Total size = ', totalSize);\n    if (process.env.DEBUG_PKG === '2') {\n      wrap(fs, 'openSync');\n      wrap(fs, 'open');\n      wrap(fs, 'readSync');\n      wrap(fs, 'read');\n      wrap(fs, 'writeSync');\n      wrap(fs, 'write');\n      wrap(fs, 'closeSync');\n      wrap(fs, 'readFileSync');\n      wrap(fs, 'close');\n      wrap(fs, 'readFile');\n      wrap(fs, 'readdirSync');\n      wrap(fs, 'readdir');\n      wrap(fs, 'realpathSync');\n      wrap(fs, 'realpath');\n      wrap(fs, 'statSync');\n      wrap(fs, 'stat');\n      wrap(fs, 'lstatSync');\n      wrap(fs, 'lstat');\n      wrap(fs, 'fstatSync');\n      wrap(fs, 'fstat');\n      wrap(fs, 'existsSync');\n      wrap(fs, 'exists');\n      wrap(fs, 'accessSync');\n      wrap(fs, 'access');\n    }\n  }\n})();\n"
  },
  {
    "path": "test/.eslintrc.json",
    "content": "{\n  \"parserOptions\": {\n    \"sourceType\": \"script\"\n  },\n  \"rules\": {\n    \"no-var\": \"off\",\n    \"prefer-const\": \"off\",\n    \"vars-on-top\": \"off\"\n  }\n}\n"
  },
  {
    "path": "test/.gitignore",
    "content": "node_modules/\n"
  },
  {
    "path": "test/test-42-fetch-all/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst fetch = require('pkg-fetch');\nconst dontBuild = require('pkg-fetch/lib-es5/upload.js').dontBuild;\nconst knownPlatforms = fetch.system.knownPlatforms;\nconst items = [];\n\nfunction nodeRangeToNodeVersion(nodeRange) {\n  assert(/^node/.test(nodeRange));\n  return 'v' + nodeRange.slice(4);\n}\n\nfor (const platform of knownPlatforms) {\n  const nodeRanges = [\n    'node8',\n    'node10',\n    'node12',\n    'node14',\n    'node16',\n    'node18',\n  ];\n  for (const nodeRange of nodeRanges) {\n    const nodeVersion = nodeRangeToNodeVersion(nodeRange);\n    const archs = ['x64'];\n    if (platform === 'win') archs.unshift('x86');\n    if (platform === 'linux') archs.push('arm64');\n    // linux-arm64 is needed in multi-arch tests,\n    // so keeping it here as obligatory. but let's\n    // leave compiling for freebsd to end users\n    if (platform === 'freebsd') continue;\n    for (const arch of archs) {\n      if (dontBuild(nodeVersion, platform, arch)) continue;\n      items.push({ nodeRange, platform, arch });\n    }\n  }\n}\n\nlet p = Promise.resolve();\nitems.forEach((item) => {\n  p = p.then(() => fetch.need(item));\n});\n\np.catch((error) => {\n  if (!error.wasReported) console.log(`> ${error}`);\n  process.exit(2);\n});\n"
  },
  {
    "path": "test/test-42-path-related-values/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './project/app.js';\nconst output = './deploy/app-x64.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input], {\n  stdio: 'inherit',\n});\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nleft = JSON.parse(left);\nright = JSON.parse(right);\n\nfor (let obj of [left, right]) {\n  for (let s in obj) {\n    obj[s] = obj[s]\n      .replace('/home/travis/build', '')\n      .replace('/home/travis/.nvm/versions', '')\n      .replace('\\\\pkg\\\\test\\\\test-42-path-related-values', '')\n      .replace('/pkg/test/test-42-path-related-values', '')\n      .replace('app-x64.exe', 'app-x64');\n  }\n}\n\nfunction pad(s, width) {\n  const p = width > s.length ? width - s.length : 1;\n  return s + ' '.repeat(p);\n}\n\nconsole.log('-'.repeat(78));\nfor (let s in left) {\n  console.log(pad(s, 30), '|', pad(left[s], 36), '|', right[s]);\n}\nconsole.log('-'.repeat(78));\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-42-path-related-values/project/app.js",
    "content": "'use strict';\n\nrequire('./module.js');\n"
  },
  {
    "path": "test/test-42-path-related-values/project/module.js",
    "content": "'use strict';\n\nconsole.log(\n  JSON.stringify({\n    __filename: __filename,\n    __dirname: __dirname,\n    'process.cwd()': process.cwd(),\n    'process.execPath': process.execPath,\n    'process.argv[0]': process.argv[0],\n    'process.argv[1]': process.argv[1],\n    'process.pkg.entrypoint': process.pkg\n      ? process.pkg.entrypoint\n      : 'undefined',\n    'process.pkg.defaultEntrypoint': process.pkg\n      ? process.pkg.defaultEntrypoint\n      : 'undefined',\n    'require.main.filename': require.main.filename,\n  })\n);\n"
  },
  {
    "path": "test/test-46-input/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index';\n\nconst newcomers = [\n  'test-x-index-linux',\n  'test-x-index-macos',\n  'test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-js/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-x-index-linux',\n  'test-x-index-macos',\n  'test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-js/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index';\nconst exe = process.platform === 'win32' ? '.exe' : '';\nconst newcomers = ['test-output' + exe];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--output', 'test-output', input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-js/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index.js';\nconst exe = process.platform === 'win32' ? '.exe' : '';\nconst newcomers = ['test-output' + exe];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--output', 'test-output', input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-js/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-js-exe/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index.js';\nconst newcomers = ['test-output.exe'];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--output', 'test-output.exe', input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-js-exe/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-target/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index';\nconst exe = process.platform === 'win32' ? '.exe' : '';\nconst newcomers = ['test-output' + exe];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', target, '--output', 'test-output', input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-target/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-target-js/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index.js';\nconst exe = process.platform === 'win32' ? '.exe' : '';\nconst newcomers = ['test-output' + exe];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', target, '--output', 'test-output', input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-target-js/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-target-js-exe/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index.js';\nconst newcomers = ['test-output.exe'];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', target, '--output', 'test-output.exe', input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-target-js-exe/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index';\n\nconst newcomers = [\n  'test-output-linux',\n  'test-output-macos',\n  'test-output-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  'linux,macos,win',\n  '--output',\n  'test-output',\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index';\n\nconst newcomers = [\n  'test-output-linux',\n  'test-output-macos',\n  'test-output-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  `${target}-linux,${target}-macos,${target}-win`,\n  '--output',\n  'test-output',\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-2/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-3/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-output-linux',\n  'test-output-macos',\n  'test-output-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  'linux,macos,win',\n  '--output',\n  'test-output',\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-3/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-4/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-output-linux',\n  'test-output-macos',\n  'test-output-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  `${target}-linux,${target}-macos,${target}-win`,\n  '--output',\n  'test-output',\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-4/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-5/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-output.exe-linux',\n  'test-output.exe-macos',\n  'test-output.exe-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  'linux,macos,win',\n  '--output',\n  'test-output.exe',\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-5/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-6/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-output.exe-linux',\n  'test-output.exe-macos',\n  'test-output.exe-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  `${target}-linux,${target}-macos,${target}-win`,\n  '--output',\n  'test-output.exe',\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-output-targets-many-6/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-package-json/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './package.json';\n\nconst newcomers = [\n  'palookaville-linux',\n  'palookaville-macos',\n  'palookaville-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-package-json/package.json",
    "content": "{\n  \"name\": \"palookaville\",\n  \"bin\": \"test-x-index.js\"\n}\n"
  },
  {
    "path": "test/test-46-input-package-json/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-package-json-dir/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = '.';\n\nconst newcomers = [\n  'palookaville-linux',\n  'palookaville-macos',\n  'palookaville-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-package-json-dir/package.json",
    "content": "{\n  \"name\": \"palookaville\",\n  \"bin\": \"test-x-index.js\"\n}\n"
  },
  {
    "path": "test/test-46-input-package-json-dir/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-package-json-dir-scope/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = '.';\n\nconst newcomers = [\n  'palookaville-linux',\n  'palookaville-macos',\n  'palookaville-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-package-json-dir-scope/package.json",
    "content": "{\n  \"name\": \"@org/palookaville\",\n  \"bin\": \"test-x-index.js\"\n}\n"
  },
  {
    "path": "test/test-46-input-package-json-dir-scope/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-package-json-outputdir/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = '.';\n\nconst newcomers = [\n  'out/palookaville-linux',\n  'out/palookaville-macos',\n  'out/palookaville-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\nutils.vacuum.sync('out');\n"
  },
  {
    "path": "test/test-46-input-package-json-outputdir/package.json",
    "content": "{\n  \"name\": \"palookaville\",\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"outputPath\": \"out\"\n  }\n}\n"
  },
  {
    "path": "test/test-46-input-package-json-outputdir/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-package-json-target/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './package.json';\n\nconst newcomers = ['palookaville-linux', 'palookaville-macos'];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([input], { stdio: 'inherit' });\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-package-json-target/package.json",
    "content": "{\n  \"name\": \"palookaville\",\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"targets\": [\n      \"linux\",\n      \"macos\"\n    ]\n  }\n}\n"
  },
  {
    "path": "test/test-46-input-package-json-target/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-target/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index';\nconst exe = {\n  win32: '.exe',\n  linux: '-linux',\n  darwin: '-macos',\n  freebsd: '-freebsd',\n}[process.platform];\nconst newcomers = ['test-x-index' + exe];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', target, input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-target/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-target-js/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index.js';\nconst exe = process.platform === 'win32' ? '.exe' : '';\nconst newcomers = ['test-x-index' + exe];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', target, input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-target-js/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-target-js-exe/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index.js';\nconst exe = process.platform === 'win32' ? '.exe' : '';\nconst newcomers = ['test-x-index' + exe];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', target, input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-target-js-exe/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-targets-many/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index';\n\nconst newcomers = [\n  'test-x-index-linux',\n  'test-x-index-macos',\n  'test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', 'linux,macos,win', input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-targets-many/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-targets-many-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index';\n\nconst newcomers = [\n  'test-x-index-linux',\n  'test-x-index-macos',\n  'test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  `${target}-linux,${target}-macos,${target}-win`,\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-targets-many-2/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-targets-many-3/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-x-index-linux',\n  'test-x-index-macos',\n  'test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', 'linux,macos,win', input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-targets-many-3/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-targets-many-4/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-x-index-linux',\n  'test-x-index-macos',\n  'test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  `${target}-linux,${target}-macos,${target}-win`,\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-targets-many-4/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-targets-many-5/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-x-index-linux',\n  'test-x-index-macos',\n  'test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', 'linux,macos,win', input]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-targets-many-5/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-input-targets-many-6/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index.js';\n\nconst newcomers = [\n  'test-x-index-linux',\n  'test-x-index-macos',\n  'test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync([\n  '--target',\n  `${target}-linux,${target}-macos,${target}-win`,\n  input,\n]);\n\nutils.filesAfter(before, newcomers);\n"
  },
  {
    "path": "test/test-46-input-targets-many-6/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-multi-arch/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\n// only linux-x64 has linux-armv7 counterpart\nif (process.platform !== 'linux') return;\n\nconst opposite = { x64: 'armv7', x86: 'armv7', ia32: 'armv7', arm: 'x64' };\n\nconst target = opposite[process.arch];\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right = utils.pkg.sync(['--target', target, '--output', output, input], {\n  stdio: 'pipe',\n});\n\nassert(right.stdout.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.stdout.indexOf('Warning') >= 0);\nassert(right.stdout.indexOf(target) >= 0);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-46-multi-arch/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-multi-arch-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nif (\n  (function () {\n    // testing armv7-to-armv6 crosscompilation\n    if (process.platform === 'linux' && process.arch === 'arm') return false;\n    // TODO what about armv8? we need to distingish host arch\n    // armv6/armv7/armv8 - not just 'arm' we have now\n    // linux may not have multiarch installed\n    if (process.platform === 'linux') return true;\n    return false;\n  })()\n)\n  return;\n\nconst opposite = { x64: 'x86', x86: 'x64', ia32: 'x64', arm: 'armv6' };\n\nconst target = opposite[process.arch];\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input], {\n  stdio: 'inherit',\n});\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, '42\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-46-multi-arch-2/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-outpath/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index';\n\nconst newcomers = [\n  'out/test-x-index-linux',\n  'out/test-x-index-macos',\n  'out/test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--out-path', 'out', input]);\n\nutils.filesAfter(before, newcomers);\nutils.vacuum.sync('out');\n"
  },
  {
    "path": "test/test-46-outpath/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-outpath-target/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'latest';\nconst input = './test-x-index';\nconst exe = { win32: '.exe', linux: '', darwin: '', freebsd: '' }[\n  process.platform\n];\nconst newcomers = ['out/test-x-index' + exe];\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', target, '--out-path', 'out', input]);\n\nutils.filesAfter(before, newcomers);\nutils.vacuum.sync('out');\n"
  },
  {
    "path": "test/test-46-outpath-target/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-46-outpath-targets-many/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst input = './test-x-index';\n\nconst newcomers = [\n  'out/test-x-index-linux',\n  'out/test-x-index-macos',\n  'out/test-x-index-win.exe',\n];\n\nconst before = utils.filesBefore(newcomers);\n\nutils.pkg.sync(['--target', 'linux,macos,win', '--out-path', 'out', input]);\n\nutils.filesAfter(before, newcomers);\nutils.vacuum.sync('out');\n"
  },
  {
    "path": "test/test-46-outpath-targets-many/test-x-index",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-48-common/main.js",
    "content": "#!/usr/bin/env node\n\n/* eslint-disable no-multi-spaces */\n\n'use strict';\n\nconst assert = require('assert');\nconst common = require('../../lib-es5/common.js');\n\nfunction substituteMany(files) {\n  const d = common.retrieveDenominator(files);\n  return files.map((f) => common.substituteDenominator(f, d));\n}\n\nif (process.platform === 'win32') {\n  assert.strictEqual('c:', common.normalizePath('c:'));\n  assert.strictEqual('C:\\\\', common.normalizePath('c:\\\\'));\n  assert.strictEqual('C:\\\\', common.normalizePath('c:\\\\\\\\'));\n  assert.strictEqual('C:\\\\snapshot', common.normalizePath('c:\\\\snapshot'));\n  assert.strictEqual('C:\\\\snapshoter', common.normalizePath('c:\\\\snapshoter'));\n  assert.strictEqual('C:\\\\snapshot', common.normalizePath('c:\\\\snapshot\\\\'));\n  assert.strictEqual(\n    'C:\\\\snapshoter',\n    common.normalizePath('c:\\\\snapshoter\\\\')\n  );\n  assert.strictEqual(\n    'C:\\\\snapshot\\\\foo',\n    common.normalizePath('c:\\\\snapshot\\\\\\\\foo')\n  );\n  assert.strictEqual(\n    'C:\\\\snapshot\\\\foo\\\\bar',\n    common.normalizePath('c:\\\\snapshot\\\\\\\\foo\\\\\\\\bar\\\\/\\\\\\\\')\n  );\n\n  assert.strictEqual(common.insideSnapshot('c:'), false);\n  assert.strictEqual(common.insideSnapshot('c:\\\\'), false);\n  assert.strictEqual(common.insideSnapshot('c:\\\\foo'), false);\n  assert.strictEqual(common.insideSnapshot('c:\\\\foo\\\\snapshot'), false);\n  assert.strictEqual(common.insideSnapshot('c:\\\\snapshot'), true);\n  assert.strictEqual(common.insideSnapshot('c:\\\\snapshoter'), false);\n  assert.strictEqual(common.insideSnapshot('c:\\\\snapshot\\\\'), true);\n  assert.strictEqual(common.insideSnapshot('c:\\\\snapshoter\\\\'), false);\n  assert.strictEqual(common.insideSnapshot('c:\\\\snapshot\\\\\\\\'), true);\n  assert.strictEqual(common.insideSnapshot('c:\\\\snapshot\\\\foo'), true);\n  assert.strictEqual(common.insideSnapshot('c:\\\\snapshoter\\\\foo'), false);\n\n  assert.strictEqual('c:\\\\', common.stripSnapshot('c:\\\\'));\n  assert.strictEqual('c:\\\\\\\\', common.stripSnapshot('c:\\\\\\\\'));\n  assert.strictEqual('C:\\\\**\\\\', common.stripSnapshot('c:\\\\snapshot'));\n  assert.strictEqual('c:\\\\snapshoter', common.stripSnapshot('c:\\\\snapshoter'));\n  assert.strictEqual('C:\\\\**\\\\', common.stripSnapshot('c:\\\\snapshot\\\\'));\n  assert.strictEqual(\n    'c:\\\\snapshoter\\\\',\n    common.stripSnapshot('c:\\\\snapshoter\\\\')\n  );\n  assert.strictEqual(\n    'C:\\\\**\\\\foo',\n    common.stripSnapshot('c:\\\\snapshot\\\\\\\\foo')\n  );\n  assert.strictEqual(\n    'C:\\\\**\\\\foo\\\\bar',\n    common.stripSnapshot('c:\\\\snapshot\\\\\\\\foo\\\\\\\\bar\\\\/\\\\\\\\')\n  );\n\n  assert.strictEqual('C:\\\\snapshot', common.snapshotify('C:\\\\'));\n  assert.strictEqual('C:\\\\snapshot\\\\foo', common.snapshotify('C:\\\\foo'));\n  assert.strictEqual(\n    'C:\\\\snapshot\\\\foo\\\\bar',\n    common.snapshotify('C:\\\\foo\\\\bar')\n  );\n\n  assert.strictEqual('foo', common.removeUplevels('..\\\\foo'));\n  assert.strictEqual('foo', common.removeUplevels('..\\\\..\\\\foo'));\n  assert.strictEqual('.\\\\foo', common.removeUplevels('.\\\\foo'));\n  assert.strictEqual('.', common.removeUplevels('.'));\n  assert.strictEqual('.', common.removeUplevels('..'));\n  assert.strictEqual('.', common.removeUplevels('..\\\\..'));\n\n  assert.deepStrictEqual(\n    substituteMany([\n      'C:\\\\long\\\\haired\\\\freaky\\\\people',\n      'C:\\\\long\\\\haired\\\\aliens',\n    ]),\n    ['C:\\\\freaky\\\\people', 'C:\\\\aliens']\n  );\n\n  assert.deepStrictEqual(\n    substituteMany([\n      'C:\\\\long\\\\haired\\\\freaky\\\\people',\n      'C:\\\\long\\\\hyphen\\\\sign',\n    ]),\n    ['C:\\\\haired\\\\freaky\\\\people', 'C:\\\\hyphen\\\\sign']\n  );\n\n  assert.deepStrictEqual(\n    substituteMany([\n      'C:\\\\long\\\\haired\\\\freaky\\\\people',\n      'D:\\\\long\\\\hyphen\\\\sign',\n    ]),\n    ['C:\\\\long\\\\haired\\\\freaky\\\\people', 'D:\\\\long\\\\hyphen\\\\sign']\n  );\n} else {\n  assert.strictEqual('/', common.normalizePath('/'));\n  assert.strictEqual('/', common.normalizePath('//'));\n  assert.strictEqual('/snapshot', common.normalizePath('/snapshot'));\n  assert.strictEqual('/snapshoter', common.normalizePath('/snapshoter'));\n  assert.strictEqual('/snapshot', common.normalizePath('/snapshot/'));\n  assert.strictEqual('/snapshoter', common.normalizePath('/snapshoter/'));\n  assert.strictEqual('/snapshot/foo', common.normalizePath('/snapshot//foo'));\n  assert.strictEqual(\n    '/snapshot/foo/bar',\n    common.normalizePath('/snapshot//foo//bar/\\\\//')\n  );\n\n  assert.strictEqual(common.insideSnapshot(''), false);\n  assert.strictEqual(common.insideSnapshot('/'), false);\n  assert.strictEqual(common.insideSnapshot('/foo'), false);\n  assert.strictEqual(common.insideSnapshot('/foo/snapshot'), false);\n  assert.strictEqual(common.insideSnapshot('/snapshot'), true);\n  assert.strictEqual(common.insideSnapshot('/snapshoter'), false);\n  assert.strictEqual(common.insideSnapshot('/snapshot/'), true);\n  assert.strictEqual(common.insideSnapshot('/snapshoter/'), false);\n  assert.strictEqual(common.insideSnapshot('/snapshot//'), true);\n  assert.strictEqual(common.insideSnapshot('/snapshot/foo'), true);\n  assert.strictEqual(common.insideSnapshot('/snapshoter/foo'), false);\n\n  assert.strictEqual('/', common.stripSnapshot('/'));\n  assert.strictEqual('//', common.stripSnapshot('//'));\n  assert.strictEqual('/**/', common.stripSnapshot('/snapshot'));\n  assert.strictEqual('/snapshoter', common.stripSnapshot('/snapshoter'));\n  assert.strictEqual('/**/', common.stripSnapshot('/snapshot/'));\n  assert.strictEqual('/snapshoter/', common.stripSnapshot('/snapshoter/'));\n  assert.strictEqual('/**/foo', common.stripSnapshot('/snapshot//foo'));\n  assert.strictEqual(\n    '/**/foo/bar',\n    common.stripSnapshot('/snapshot//foo//bar/\\\\//')\n  );\n\n  assert.strictEqual('/snapshot', common.snapshotify('/'));\n  assert.strictEqual('/snapshot/foo', common.snapshotify('/foo'));\n  assert.strictEqual('/snapshot/foo/bar', common.snapshotify('/foo/bar'));\n\n  assert.strictEqual('foo', common.removeUplevels('../foo'));\n  assert.strictEqual('foo', common.removeUplevels('../../foo'));\n  assert.strictEqual('./foo', common.removeUplevels('./foo'));\n  assert.strictEqual('.', common.removeUplevels('.'));\n  assert.strictEqual('.', common.removeUplevels('..'));\n  assert.strictEqual('.', common.removeUplevels('../..'));\n\n  assert.deepStrictEqual(\n    substituteMany(['/long/haired/freaky/people', '/long/haired/aliens']),\n    ['/freaky/people', '/aliens']\n  );\n\n  assert.deepStrictEqual(\n    substituteMany(['/long/haired/freaky/people', '/long/hyphen/sign']),\n    ['/haired/freaky/people', '/hyphen/sign']\n  );\n}\n"
  },
  {
    "path": "test/test-50-api/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\nutils.mkdirp.sync(path.dirname(output));\n\n// calling twice\nrequire('../../')\n  .exec(['--target', target, '--output', output, input])\n  .then(function () {\n    return require('../../')\n      .exec(['--target', target, '--output', output, input])\n      .then(function () {\n        right = utils.spawn.sync(output, [], {});\n\n        assert.strictEqual(right, '42\\n');\n        utils.vacuum.sync(output);\n      });\n  })\n  .catch(function (error) {\n    console.error(error);\n    process.exit(2);\n  });\n"
  },
  {
    "path": "test/test-50-api/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-50-arguments/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\nutils.mkdirp.sync(path.dirname(output));\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync(output, ['42'], {});\nassert.strictEqual(right, '42\\n');\nright = utils.spawn.sync(output, ['-ft'], {});\nassert.strictEqual(right, '-ft\\n');\nright = utils.spawn.sync(output, ['--fourty-two'], {});\nassert.strictEqual(right, '--fourty-two\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-arguments/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(process.argv[2]);\n"
  },
  {
    "path": "test/test-50-ast-parsing/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst data = './test-y-data.txt';\n\nif (/^(node|v)?0/.test(target)) return;\nif (/^(node|v)?4/.test(target)) return;\n\nlet left, right;\n\nleft =\n  fs\n    .readFileSync(data, 'utf8')\n    .split('\\n')\n    .filter(function (line) {\n      return line.indexOf('/***/ ') >= 0;\n    })\n    .map(function (line) {\n      return line.split('/***/ ')[1].replace(/['`]/g, '\"');\n    })\n    .join('\\n') + '\\n';\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.deepStrictEqual(left.split(/(\\r|\\n)+/), right.split(/(\\r|\\n)+/));\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-ast-parsing/test-x-index.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst detector = require('../../lib-es5/detector.js');\nconst body = fs.readFileSync('./test-y-data.txt', 'utf8');\n\ndetector.detect(body, function (node, trying) {\n  let p;\n  p = detector.visitorSuccessful(node, true);\n  if (p) {\n    if (trying) {\n      console.log('try { ' + p + '; } catch (_) {}');\n    } else {\n      console.log(p + ';');\n    }\n    return false;\n  }\n  // TODO maybe NONLITERAL and USESCWD?\n  return true;\n});\n"
  },
  {
    "path": "test/test-50-ast-parsing/test-y-data.txt",
    "content": "// TODO import \"barbos0\" once it works\n/***/ import foo1 from \"barbos0\";\n/***/ import { foo2, foo3 } from \"barbos0\";\n/***/ import foo4, { foo5 as foo5a } from \"barbos0\";\n\nfunction hellee(a, b, c) {\n\n        require.resolve();\n  /***/ require.resolve(\"barbos1\");\n  /***/ require.resolve(`barbos1`);\n  /***/ require.resolve(`barbos1`, `must-exclude1`);\n  /***/ require.resolve(\"barbos1\", \"must-exclude1\");\n  /***/ require.resolve(\"barbos1\", \"may-exclude1\");\n  /***/ require.resolve(\"barbos1\", \"unknown1\");\n\n        require();\n  /***/ require(\"barbos2\");\n  /***/ require(`barbos2`);\n  /***/ require(`barbos2`, `must-exclude2`);\n  /***/ require(\"barbos2\", \"must-exclude2\");\n  /***/ require(\"barbos2\", \"may-exclude2\");\n  /***/ require(\"barbos2\", \"unknown2\");\n\n        path.join();\n        path.join(__dirname);\n  /***/ path.join(__dirname, \"file\");\n  /***/ path.join(__dirname, `file`);\n\n  // TODO path.join(__dirname + \"/file\");\n\n  return {\n    result: a + b - c\n  };\n\n}\n\nfunction helleeTry(a, b, c) {\n\n        try { require.resolve(); } catch (_) {}\n  /***/ try { require.resolve(\"barbos1\"); } catch (_) {}\n  /***/ try { require.resolve(`barbos1`); } catch (_) {}\n  /***/ try { require.resolve(`barbos1`, `must-exclude1`); } catch (_) {}\n  /***/ try { require.resolve(\"barbos1\", \"must-exclude1\"); } catch (_) {}\n  /***/ try { require.resolve(\"barbos1\", \"may-exclude1\"); } catch (_) {}\n  /***/ try { require.resolve(\"barbos1\", \"unknown1\"); } catch (_) {}\n\n        try { require(); } catch (_) {}\n  /***/ try { require(\"barbos2\"); } catch (_) {}\n  /***/ try { require(`barbos2`); } catch (_) {}\n  /***/ try { require(`barbos2`, `must-exclude2`); } catch (_) {}\n  /***/ try { require(\"barbos2\", \"must-exclude2\"); } catch (_) {}\n  /***/ try { require(\"barbos2\", \"may-exclude2\"); } catch (_) {}\n  /***/ try { require(\"barbos2\", \"unknown2\"); } catch (_) {}\n\n        try { path.join(); } catch (_) {}\n        try { path.join(__dirname); } catch (_) {}\n  /***/ try { path.join(__dirname, \"file\"); } catch (_) {}\n\n  // TODO path.join(__dirname + \"/file\");\n\n  return {\n    result: a + b - c\n  };\n\n}\n\nfunction helluu(a, b, c) {\n\n  return {\n    result: function() {\n\n      var require = {};\n      var path = {};\n\n            require.resolve();\n      /***/ require.resolve(\"barbos1\");\n      /***/ require.resolve(`barbos1`);\n      /***/ require.resolve(`barbos1`, `must-exclude1`);\n      /***/ require.resolve(\"barbos1\", \"must-exclude1\");\n      /***/ require.resolve(\"barbos1\", \"may-exclude1\");\n      /***/ require.resolve(\"barbos1\", \"unknown1\");\n\n            require();\n      /***/ require(\"barbos2\");\n      /***/ require(`barbos2`);\n      /***/ require(`barbos2`, `must-exclude2`);\n      /***/ require(\"barbos2\", \"must-exclude2\");\n      /***/ require(\"barbos2\", \"may-exclude2\");\n      /***/ require(\"barbos2\", \"unknown2\");\n\n            path.join();\n            path.join(__dirname);\n      /***/ path.join(__dirname, \"file\");\n      /***/ path.join(__dirname, `file`);\n\n      // TODO path.join(__dirname + \"/file\");\n\n      return {\n        result: a + b - c\n      };\n\n    }\n  }\n\n}\n\nfunction helluuTry(a, b, c) {\n\n  return {\n    result: function() {\n\n      var require = {};\n      var path = {};\n\n            try { require.resolve(); } catch (_) {}\n      /***/ try { require.resolve(\"barbos1\"); } catch (_) {}\n      /***/ try { require.resolve(`barbos1`); } catch (_) {}\n      /***/ try { require.resolve(`barbos1`, `must-exclude1`); } catch (_) {}\n      /***/ try { require.resolve(\"barbos1\", \"must-exclude1\"); } catch (_) {}\n      /***/ try { require.resolve(\"barbos1\", \"may-exclude1\"); } catch (_) {}\n      /***/ try { require.resolve(\"barbos1\", \"unknown1\"); } catch (_) {}\n\n            try { require(); } catch (_) {}\n      /***/ try { require(\"barbos2\"); } catch (_) {}\n      /***/ try { require(`barbos2`); } catch (_) {}\n      /***/ try { require(`barbos2`, `must-exclude2`); } catch (_) {}\n      /***/ try { require(\"barbos2\", \"must-exclude2\"); } catch (_) {}\n      /***/ try { require(\"barbos2\", \"may-exclude2\"); } catch (_) {}\n      /***/ try { require(\"barbos2\", \"unknown2\"); } catch (_) {}\n\n            try { path.join(); } catch (_) {}\n            try { path.join(__dirname); } catch (_) {}\n      /***/ try { path.join(__dirname, \"file\"); } catch (_) {}\n      /***/ try { path.join(__dirname, `file`); } catch (_) {}\n\n      // TODO path.join(__dirname + \"/file\");\n\n      return {\n        result: a + b - c\n      };\n\n    }\n  }\n\n}\n\nconsole.log(\n  hellee(1, 2, 3).result,\n  helluu(4, 5, 6).result\n);\n\nvar inheritedDataKeys = (function() {\n  var obj = {};\n  function hasProp(o, k) {\n    return true;\n  }\n  enumeration: for (var key in obj) {\n    if (!hasProp.call(obj, key)) {\n      continue enumeration;\n    }\n  }\n})();\n\nvar INFINITY = 1 / 0;\nvar NEGATIVE_INFINITY = -1 / 0;\n\nvar group_names = [\n  , 'whitespace' // INTENTIONAL COMMA!\n  , 'terminator'\n  , 'string'\n  , 'comment'\n  , 'identifier'\n  , 'preprocess'\n  , 'operator'\n  , 'invalid'\n];\n"
  },
  {
    "path": "test/test-50-ast-parsing-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst standard = 'stdout';\n\nlet left, right;\n\nleft =\n  fs\n    .readFileSync(input, 'utf8')\n    .split('\\n')\n    .filter(function (line) {\n      return line.indexOf('/**/') >= 0;\n    })\n    .map(function (line) {\n      return line.split('/**/')[1].trim();\n    })\n    .join('\\n') + '\\n';\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(\n  ['--debug', '--target', target, '--output', output, input],\n  inspect\n);\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\n\nconst rightLines = [];\nright.split('\\n').some(function (line) {\n  let s = line.split(\"Cannot resolve '\")[1];\n  if (s) {\n    rightLines.push(s.slice(0, -')'.length));\n    return;\n  }\n  s = line.split('Path.resolve(')[1];\n  if (s) {\n    rightLines.push(s.slice(0, -') is ambiguous'.length));\n  }\n});\n\nright = rightLines.join('\\n') + '\\n';\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-ast-parsing-2/test-x-index.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar async = 'async';\nvar config = 'config';\nvar i = 0;\n\nrequire(/**/ async /**/);\nrequire(/**/ async.toString() /**/);\nrequire(/**/ async.toString('utf8') /**/);\nrequire(/**/ path.resolve(process.cwd(), config) /**/);\nrequire(/**/ async.slice().toString('utf8') /**/);\nrequire(/**/ async.slice(0).toString('utf8') /**/);\nrequire(/**/ async.slice(1.5).toString('utf8') /**/);\n\nrequire(/**/ async + '.js' /**/);\nrequire(/**/ async + 75.25 /**/);\nrequire(/**/ __dirname + '/' + async /**/); // eslint-disable-line no-path-concat\nrequire(/**/ __dirname + '/' + async + 35.5 /**/); // eslint-disable-line no-path-concat\n\nrequire(/**/ [async, 'js'].join('.') /**/);\n// TODO require({ async: \"js\" }.join(\".\"));\n\nrequire(/**/ async[0] /**/);\nrequire(/**/ async[i] /**/);\nrequire(/**/ process.env.LATER_COV ? './later-cov' : './later' /**/);\npath.resolve(/**/ '123' /**/);\npath.resolve(/**/ '123', '456' /**/);\n"
  },
  {
    "path": "test/test-50-bakery/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, 'undefined\\n');\nassert.strictEqual(right, 'undefined\\n');\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-bakery/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(typeof gc);\n"
  },
  {
    "path": "test/test-50-bakery-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['--expose-gc', path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync([\n  '--target',\n  target,\n  '--options',\n  'expose-gc',\n  '--output',\n  output,\n  input,\n]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, 'function\\n');\nassert.strictEqual(right, 'function\\n');\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-bakery-2/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(typeof gc);\n"
  },
  {
    "path": "test/test-50-bakery-3/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['--v8-options'], { cwd: path.dirname(input) });\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), ['--v8-options'], {\n  cwd: path.dirname(output),\n  env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },\n});\n\nassert(left.indexOf('--expose_gc') >= 0 || left.indexOf('--expose-gc') >= 0);\nassert(right.indexOf('--expose_gc') >= 0 || right.indexOf('--expose-gc') >= 0);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-bakery-3/test-x-index.js",
    "content": "'use strict';\n\nconsole.log('should not be executed');\n"
  },
  {
    "path": "test/test-50-bakery-4/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nif (/^(node|v)?0/.test(target)) return;\nif (/^(node|v)?4/.test(target)) return;\nif (/^(node|v)?6/.test(target)) return;\nif (/^(node|v)?8/.test(target)) return;\n\nlet left;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['--v8-options'], { cwd: path.dirname(input) });\n\nfor (const option of ['v8-options', 'v8_options']) {\n  let right;\n\n  utils.pkg.sync([\n    '--target',\n    target,\n    '--options',\n    option,\n    '--output',\n    output,\n    input,\n  ]);\n\n  right = utils.spawn.sync('./' + path.basename(output), [], {\n    cwd: path.dirname(output),\n  });\n\n  assert(left.indexOf('--expose_gc') >= 0 || left.indexOf('--expose-gc') >= 0);\n  assert(\n    right.indexOf('--expose_gc') >= 0 || right.indexOf('--expose-gc') >= 0\n  );\n}\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-bakery-4/test-x-index.js",
    "content": "'use strict';\n\nconsole.log('should not be executed');\n"
  },
  {
    "path": "test/test-50-bakery-fetch/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\nconst fetch = require('pkg-fetch');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\n\nlet right;\n\nfetch\n  .need({\n    nodeRange: target,\n    platform: fetch.system.hostPlatform,\n    arch: fetch.system.hostArch,\n  })\n  .then(function (needed) {\n    if (process.platform === 'darwin') {\n      utils.spawn.sync(\n        'codesign',\n        ['-fds', '-', './' + path.basename(needed)],\n        { cwd: path.dirname(needed) }\n      );\n    }\n\n    right = utils.spawn.sync(\n      './' + path.basename(needed),\n      ['--expose-gc', '-e', 'if (global.gc) console.log(\"ok\");'],\n      { cwd: path.dirname(needed), env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' } }\n    );\n\n    assert.strictEqual(right, 'ok\\n');\n  })\n  .catch(function (error) {\n    console.error(`> ${error.message}`);\n    process.exit(2);\n  });\n"
  },
  {
    "path": "test/test-50-can-include-addon/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(\n  ['--target', target, '--output', output, input],\n  inspect\n);\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nright = right.replace(/\\\\/g, '/');\nassert(right.indexOf('test-50-can-include-addon/time.node') === -1);\nassert(right.indexOf('path-to-executable/time.node') === -1);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-can-include-addon/test-x-index.js",
    "content": "'use strict';\n\nrequire('./time.node');\n"
  },
  {
    "path": "test/test-50-can-include-addon/time.node",
    "content": "module.exports = 'test';\n"
  },
  {
    "path": "test/test-50-cannot-css-script/assets/animate.css",
    "content": "module.exports = require('path').basename(__filename);\n"
  },
  {
    "path": "test/test-50-cannot-css-script/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './test-output.exe';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(['--target', target, '--output', output, '.'], inspect);\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.indexOf(\"Non-javascript file is specified in 'scripts'\") >= 0);\nassert(right.indexOf('animate.css') >= 0);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-cannot-css-script/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"scripts\": [\n      \"assets\"\n    ]\n  }\n}\n"
  },
  {
    "path": "test/test-50-cannot-css-script/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-50-cannot-include-df/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(\n  ['--target', target, '--output', output, input],\n  inspect\n);\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nright = right.replace(/\\\\/g, '/');\nassert(right.indexOf('node_modules/some-package/fromFile') >= 0);\nassert(right.indexOf('path-to-executable/toFile') >= 0);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-cannot-include-df/test-x-index.js",
    "content": "'use strict';\n\nrequire('some-package');\n"
  },
  {
    "path": "test/test-50-chdir-env-var/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input], {\n  env: {\n    CHDIR: 'source',\n    PATH: process.env.PATH,\n  },\n});\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname('source/' + output),\n});\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(path.dirname('source/' + output));\n"
  },
  {
    "path": "test/test-50-chdir-env-var/source/test-x-index.js",
    "content": "'use strict';\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-50-class-to-string/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nif (/^(node|v)?0/.test(target)) return;\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-class-to-string/test-x-index.js",
    "content": "'use strict';\n\nconst Class = class {};\n// test if Class.toString() segfaults\n// or returns incorrect value (#62)\nconst cts = Class.toString();\nif (cts.indexOf('class {}') >= 0) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-50-config-log/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(\n  ['--target', target, '--output', output, input],\n  inspect\n);\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.indexOf('stylus options to resolve imports') >= 0);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-config-log/test-x-index.js",
    "content": "'use strict';\n\nrequire('stylus');\n"
  },
  {
    "path": "test/test-50-console-trace/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n  stdio: 'pipe',\n  expect: 0,\n});\n\nfunction extractFileName(line) {\n  let m = line.match(/^.+\\((.+):\\d+:\\d+\\)$/);\n  if (m) return m[1];\n  m = line.match(/^.+\\((.+):\\d+\\)$/);\n  if (m) return m[1];\n  m = line.match(/^.+\\((.+)\\)$/);\n  if (m) return m[1];\n  return undefined;\n}\n\nright = right.stderr.split('\\n');\nvar a = right[0];\nvar b = extractFileName(right[2]);\nvar c = extractFileName(right[3]);\nassert.strictEqual(a, b);\nassert.strictEqual(c, 'pkg/prelude/bootstrap.js');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-console-trace/test-x-index.js",
    "content": "'use strict';\n\nconsole.error(__filename);\nconsole.trace();\n"
  },
  {
    "path": "test/test-50-corrupt-executable/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\n// on macos damaging the binary should happen prior to the signature\nutils.pkg.sync([\n  '--no-signature',\n  '--target',\n  target,\n  '--output',\n  output,\n  input,\n]);\n\nconst damage = fs.readFileSync(output);\nconst boundary = 4096;\ndamage[damage.length - 2 * boundary - 10] = 0x2;\ndamage[damage.length - 3 * boundary - 10] = 0x2;\ndamage[damage.length - 4 * boundary - 10] = 0x2;\ndamage[damage.length - 2 * boundary + 10] = 0x2;\ndamage[damage.length - 3 * boundary + 10] = 0x2;\ndamage[damage.length - 4 * boundary + 10] = 0x2;\nfs.writeFileSync(output, damage);\n\nif (process.platform === 'darwin') {\n  utils.spawn.sync(\n    'codesign',\n    ['--no-strict', '-fs', '-', './' + path.basename(output)],\n    {\n      cwd: path.dirname(output),\n    }\n  );\n}\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n  stdio: 'pipe',\n  expect: 1,\n});\n\nassert.strictEqual(right.stdout, '');\nassert(\n  right.stderr.indexOf('Invalid') >= 0 ||\n    right.stderr.indexOf('ILLEGAL') >= 0 ||\n    right.stderr.indexOf('SyntaxError') >= 0\n);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-corrupt-executable/test-x-index.js",
    "content": "'use strict';\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-50-debug/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nutils.spawn.sync('./' + path.basename(output), ['--debug'], {\n  cwd: path.dirname(output),\n  env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },\n  stdio: 'pipe',\n  expect: 9,\n});\n\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-debug/test-x-index.js",
    "content": "'use strict';\n\nsetTimeout(function () {\n  console.log('ok');\n}, 3000);\n"
  },
  {
    "path": "test/test-50-error-source-position/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--public', '--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n  stdio: 'pipe',\n  expect: 1,\n});\n\nif (!/^(node|v)?0/.test(target)) {\n  assert(right.stderr.indexOf('x.parse is not a function') >= 0);\n}\n\nconst errorPointer = 'x.parse();' + require('os').EOL + '  ^';\nassert(right.stderr.indexOf(errorPointer) >= 0);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-error-source-position/test-x-index.js",
    "content": "'use strict';\n\nvar x = {};\nx.parse();\n\n// var x = {};\n// x.parse();\n\n// var x = {};\n// x.parse();\n\n// var x = {};\n// x.parse();\n\n// var x = {};\n// x.parse();\n\n// var x = {};\n// x.parse();\n"
  },
  {
    "path": "test/test-50-extensions/.eslintrc.json",
    "content": "{\n  \"parserOptions\": {\n    \"sourceType\": \"module\"\n  }\n}\n"
  },
  {
    "path": "test/test-50-extensions/main.js",
    "content": "#!/usr/bin/env node\n\n/* eslint-disable strict */\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet left, right;\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--public', '--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-extensions/test-x-index.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\nvar Module = require('module');\nvar fs = require('fs');\n\nModule._extensions['.js'] = function (module, filename) {\n  var content = fs.readFileSync(filename, 'utf8');\n  // emulating babel-register\n  content = content.replace(\n    \"import x from './test-z-sub.js';\",\n    \"require('./test-z-sub.js');\"\n  );\n  module._compile(content, filename);\n};\n\nrequire('./test-y-esnext.js');\n"
  },
  {
    "path": "test/test-50-extensions/test-y-esnext.js",
    "content": "/* eslint-disable no-unused-vars */\n\nimport x from './test-z-sub.js';\n"
  },
  {
    "path": "test/test-50-extensions/test-z-sub.js",
    "content": "console.log(42);\n"
  },
  {
    "path": "test/test-50-for-await-of/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nif (/^(node|v)?0/.test(target)) return;\nif (/^(node|v)?4/.test(target)) return;\nif (/^(node|v)?6/.test(target)) return;\nif (/^(node|v)?8/.test(target)) return;\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, '1\\n2\\n3\\n4\\n5\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-for-await-of/test-x-index.js",
    "content": "'use strict';\n\nclass AsyncIterator {\n  constructor() {\n    this.limit = 5;\n    this.current = 0;\n  }\n\n  next() {\n    this.current += 1;\n    let done = this.current > this.limit;\n    return Promise.resolve({\n      value: done ? undefined : this.current,\n      done,\n    });\n  }\n\n  [Symbol.asyncIterator]() {\n    return this;\n  }\n}\n\n// The function does have an await (in the for-await-of loop), ESLint just doesn't seem to detect it\n/* eslint-disable require-await */\nasync function t() {\n  /* eslint-enable require-await */\n  let it = new AsyncIterator();\n  for await (let x of it) {\n    console.log(x);\n  }\n}\n\nt();\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './run-time/test-output.exe';\n\nif (process.arch === 'arm') return;\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nleft = left.split('\\n');\nright = right.split('\\n');\n// right may have less lines, premature exit,\n// less trusted, so using left.length here\nfor (let i = 0; i < left.length; i += 1) {\n  if (left[i] !== right[i]) {\n    console.log('line', i);\n    console.log('<<left<<\\n' + left);\n    console.log('>>right>>\\n' + right);\n    throw new Error('Assertion');\n  }\n}\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"assets\": [\n      \"test-z-asset-A.css\",\n      \"test-z-asset-B.css\"\n    ]\n  }\n}\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer/test-x-index.js",
    "content": "'use strict';\n\nrequire('./test-x1-index.js');\nsetTimeout(function () {\n  require('./test-x2-index.js');\n  setTimeout(function () {\n    require('./test-x3-index.js');\n  }, 100);\n}, 100);\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer/test-x1-index.js",
    "content": "/* eslint-disable brace-style */\n/* eslint-disable no-path-concat */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar windows = process.platform === 'win32';\nvar theRequireContentA = './test-z-asset-A.css';\nvar theRequireContentB = 'test-z-asset-B.css';\n\nfunction firstLowerCase(s) {\n  return s.slice(0, 1).toLowerCase() + s.slice(1);\n}\n\nfunction firstUpperCase(s) {\n  return s.slice(0, 1).toUpperCase() + s.slice(1);\n}\n\nconsole.log(\n  [\n    fs.readFileSync(path.join(__dirname, theRequireContentA)),\n    fs.readFileSync(__dirname + path.sep + theRequireContentB),\n    fs.readFileSync(__dirname + '/' + theRequireContentB),\n    windows ? fs.readFileSync(__dirname + '/\\\\' + theRequireContentB) : '',\n    windows ? fs.readFileSync(__dirname + '\\\\' + theRequireContentB) : '',\n    windows ? fs.readFileSync(__dirname + '\\\\/' + theRequireContentB) : '',\n\n    fs.readFileSync(firstLowerCase(path.join(__dirname, theRequireContentA))),\n    fs.readFileSync(firstLowerCase(__dirname + path.sep + theRequireContentB)),\n    fs.readFileSync(firstLowerCase(__dirname + '/' + theRequireContentB)),\n    windows\n      ? fs.readFileSync(firstLowerCase(__dirname + '/\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.readFileSync(firstLowerCase(__dirname + '\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.readFileSync(firstLowerCase(__dirname + '\\\\/' + theRequireContentB))\n      : '',\n\n    fs.readFileSync(firstUpperCase(path.join(__dirname, theRequireContentA))),\n    fs.readFileSync(firstUpperCase(__dirname + path.sep + theRequireContentB)),\n    fs.readFileSync(firstUpperCase(__dirname + '/' + theRequireContentB)),\n    windows\n      ? fs.readFileSync(firstUpperCase(__dirname + '/\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.readFileSync(firstUpperCase(__dirname + '\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.readFileSync(firstUpperCase(__dirname + '\\\\/' + theRequireContentB))\n      : '',\n\n    //\n\n    fs.readdirSync(__dirname).length > 0,\n    fs.readdirSync(path.dirname(__dirname)).length > 0,\n    fs.readdirSync(path.dirname(path.dirname(__dirname))).length > 0,\n\n    fs.readdirSync(firstLowerCase(__dirname)).length > 0,\n    fs.readdirSync(firstLowerCase(path.dirname(__dirname))).length > 0,\n    fs.readdirSync(firstLowerCase(path.dirname(path.dirname(__dirname))))\n      .length > 0,\n\n    fs.readdirSync(firstUpperCase(__dirname)).length > 0,\n    fs.readdirSync(firstUpperCase(path.dirname(__dirname))).length > 0,\n    fs.readdirSync(firstUpperCase(path.dirname(path.dirname(__dirname))))\n      .length > 0,\n\n    //\n\n    fs.existsSync(path.join(__dirname, theRequireContentA)),\n    fs.existsSync(__dirname + path.sep + theRequireContentB),\n    fs.existsSync(__dirname + '/' + theRequireContentB),\n    windows ? fs.existsSync(__dirname + '/\\\\' + theRequireContentB) : '',\n    windows ? fs.existsSync(__dirname + '\\\\' + theRequireContentB) : '',\n    windows ? fs.existsSync(__dirname + '\\\\/' + theRequireContentB) : '',\n\n    fs.existsSync(firstLowerCase(path.join(__dirname, theRequireContentA))),\n    fs.existsSync(firstLowerCase(__dirname + path.sep + theRequireContentB)),\n    fs.existsSync(firstLowerCase(__dirname + '/' + theRequireContentB)),\n    windows\n      ? fs.existsSync(firstLowerCase(__dirname + '/\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.existsSync(firstLowerCase(__dirname + '\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.existsSync(firstLowerCase(__dirname + '\\\\/' + theRequireContentB))\n      : '',\n\n    fs.existsSync(firstUpperCase(path.join(__dirname, theRequireContentA))),\n    fs.existsSync(firstUpperCase(__dirname + path.sep + theRequireContentB)),\n    fs.existsSync(firstUpperCase(__dirname + '/' + theRequireContentB)),\n    windows\n      ? fs.existsSync(firstUpperCase(__dirname + '/\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.existsSync(firstUpperCase(__dirname + '\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.existsSync(firstUpperCase(__dirname + '\\\\/' + theRequireContentB))\n      : '',\n\n    //\n\n    fs.existsSync(path.join(__dirname, theRequireContentA + '-no-such')),\n    fs.existsSync(__dirname + path.sep + theRequireContentB + '-no-such'),\n    fs.existsSync(__dirname + '/' + theRequireContentB + '-no-such'),\n    windows\n      ? fs.existsSync(__dirname + '/\\\\' + theRequireContentB + '-no-such')\n      : '',\n    windows\n      ? fs.existsSync(__dirname + '\\\\' + theRequireContentB + '-no-such')\n      : '',\n    windows\n      ? fs.existsSync(__dirname + '\\\\/' + theRequireContentB + '-no-such')\n      : '',\n\n    fs.existsSync(\n      firstLowerCase(path.join(__dirname, theRequireContentA + '-no-such'))\n    ),\n    fs.existsSync(\n      firstLowerCase(__dirname + path.sep + theRequireContentB + '-no-such')\n    ),\n    fs.existsSync(\n      firstLowerCase(__dirname + '/' + theRequireContentB + '-no-such')\n    ),\n    windows\n      ? fs.existsSync(\n          firstLowerCase(__dirname + '/\\\\' + theRequireContentB + '-no-such')\n        )\n      : '',\n    windows\n      ? fs.existsSync(\n          firstLowerCase(__dirname + '\\\\' + theRequireContentB + '-no-such')\n        )\n      : '',\n    windows\n      ? fs.existsSync(\n          firstLowerCase(__dirname + '\\\\/' + theRequireContentB + '-no-such')\n        )\n      : '',\n\n    fs.existsSync(\n      firstUpperCase(path.join(__dirname, theRequireContentA + '-no-such'))\n    ),\n    fs.existsSync(\n      firstUpperCase(__dirname + path.sep + theRequireContentB + '-no-such')\n    ),\n    fs.existsSync(\n      firstUpperCase(__dirname + '/' + theRequireContentB + '-no-such')\n    ),\n    windows\n      ? fs.existsSync(\n          firstUpperCase(__dirname + '/\\\\' + theRequireContentB + '-no-such')\n        )\n      : '',\n    windows\n      ? fs.existsSync(\n          firstUpperCase(__dirname + '\\\\' + theRequireContentB + '-no-such')\n        )\n      : '',\n    windows\n      ? fs.existsSync(\n          firstUpperCase(__dirname + '\\\\/' + theRequireContentB + '-no-such')\n        )\n      : '',\n\n    //\n\n    fs.accessSync(path.join(__dirname, theRequireContentA)),\n    fs.accessSync(__dirname + path.sep + theRequireContentB),\n    fs.accessSync(__dirname + '/' + theRequireContentB),\n    windows ? fs.accessSync(__dirname + '/\\\\' + theRequireContentB) : '',\n    windows ? fs.accessSync(__dirname + '\\\\' + theRequireContentB) : '',\n    windows ? fs.accessSync(__dirname + '\\\\/' + theRequireContentB) : '',\n\n    fs.accessSync(firstLowerCase(path.join(__dirname, theRequireContentA))),\n    fs.accessSync(firstLowerCase(__dirname + path.sep + theRequireContentB)),\n    fs.accessSync(firstLowerCase(__dirname + '/' + theRequireContentB)),\n    windows\n      ? fs.accessSync(firstLowerCase(__dirname + '/\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.accessSync(firstLowerCase(__dirname + '\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.accessSync(firstLowerCase(__dirname + '\\\\/' + theRequireContentB))\n      : '',\n\n    fs.accessSync(firstUpperCase(path.join(__dirname, theRequireContentA))),\n    fs.accessSync(firstUpperCase(__dirname + path.sep + theRequireContentB)),\n    fs.accessSync(firstUpperCase(__dirname + '/' + theRequireContentB)),\n    windows\n      ? fs.accessSync(firstUpperCase(__dirname + '/\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.accessSync(firstUpperCase(__dirname + '\\\\' + theRequireContentB))\n      : '',\n    windows\n      ? fs.accessSync(firstUpperCase(__dirname + '\\\\/' + theRequireContentB))\n      : '',\n\n    //\n\n    fs.statSync(path.join(__dirname, theRequireContentA)).mode,\n    fs.statSync(__dirname + path.sep + theRequireContentB).mode,\n    fs.statSync(__dirname + '/' + theRequireContentB).mode,\n    windows ? fs.statSync(__dirname + '/\\\\' + theRequireContentB).mode : '',\n    windows ? fs.statSync(__dirname + '\\\\' + theRequireContentB).mode : '',\n    windows ? fs.statSync(__dirname + '\\\\/' + theRequireContentB).mode : '',\n\n    fs.statSync(firstLowerCase(path.join(__dirname, theRequireContentA))).mode,\n    fs.statSync(firstLowerCase(__dirname + path.sep + theRequireContentB)).mode,\n    fs.statSync(firstLowerCase(__dirname + '/' + theRequireContentB)).mode,\n    windows\n      ? fs.statSync(firstLowerCase(__dirname + '/\\\\' + theRequireContentB)).mode\n      : '',\n    windows\n      ? fs.statSync(firstLowerCase(__dirname + '\\\\' + theRequireContentB)).mode\n      : '',\n    windows\n      ? fs.statSync(firstLowerCase(__dirname + '\\\\/' + theRequireContentB)).mode\n      : '',\n\n    fs.statSync(firstUpperCase(path.join(__dirname, theRequireContentA))).mode,\n    fs.statSync(firstUpperCase(__dirname + path.sep + theRequireContentB)).mode,\n    fs.statSync(firstUpperCase(__dirname + '/' + theRequireContentB)).mode,\n    windows\n      ? fs.statSync(firstUpperCase(__dirname + '/\\\\' + theRequireContentB)).mode\n      : '',\n    windows\n      ? fs.statSync(firstUpperCase(__dirname + '\\\\' + theRequireContentB)).mode\n      : '',\n    windows\n      ? fs.statSync(firstUpperCase(__dirname + '\\\\/' + theRequireContentB)).mode\n      : '',\n\n    //\n\n    fs.statSync(path.join(__dirname, theRequireContentA)).isFile(),\n    fs.statSync(__dirname + path.sep + theRequireContentB).isFile(),\n    fs.statSync(__dirname + '/' + theRequireContentB).isFile(),\n    windows ? fs.statSync(__dirname + '/\\\\' + theRequireContentB).isFile() : '',\n    windows ? fs.statSync(__dirname + '\\\\' + theRequireContentB).isFile() : '',\n    windows ? fs.statSync(__dirname + '\\\\/' + theRequireContentB).isFile() : '',\n\n    fs\n      .statSync(firstLowerCase(path.join(__dirname, theRequireContentA)))\n      .isFile(),\n    fs\n      .statSync(firstLowerCase(__dirname + path.sep + theRequireContentB))\n      .isFile(),\n    fs.statSync(firstLowerCase(__dirname + '/' + theRequireContentB)).isFile(),\n    windows\n      ? fs\n          .statSync(firstLowerCase(__dirname + '/\\\\' + theRequireContentB))\n          .isFile()\n      : '',\n    windows\n      ? fs\n          .statSync(firstLowerCase(__dirname + '\\\\' + theRequireContentB))\n          .isFile()\n      : '',\n    windows\n      ? fs\n          .statSync(firstLowerCase(__dirname + '\\\\/' + theRequireContentB))\n          .isFile()\n      : '',\n\n    fs\n      .statSync(firstUpperCase(path.join(__dirname, theRequireContentA)))\n      .isFile(),\n    fs\n      .statSync(firstUpperCase(__dirname + path.sep + theRequireContentB))\n      .isFile(),\n    fs.statSync(firstUpperCase(__dirname + '/' + theRequireContentB)).isFile(),\n    windows\n      ? fs\n          .statSync(firstUpperCase(__dirname + '/\\\\' + theRequireContentB))\n          .isFile()\n      : '',\n    windows\n      ? fs\n          .statSync(firstUpperCase(__dirname + '\\\\' + theRequireContentB))\n          .isFile()\n      : '',\n    windows\n      ? fs\n          .statSync(firstUpperCase(__dirname + '\\\\/' + theRequireContentB))\n          .isFile()\n      : '',\n\n    //\n\n    fs.statSync(path.join(__dirname, theRequireContentA)).isDirectory(),\n    fs.statSync(__dirname + path.sep + theRequireContentB).isDirectory(),\n    fs.statSync(__dirname + '/' + theRequireContentB).isDirectory(),\n    windows\n      ? fs.statSync(__dirname + '/\\\\' + theRequireContentB).isDirectory()\n      : '',\n    windows\n      ? fs.statSync(__dirname + '\\\\' + theRequireContentB).isDirectory()\n      : '',\n    windows\n      ? fs.statSync(__dirname + '\\\\/' + theRequireContentB).isDirectory()\n      : '',\n\n    fs\n      .statSync(firstLowerCase(path.join(__dirname, theRequireContentA)))\n      .isDirectory(),\n    fs\n      .statSync(firstLowerCase(__dirname + path.sep + theRequireContentB))\n      .isDirectory(),\n    fs\n      .statSync(firstLowerCase(__dirname + '/' + theRequireContentB))\n      .isDirectory(),\n    windows\n      ? fs\n          .statSync(firstLowerCase(__dirname + '/\\\\' + theRequireContentB))\n          .isDirectory()\n      : '',\n    windows\n      ? fs\n          .statSync(firstLowerCase(__dirname + '\\\\' + theRequireContentB))\n          .isDirectory()\n      : '',\n    windows\n      ? fs\n          .statSync(firstLowerCase(__dirname + '\\\\/' + theRequireContentB))\n          .isDirectory()\n      : '',\n\n    fs\n      .statSync(firstUpperCase(path.join(__dirname, theRequireContentA)))\n      .isDirectory(),\n    fs\n      .statSync(firstUpperCase(__dirname + path.sep + theRequireContentB))\n      .isDirectory(),\n    fs\n      .statSync(firstUpperCase(__dirname + '/' + theRequireContentB))\n      .isDirectory(),\n    windows\n      ? fs\n          .statSync(firstUpperCase(__dirname + '/\\\\' + theRequireContentB))\n          .isDirectory()\n      : '',\n    windows\n      ? fs\n          .statSync(firstUpperCase(__dirname + '\\\\' + theRequireContentB))\n          .isDirectory()\n      : '',\n    windows\n      ? fs\n          .statSync(firstUpperCase(__dirname + '\\\\/' + theRequireContentB))\n          .isDirectory()\n      : '',\n\n    //\n\n    fs.lstatSync(path.join(__dirname, theRequireContentA)).mode,\n    fs.lstatSync(__dirname + path.sep + theRequireContentB).mode,\n    fs.lstatSync(__dirname + '/' + theRequireContentB).mode,\n    windows ? fs.lstatSync(__dirname + '/\\\\' + theRequireContentB).mode : '',\n    windows ? fs.lstatSync(__dirname + '\\\\' + theRequireContentB).mode : '',\n    windows ? fs.lstatSync(__dirname + '\\\\/' + theRequireContentB).mode : '',\n\n    fs.lstatSync(firstLowerCase(path.join(__dirname, theRequireContentA))).mode,\n    fs.lstatSync(firstLowerCase(__dirname + path.sep + theRequireContentB))\n      .mode,\n    fs.lstatSync(firstLowerCase(__dirname + '/' + theRequireContentB)).mode,\n    windows\n      ? fs.lstatSync(firstLowerCase(__dirname + '/\\\\' + theRequireContentB))\n          .mode\n      : '',\n    windows\n      ? fs.lstatSync(firstLowerCase(__dirname + '\\\\' + theRequireContentB)).mode\n      : '',\n    windows\n      ? fs.lstatSync(firstLowerCase(__dirname + '\\\\/' + theRequireContentB))\n          .mode\n      : '',\n\n    fs.lstatSync(firstUpperCase(path.join(__dirname, theRequireContentA))).mode,\n    fs.lstatSync(firstUpperCase(__dirname + path.sep + theRequireContentB))\n      .mode,\n    fs.lstatSync(firstUpperCase(__dirname + '/' + theRequireContentB)).mode,\n    windows\n      ? fs.lstatSync(firstUpperCase(__dirname + '/\\\\' + theRequireContentB))\n          .mode\n      : '',\n    windows\n      ? fs.lstatSync(firstUpperCase(__dirname + '\\\\' + theRequireContentB)).mode\n      : '',\n    windows\n      ? fs.lstatSync(firstUpperCase(__dirname + '\\\\/' + theRequireContentB))\n          .mode\n      : '',\n\n    //\n\n    fs.realpathSync(path.join(__dirname, theRequireContentA)).mode,\n    fs.realpathSync(__dirname + path.sep + theRequireContentB).mode,\n    fs.realpathSync(__dirname + '/' + theRequireContentB).mode,\n    windows ? fs.realpathSync(__dirname + '/\\\\' + theRequireContentB).mode : '',\n    windows ? fs.realpathSync(__dirname + '\\\\' + theRequireContentB).mode : '',\n    windows ? fs.realpathSync(__dirname + '\\\\/' + theRequireContentB).mode : '',\n\n    fs.realpathSync(firstLowerCase(path.join(__dirname, theRequireContentA)))\n      .mode,\n    fs.realpathSync(firstLowerCase(__dirname + path.sep + theRequireContentB))\n      .mode,\n    fs.realpathSync(firstLowerCase(__dirname + '/' + theRequireContentB)).mode,\n    windows\n      ? fs.realpathSync(firstLowerCase(__dirname + '/\\\\' + theRequireContentB))\n          .mode\n      : '',\n    windows\n      ? fs.realpathSync(firstLowerCase(__dirname + '\\\\' + theRequireContentB))\n          .mode\n      : '',\n    windows\n      ? fs.realpathSync(firstLowerCase(__dirname + '\\\\/' + theRequireContentB))\n          .mode\n      : '',\n\n    fs.realpathSync(firstUpperCase(path.join(__dirname, theRequireContentA)))\n      .mode,\n    fs.realpathSync(firstUpperCase(__dirname + path.sep + theRequireContentB))\n      .mode,\n    fs.realpathSync(firstUpperCase(__dirname + '/' + theRequireContentB)).mode,\n    windows\n      ? fs.realpathSync(firstUpperCase(__dirname + '/\\\\' + theRequireContentB))\n          .mode\n      : '',\n    windows\n      ? fs.realpathSync(firstUpperCase(__dirname + '\\\\' + theRequireContentB))\n          .mode\n      : '',\n    windows\n      ? fs.realpathSync(firstUpperCase(__dirname + '\\\\/' + theRequireContentB))\n          .mode\n      : '',\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer/test-x2-index.js",
    "content": "/* eslint-disable brace-style */\n/* eslint-disable complexity */\n/* eslint-disable no-path-concat */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar assert = require('assert');\nvar theRequireContentA = './test-z-asset-A.css';\nvar theRequireContentB = 'test-z-asset-B.css';\n\nfunction firstLowerCase(s) {\n  return s.slice(0, 1).toLowerCase() + s.slice(1);\n}\n\nfunction firstUpperCase(s) {\n  return s.slice(0, 1).toUpperCase() + s.slice(1);\n}\n\n// ///////////////////////////////////////////////////////////////////////////\n\nfs.readFile(path.join(__dirname, theRequireContentA), function (e01, v01) {\n  fs.readFile(__dirname + path.sep + theRequireContentB, function (e02, v02) {\n    fs.readFile(__dirname + '/' + theRequireContentB, function (e03, v03) {\n      fs.readFile(\n        firstLowerCase(path.join(__dirname, theRequireContentA)),\n        function (e04, v04) {\n          fs.readFile(\n            firstLowerCase(__dirname + path.sep + theRequireContentB),\n            function (e05, v05) {\n              fs.readFile(\n                firstLowerCase(__dirname + '/' + theRequireContentB),\n                function (e06, v06) {\n                  fs.readFile(\n                    firstUpperCase(path.join(__dirname, theRequireContentA)),\n                    function (e07, v07) {\n                      fs.readFile(\n                        firstUpperCase(\n                          __dirname + path.sep + theRequireContentB\n                        ),\n                        function (e08, v08) {\n                          fs.readFile(\n                            firstUpperCase(\n                              __dirname + '/' + theRequireContentB\n                            ),\n                            function (e09, v09) {\n                              //\n\n                              fs.readFile(\n                                path.join(__dirname, theRequireContentA),\n                                { encoding: 'utf8' },\n                                function (e01a, v01a) {\n                                  fs.readFile(\n                                    __dirname + path.sep + theRequireContentB,\n                                    { encoding: 'utf8' },\n                                    function (e02a, v02a) {\n                                      fs.readFile(\n                                        __dirname + '/' + theRequireContentB,\n                                        { encoding: 'utf8' },\n                                        function (e03a, v03a) {\n                                          fs.readFile(\n                                            firstLowerCase(\n                                              path.join(\n                                                __dirname,\n                                                theRequireContentA\n                                              )\n                                            ),\n                                            { encoding: 'utf8' },\n                                            function (e04a, v04a) {\n                                              fs.readFile(\n                                                firstLowerCase(\n                                                  __dirname +\n                                                    path.sep +\n                                                    theRequireContentB\n                                                ),\n                                                { encoding: 'utf8' },\n                                                function (e05a, v05a) {\n                                                  fs.readFile(\n                                                    firstLowerCase(\n                                                      __dirname +\n                                                        '/' +\n                                                        theRequireContentB\n                                                    ),\n                                                    { encoding: 'utf8' },\n                                                    function (e06a, v06a) {\n                                                      fs.readFile(\n                                                        firstUpperCase(\n                                                          path.join(\n                                                            __dirname,\n                                                            theRequireContentA\n                                                          )\n                                                        ),\n                                                        { encoding: 'utf8' },\n                                                        function (e07a, v07a) {\n                                                          fs.readFile(\n                                                            firstUpperCase(\n                                                              __dirname +\n                                                                path.sep +\n                                                                theRequireContentB\n                                                            ),\n                                                            {\n                                                              encoding: 'utf8',\n                                                            },\n                                                            function (\n                                                              e08a,\n                                                              v08a\n                                                            ) {\n                                                              fs.readFile(\n                                                                firstUpperCase(\n                                                                  __dirname +\n                                                                    '/' +\n                                                                    theRequireContentB\n                                                                ),\n                                                                {\n                                                                  encoding:\n                                                                    'utf8',\n                                                                },\n                                                                function (\n                                                                  e09a,\n                                                                  v09a\n                                                                ) {\n                                                                  //\n\n                                                                  fs.readFile(\n                                                                    path.join(\n                                                                      __dirname,\n                                                                      theRequireContentA +\n                                                                        '-no-such'\n                                                                    ),\n                                                                    function (\n                                                                      e10,\n                                                                      v10\n                                                                    ) {\n                                                                      fs.readFile(\n                                                                        __dirname +\n                                                                          path.sep +\n                                                                          theRequireContentB +\n                                                                          '-no-such',\n                                                                        function (\n                                                                          e11,\n                                                                          v11\n                                                                        ) {\n                                                                          fs.readFile(\n                                                                            __dirname +\n                                                                              '/' +\n                                                                              theRequireContentB +\n                                                                              '-no-such',\n                                                                            function (\n                                                                              e12,\n                                                                              v12\n                                                                            ) {\n                                                                              fs.readFile(\n                                                                                firstLowerCase(\n                                                                                  path.join(\n                                                                                    __dirname,\n                                                                                    theRequireContentA +\n                                                                                      '-no-such'\n                                                                                  )\n                                                                                ),\n                                                                                function (\n                                                                                  e13,\n                                                                                  v13\n                                                                                ) {\n                                                                                  fs.readFile(\n                                                                                    firstLowerCase(\n                                                                                      __dirname +\n                                                                                        path.sep +\n                                                                                        theRequireContentB +\n                                                                                        '-no-such'\n                                                                                    ),\n                                                                                    function (\n                                                                                      e14,\n                                                                                      v14\n                                                                                    ) {\n                                                                                      fs.readFile(\n                                                                                        firstLowerCase(\n                                                                                          __dirname +\n                                                                                            '/' +\n                                                                                            theRequireContentB +\n                                                                                            '-no-such'\n                                                                                        ),\n                                                                                        function (\n                                                                                          e15,\n                                                                                          v15\n                                                                                        ) {\n                                                                                          fs.readFile(\n                                                                                            firstUpperCase(\n                                                                                              path.join(\n                                                                                                __dirname,\n                                                                                                theRequireContentA +\n                                                                                                  '-no-such'\n                                                                                              )\n                                                                                            ),\n                                                                                            function (\n                                                                                              e16,\n                                                                                              v16\n                                                                                            ) {\n                                                                                              fs.readFile(\n                                                                                                firstUpperCase(\n                                                                                                  __dirname +\n                                                                                                    path.sep +\n                                                                                                    theRequireContentB +\n                                                                                                    '-no-such'\n                                                                                                ),\n                                                                                                function (\n                                                                                                  e17,\n                                                                                                  v17\n                                                                                                ) {\n                                                                                                  fs.readFile(\n                                                                                                    firstUpperCase(\n                                                                                                      __dirname +\n                                                                                                        '/' +\n                                                                                                        theRequireContentB +\n                                                                                                        '-no-such'\n                                                                                                    ),\n                                                                                                    function (\n                                                                                                      e18,\n                                                                                                      v18\n                                                                                                    ) {\n                                                                                                      //\n\n                                                                                                      fs.readFile(\n                                                                                                        __dirname,\n                                                                                                        function (\n                                                                                                          e19,\n                                                                                                          v19\n                                                                                                        ) {\n                                                                                                          fs.readFile(\n                                                                                                            path.dirname(\n                                                                                                              __dirname\n                                                                                                            ),\n                                                                                                            function (\n                                                                                                              e20,\n                                                                                                              v20\n                                                                                                            ) {\n                                                                                                              fs.readFile(\n                                                                                                                path.dirname(\n                                                                                                                  path.dirname(\n                                                                                                                    __dirname\n                                                                                                                  )\n                                                                                                                ),\n                                                                                                                function (\n                                                                                                                  e21,\n                                                                                                                  v21\n                                                                                                                ) {\n                                                                                                                  fs.readFile(\n                                                                                                                    firstLowerCase(\n                                                                                                                      __dirname\n                                                                                                                    ),\n                                                                                                                    function (\n                                                                                                                      e22,\n                                                                                                                      v22\n                                                                                                                    ) {\n                                                                                                                      fs.readFile(\n                                                                                                                        firstLowerCase(\n                                                                                                                          path.dirname(\n                                                                                                                            __dirname\n                                                                                                                          )\n                                                                                                                        ),\n                                                                                                                        function (\n                                                                                                                          e23,\n                                                                                                                          v23\n                                                                                                                        ) {\n                                                                                                                          fs.readFile(\n                                                                                                                            firstLowerCase(\n                                                                                                                              path.dirname(\n                                                                                                                                path.dirname(\n                                                                                                                                  __dirname\n                                                                                                                                )\n                                                                                                                              )\n                                                                                                                            ),\n                                                                                                                            function (\n                                                                                                                              e24,\n                                                                                                                              v24\n                                                                                                                            ) {\n                                                                                                                              fs.readFile(\n                                                                                                                                firstUpperCase(\n                                                                                                                                  __dirname\n                                                                                                                                ),\n                                                                                                                                function (\n                                                                                                                                  e25,\n                                                                                                                                  v25\n                                                                                                                                ) {\n                                                                                                                                  fs.readFile(\n                                                                                                                                    firstUpperCase(\n                                                                                                                                      path.dirname(\n                                                                                                                                        __dirname\n                                                                                                                                      )\n                                                                                                                                    ),\n                                                                                                                                    function (\n                                                                                                                                      e26,\n                                                                                                                                      v26\n                                                                                                                                    ) {\n                                                                                                                                      fs.readFile(\n                                                                                                                                        firstUpperCase(\n                                                                                                                                          path.dirname(\n                                                                                                                                            path.dirname(\n                                                                                                                                              __dirname\n                                                                                                                                            )\n                                                                                                                                          )\n                                                                                                                                        ),\n                                                                                                                                        function (\n                                                                                                                                          e27,\n                                                                                                                                          v27\n                                                                                                                                        ) {\n                                                                                                                                          //\n\n                                                                                                                                          fs.open(\n                                                                                                                                            path.join(\n                                                                                                                                              __dirname,\n                                                                                                                                              theRequireContentA\n                                                                                                                                            ),\n                                                                                                                                            'r',\n                                                                                                                                            function (\n                                                                                                                                              e28,\n                                                                                                                                              v28\n                                                                                                                                            ) {\n                                                                                                                                              fs.open(\n                                                                                                                                                __dirname +\n                                                                                                                                                  path.sep +\n                                                                                                                                                  theRequireContentB,\n                                                                                                                                                'r',\n                                                                                                                                                function (\n                                                                                                                                                  e29,\n                                                                                                                                                  v29\n                                                                                                                                                ) {\n                                                                                                                                                  fs.open(\n                                                                                                                                                    __dirname +\n                                                                                                                                                      '/' +\n                                                                                                                                                      theRequireContentB,\n                                                                                                                                                    'r',\n                                                                                                                                                    function (\n                                                                                                                                                      e30,\n                                                                                                                                                      v30\n                                                                                                                                                    ) {\n                                                                                                                                                      fs.open(\n                                                                                                                                                        firstLowerCase(\n                                                                                                                                                          path.join(\n                                                                                                                                                            __dirname,\n                                                                                                                                                            theRequireContentA\n                                                                                                                                                          )\n                                                                                                                                                        ),\n                                                                                                                                                        'r',\n                                                                                                                                                        function (\n                                                                                                                                                          e31,\n                                                                                                                                                          v31\n                                                                                                                                                        ) {\n                                                                                                                                                          fs.open(\n                                                                                                                                                            firstLowerCase(\n                                                                                                                                                              __dirname +\n                                                                                                                                                                path.sep +\n                                                                                                                                                                theRequireContentB\n                                                                                                                                                            ),\n                                                                                                                                                            'r',\n                                                                                                                                                            function (\n                                                                                                                                                              e32,\n                                                                                                                                                              v32\n                                                                                                                                                            ) {\n                                                                                                                                                              fs.open(\n                                                                                                                                                                firstLowerCase(\n                                                                                                                                                                  __dirname +\n                                                                                                                                                                    '/' +\n                                                                                                                                                                    theRequireContentB\n                                                                                                                                                                ),\n                                                                                                                                                                'r',\n                                                                                                                                                                function (\n                                                                                                                                                                  e33,\n                                                                                                                                                                  v33\n                                                                                                                                                                ) {\n                                                                                                                                                                  fs.open(\n                                                                                                                                                                    firstUpperCase(\n                                                                                                                                                                      path.join(\n                                                                                                                                                                        __dirname,\n                                                                                                                                                                        theRequireContentA\n                                                                                                                                                                      )\n                                                                                                                                                                    ),\n                                                                                                                                                                    'r',\n                                                                                                                                                                    function (\n                                                                                                                                                                      e34,\n                                                                                                                                                                      v34\n                                                                                                                                                                    ) {\n                                                                                                                                                                      fs.open(\n                                                                                                                                                                        firstUpperCase(\n                                                                                                                                                                          __dirname +\n                                                                                                                                                                            path.sep +\n                                                                                                                                                                            theRequireContentB\n                                                                                                                                                                        ),\n                                                                                                                                                                        'r',\n                                                                                                                                                                        function (\n                                                                                                                                                                          e35,\n                                                                                                                                                                          v35\n                                                                                                                                                                        ) {\n                                                                                                                                                                          fs.open(\n                                                                                                                                                                            firstUpperCase(\n                                                                                                                                                                              __dirname +\n                                                                                                                                                                                '/' +\n                                                                                                                                                                                theRequireContentB\n                                                                                                                                                                            ),\n                                                                                                                                                                            'r',\n                                                                                                                                                                            function (\n                                                                                                                                                                              e36,\n                                                                                                                                                                              v36\n                                                                                                                                                                            ) {\n                                                                                                                                                                              //\n\n                                                                                                                                                                              fs.open(\n                                                                                                                                                                                path.join(\n                                                                                                                                                                                  __dirname,\n                                                                                                                                                                                  theRequireContentA +\n                                                                                                                                                                                    '-no-such'\n                                                                                                                                                                                ),\n                                                                                                                                                                                'r',\n                                                                                                                                                                                function (\n                                                                                                                                                                                  e37,\n                                                                                                                                                                                  v37\n                                                                                                                                                                                ) {\n                                                                                                                                                                                  fs.open(\n                                                                                                                                                                                    __dirname +\n                                                                                                                                                                                      path.sep +\n                                                                                                                                                                                      theRequireContentB +\n                                                                                                                                                                                      '-no-such',\n                                                                                                                                                                                    'r',\n                                                                                                                                                                                    function (\n                                                                                                                                                                                      e38,\n                                                                                                                                                                                      v38\n                                                                                                                                                                                    ) {\n                                                                                                                                                                                      fs.open(\n                                                                                                                                                                                        __dirname +\n                                                                                                                                                                                          '/' +\n                                                                                                                                                                                          theRequireContentB +\n                                                                                                                                                                                          '-no-such',\n                                                                                                                                                                                        'r',\n                                                                                                                                                                                        function (\n                                                                                                                                                                                          e39,\n                                                                                                                                                                                          v39\n                                                                                                                                                                                        ) {\n                                                                                                                                                                                          fs.open(\n                                                                                                                                                                                            firstLowerCase(\n                                                                                                                                                                                              path.join(\n                                                                                                                                                                                                __dirname,\n                                                                                                                                                                                                theRequireContentA +\n                                                                                                                                                                                                  '-no-such'\n                                                                                                                                                                                              )\n                                                                                                                                                                                            ),\n                                                                                                                                                                                            'r',\n                                                                                                                                                                                            function (\n                                                                                                                                                                                              e40,\n                                                                                                                                                                                              v40\n                                                                                                                                                                                            ) {\n                                                                                                                                                                                              fs.open(\n                                                                                                                                                                                                firstLowerCase(\n                                                                                                                                                                                                  __dirname +\n                                                                                                                                                                                                    path.sep +\n                                                                                                                                                                                                    theRequireContentB +\n                                                                                                                                                                                                    '-no-such'\n                                                                                                                                                                                                ),\n                                                                                                                                                                                                'r',\n                                                                                                                                                                                                function (\n                                                                                                                                                                                                  e41,\n                                                                                                                                                                                                  v41\n                                                                                                                                                                                                ) {\n                                                                                                                                                                                                  fs.open(\n                                                                                                                                                                                                    firstLowerCase(\n                                                                                                                                                                                                      __dirname +\n                                                                                                                                                                                                        '/' +\n                                                                                                                                                                                                        theRequireContentB +\n                                                                                                                                                                                                        '-no-such'\n                                                                                                                                                                                                    ),\n                                                                                                                                                                                                    'r',\n                                                                                                                                                                                                    function (\n                                                                                                                                                                                                      e42,\n                                                                                                                                                                                                      v42\n                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                      fs.open(\n                                                                                                                                                                                                        firstUpperCase(\n                                                                                                                                                                                                          path.join(\n                                                                                                                                                                                                            __dirname,\n                                                                                                                                                                                                            theRequireContentA +\n                                                                                                                                                                                                              '-no-such'\n                                                                                                                                                                                                          )\n                                                                                                                                                                                                        ),\n                                                                                                                                                                                                        'r',\n                                                                                                                                                                                                        function (\n                                                                                                                                                                                                          e43,\n                                                                                                                                                                                                          v43\n                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                          fs.open(\n                                                                                                                                                                                                            firstUpperCase(\n                                                                                                                                                                                                              __dirname +\n                                                                                                                                                                                                                path.sep +\n                                                                                                                                                                                                                theRequireContentB +\n                                                                                                                                                                                                                '-no-such'\n                                                                                                                                                                                                            ),\n                                                                                                                                                                                                            'r',\n                                                                                                                                                                                                            function (\n                                                                                                                                                                                                              e44,\n                                                                                                                                                                                                              v44\n                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                              fs.open(\n                                                                                                                                                                                                                firstUpperCase(\n                                                                                                                                                                                                                  __dirname +\n                                                                                                                                                                                                                    '/' +\n                                                                                                                                                                                                                    theRequireContentB +\n                                                                                                                                                                                                                    '-no-such'\n                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                'r',\n                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                  e45,\n                                                                                                                                                                                                                  v45\n                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                  //\n\n                                                                                                                                                                                                                  fs.open(\n                                                                                                                                                                                                                    __dirname,\n                                                                                                                                                                                                                    'r',\n                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                      e46,\n                                                                                                                                                                                                                      v46\n                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                      fs.open(\n                                                                                                                                                                                                                        path.dirname(\n                                                                                                                                                                                                                          __dirname\n                                                                                                                                                                                                                        ),\n                                                                                                                                                                                                                        'r',\n                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                          e47,\n                                                                                                                                                                                                                          v47\n                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                          fs.open(\n                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                              __dirname\n                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                            'r',\n                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                              e48,\n                                                                                                                                                                                                                              v48\n                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                              // not \"path.dirname(path.dirname\" due to denominator\n                                                                                                                                                                                                                              fs.open(\n                                                                                                                                                                                                                                firstLowerCase(\n                                                                                                                                                                                                                                  __dirname\n                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                'r',\n                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                  e49,\n                                                                                                                                                                                                                                  v49\n                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                  fs.open(\n                                                                                                                                                                                                                                    firstLowerCase(\n                                                                                                                                                                                                                                      path.dirname(\n                                                                                                                                                                                                                                        __dirname\n                                                                                                                                                                                                                                      )\n                                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                                    'r',\n                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                      e50,\n                                                                                                                                                                                                                                      v50\n                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                      fs.open(\n                                                                                                                                                                                                                                        firstLowerCase(\n                                                                                                                                                                                                                                          path.dirname(\n                                                                                                                                                                                                                                            __dirname\n                                                                                                                                                                                                                                          )\n                                                                                                                                                                                                                                        ),\n                                                                                                                                                                                                                                        'r',\n                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                          e51,\n                                                                                                                                                                                                                                          v51\n                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                          // not \"path.dirname(path.dirname\" due to denominator\n                                                                                                                                                                                                                                          fs.open(\n                                                                                                                                                                                                                                            firstUpperCase(\n                                                                                                                                                                                                                                              __dirname\n                                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                                            'r',\n                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                              e52,\n                                                                                                                                                                                                                                              v52\n                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                              fs.open(\n                                                                                                                                                                                                                                                firstUpperCase(\n                                                                                                                                                                                                                                                  path.dirname(\n                                                                                                                                                                                                                                                    __dirname\n                                                                                                                                                                                                                                                  )\n                                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                                'r',\n                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                  e53,\n                                                                                                                                                                                                                                                  v53\n                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                  fs.open(\n                                                                                                                                                                                                                                                    firstUpperCase(\n                                                                                                                                                                                                                                                      path.dirname(\n                                                                                                                                                                                                                                                        __dirname\n                                                                                                                                                                                                                                                      )\n                                                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                                                    'r',\n                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                      e54,\n                                                                                                                                                                                                                                                      v54\n                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                      // not \"path.dirname(path.dirname\" due to denominator\n                                                                                                                                                                                                                                                      //\n\n                                                                                                                                                                                                                                                      fs.readdir(\n                                                                                                                                                                                                                                                        __dirname,\n                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                          e55,\n                                                                                                                                                                                                                                                          v55\n                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                          fs.readdir(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              __dirname\n                                                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                              e56,\n                                                                                                                                                                                                                                                              v56\n                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                              fs.readdir(\n                                                                                                                                                                                                                                                                path.dirname(\n                                                                                                                                                                                                                                                                  path.dirname(\n                                                                                                                                                                                                                                                                    __dirname\n                                                                                                                                                                                                                                                                  )\n                                                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                  e57,\n                                                                                                                                                                                                                                                                  v57\n                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                  fs.readdir(\n                                                                                                                                                                                                                                                                    firstLowerCase(\n                                                                                                                                                                                                                                                                      __dirname\n                                                                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                      e58,\n                                                                                                                                                                                                                                                                      v58\n                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                      fs.readdir(\n                                                                                                                                                                                                                                                                        firstLowerCase(\n                                                                                                                                                                                                                                                                          path.dirname(\n                                                                                                                                                                                                                                                                            __dirname\n                                                                                                                                                                                                                                                                          )\n                                                                                                                                                                                                                                                                        ),\n                                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                                          e59,\n                                                                                                                                                                                                                                                                          v59\n                                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                                          fs.readdir(\n                                                                                                                                                                                                                                                                            firstLowerCase(\n                                                                                                                                                                                                                                                                              path.dirname(\n                                                                                                                                                                                                                                                                                path.dirname(\n                                                                                                                                                                                                                                                                                  __dirname\n                                                                                                                                                                                                                                                                                )\n                                                                                                                                                                                                                                                                              )\n                                                                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                                              e60,\n                                                                                                                                                                                                                                                                              v60\n                                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                                              fs.readdir(\n                                                                                                                                                                                                                                                                                firstUpperCase(\n                                                                                                                                                                                                                                                                                  __dirname\n                                                                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                                  e61,\n                                                                                                                                                                                                                                                                                  v61\n                                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                                  fs.readdir(\n                                                                                                                                                                                                                                                                                    firstUpperCase(\n                                                                                                                                                                                                                                                                                      path.dirname(\n                                                                                                                                                                                                                                                                                        __dirname\n                                                                                                                                                                                                                                                                                      )\n                                                                                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                                      e62,\n                                                                                                                                                                                                                                                                                      v62\n                                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                                      fs.readdir(\n                                                                                                                                                                                                                                                                                        firstUpperCase(\n                                                                                                                                                                                                                                                                                          path.dirname(\n                                                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                                                              __dirname\n                                                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                                                          )\n                                                                                                                                                                                                                                                                                        ),\n                                                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                                                          e63,\n                                                                                                                                                                                                                                                                                          v63\n                                                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                                                          //\n\n                                                                                                                                                                                                                                                                                          fs.readdir(\n                                                                                                                                                                                                                                                                                            __dirname +\n                                                                                                                                                                                                                                                                                              '-no-such',\n                                                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                                                              e64,\n                                                                                                                                                                                                                                                                                              v64\n                                                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                                                              fs.readdir(\n                                                                                                                                                                                                                                                                                                path.dirname(\n                                                                                                                                                                                                                                                                                                  __dirname\n                                                                                                                                                                                                                                                                                                ) +\n                                                                                                                                                                                                                                                                                                  '-no-such',\n                                                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                                                  e65,\n                                                                                                                                                                                                                                                                                                  v65\n                                                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                                                  fs.readdir(\n                                                                                                                                                                                                                                                                                                    path.dirname(\n                                                                                                                                                                                                                                                                                                      path.dirname(\n                                                                                                                                                                                                                                                                                                        __dirname\n                                                                                                                                                                                                                                                                                                      )\n                                                                                                                                                                                                                                                                                                    ) +\n                                                                                                                                                                                                                                                                                                      '-no-such',\n                                                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                                                      e66,\n                                                                                                                                                                                                                                                                                                      v66\n                                                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                                                      fs.readdir(\n                                                                                                                                                                                                                                                                                                        firstLowerCase(\n                                                                                                                                                                                                                                                                                                          __dirname +\n                                                                                                                                                                                                                                                                                                            '-no-such'\n                                                                                                                                                                                                                                                                                                        ),\n                                                                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                                                                          e67,\n                                                                                                                                                                                                                                                                                                          v67\n                                                                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                                                                          fs.readdir(\n                                                                                                                                                                                                                                                                                                            firstLowerCase(\n                                                                                                                                                                                                                                                                                                              path.dirname(\n                                                                                                                                                                                                                                                                                                                __dirname\n                                                                                                                                                                                                                                                                                                              ) +\n                                                                                                                                                                                                                                                                                                                '-no-such'\n                                                                                                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                                                                              e68,\n                                                                                                                                                                                                                                                                                                              v68\n                                                                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                                                                              fs.readdir(\n                                                                                                                                                                                                                                                                                                                firstLowerCase(\n                                                                                                                                                                                                                                                                                                                  path.dirname(\n                                                                                                                                                                                                                                                                                                                    path.dirname(\n                                                                                                                                                                                                                                                                                                                      __dirname\n                                                                                                                                                                                                                                                                                                                    )\n                                                                                                                                                                                                                                                                                                                  ) +\n                                                                                                                                                                                                                                                                                                                    '-no-such'\n                                                                                                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                                                                  e69,\n                                                                                                                                                                                                                                                                                                                  v69\n                                                                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                                                                  fs.readdir(\n                                                                                                                                                                                                                                                                                                                    firstUpperCase(\n                                                                                                                                                                                                                                                                                                                      __dirname +\n                                                                                                                                                                                                                                                                                                                        '-no-such'\n                                                                                                                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                                                                      e70,\n                                                                                                                                                                                                                                                                                                                      v70\n                                                                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                                                                      fs.readdir(\n                                                                                                                                                                                                                                                                                                                        firstUpperCase(\n                                                                                                                                                                                                                                                                                                                          path.dirname(\n                                                                                                                                                                                                                                                                                                                            __dirname\n                                                                                                                                                                                                                                                                                                                          ) +\n                                                                                                                                                                                                                                                                                                                            '-no-such'\n                                                                                                                                                                                                                                                                                                                        ),\n                                                                                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                                                                                          e71,\n                                                                                                                                                                                                                                                                                                                          v71\n                                                                                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                                                                                          fs.readdir(\n                                                                                                                                                                                                                                                                                                                            firstUpperCase(\n                                                                                                                                                                                                                                                                                                                              path.dirname(\n                                                                                                                                                                                                                                                                                                                                path.dirname(\n                                                                                                                                                                                                                                                                                                                                  __dirname\n                                                                                                                                                                                                                                                                                                                                )\n                                                                                                                                                                                                                                                                                                                              ) +\n                                                                                                                                                                                                                                                                                                                                '-no-such'\n                                                                                                                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                                                                                              e72,\n                                                                                                                                                                                                                                                                                                                              v72\n                                                                                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                                                                                              //\n\n                                                                                                                                                                                                                                                                                                                              fs.readdir(\n                                                                                                                                                                                                                                                                                                                                path.join(\n                                                                                                                                                                                                                                                                                                                                  __dirname,\n                                                                                                                                                                                                                                                                                                                                  theRequireContentA\n                                                                                                                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                                                                                  e73,\n                                                                                                                                                                                                                                                                                                                                  v73\n                                                                                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                                                                                  fs.readdir(\n                                                                                                                                                                                                                                                                                                                                    __dirname +\n                                                                                                                                                                                                                                                                                                                                      path.sep +\n                                                                                                                                                                                                                                                                                                                                      theRequireContentB,\n                                                                                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                                                                                      e74,\n                                                                                                                                                                                                                                                                                                                                      v74\n                                                                                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                                                                                      fs.readdir(\n                                                                                                                                                                                                                                                                                                                                        __dirname +\n                                                                                                                                                                                                                                                                                                                                          '/' +\n                                                                                                                                                                                                                                                                                                                                          theRequireContentB,\n                                                                                                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                                                                                                          e75,\n                                                                                                                                                                                                                                                                                                                                          v75\n                                                                                                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                                                                                                          fs.readdir(\n                                                                                                                                                                                                                                                                                                                                            firstLowerCase(\n                                                                                                                                                                                                                                                                                                                                              path.join(\n                                                                                                                                                                                                                                                                                                                                                __dirname,\n                                                                                                                                                                                                                                                                                                                                                theRequireContentA\n                                                                                                                                                                                                                                                                                                                                              )\n                                                                                                                                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                                                                                                              e76,\n                                                                                                                                                                                                                                                                                                                                              v76\n                                                                                                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                                                                                                              fs.readdir(\n                                                                                                                                                                                                                                                                                                                                                firstLowerCase(\n                                                                                                                                                                                                                                                                                                                                                  __dirname +\n                                                                                                                                                                                                                                                                                                                                                    path.sep +\n                                                                                                                                                                                                                                                                                                                                                    theRequireContentB\n                                                                                                                                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                                                                                                  e77,\n                                                                                                                                                                                                                                                                                                                                                  v77\n                                                                                                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                                                                                                  fs.readdir(\n                                                                                                                                                                                                                                                                                                                                                    firstLowerCase(\n                                                                                                                                                                                                                                                                                                                                                      __dirname +\n                                                                                                                                                                                                                                                                                                                                                        '/' +\n                                                                                                                                                                                                                                                                                                                                                        theRequireContentB\n                                                                                                                                                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                                                                                                      e78,\n                                                                                                                                                                                                                                                                                                                                                      v78\n                                                                                                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                                                                                                      fs.readdir(\n                                                                                                                                                                                                                                                                                                                                                        firstUpperCase(\n                                                                                                                                                                                                                                                                                                                                                          path.join(\n                                                                                                                                                                                                                                                                                                                                                            __dirname,\n                                                                                                                                                                                                                                                                                                                                                            theRequireContentA\n                                                                                                                                                                                                                                                                                                                                                          )\n                                                                                                                                                                                                                                                                                                                                                        ),\n                                                                                                                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                                                                                                                          e79,\n                                                                                                                                                                                                                                                                                                                                                          v79\n                                                                                                                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                                                                                                                          fs.readdir(\n                                                                                                                                                                                                                                                                                                                                                            firstUpperCase(\n                                                                                                                                                                                                                                                                                                                                                              __dirname +\n                                                                                                                                                                                                                                                                                                                                                                path.sep +\n                                                                                                                                                                                                                                                                                                                                                                theRequireContentB\n                                                                                                                                                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                                                                                                                              e80,\n                                                                                                                                                                                                                                                                                                                                                              v80\n                                                                                                                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                                                                                                                              fs.readdir(\n                                                                                                                                                                                                                                                                                                                                                                firstUpperCase(\n                                                                                                                                                                                                                                                                                                                                                                  __dirname +\n                                                                                                                                                                                                                                                                                                                                                                    '/' +\n                                                                                                                                                                                                                                                                                                                                                                    theRequireContentB\n                                                                                                                                                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                                                                                                                  e81,\n                                                                                                                                                                                                                                                                                                                                                                  v81\n                                                                                                                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                                                                                                                  //\n\n                                                                                                                                                                                                                                                                                                                                                                  fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                    v28,\n                                                                                                                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                                                                                                                      e136,\n                                                                                                                                                                                                                                                                                                                                                                      v136\n                                                                                                                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                                                                                                                      fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                        v29,\n                                                                                                                                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                                                                                                                                          e137,\n                                                                                                                                                                                                                                                                                                                                                                          v137\n                                                                                                                                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                                                                                                                                          fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                            v30,\n                                                                                                                                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                                                                                                                                              e138,\n                                                                                                                                                                                                                                                                                                                                                                              v138\n                                                                                                                                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                                                                                                                                              fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                                v46,\n                                                                                                                                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                                                                                                                                  e139,\n                                                                                                                                                                                                                                                                                                                                                                                  v139\n                                                                                                                                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                                                                                                                                  fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                                    v47,\n                                                                                                                                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                                                                                                                                      e140,\n                                                                                                                                                                                                                                                                                                                                                                                      v140\n                                                                                                                                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                                                                                                                                      fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                                        v48,\n                                                                                                                                                                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                                                                                                                                                                          e141,\n                                                                                                                                                                                                                                                                                                                                                                                          v141\n                                                                                                                                                                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                                                                                                                                                                          fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                                            v49,\n                                                                                                                                                                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                                                                                                                                                                              e142,\n                                                                                                                                                                                                                                                                                                                                                                                              v142\n                                                                                                                                                                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                                                                                                                                                                              fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                                                v50,\n                                                                                                                                                                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                                                                                                                                                                  e143,\n                                                                                                                                                                                                                                                                                                                                                                                                  v143\n                                                                                                                                                                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                                                                                                                                                                  fs.fstat(\n                                                                                                                                                                                                                                                                                                                                                                                                    v51,\n                                                                                                                                                                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                                                                                                                                                                      e144,\n                                                                                                                                                                                                                                                                                                                                                                                                      v144\n                                                                                                                                                                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                                                                                                                                                                      console.log(\n                                                                                                                                                                                                                                                                                                                                                                                                        [\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'readFile',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e01 ===\n                                                                                                                                                                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e01 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v01.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e02 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v02.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e03 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v03.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e04 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v04.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e05 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v05.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e06 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v06.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e07 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v07.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e08 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v08.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e09 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v09.length,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'readFile',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e01a ===\n                                                                                                                                                                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e01a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v01a.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e02a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v02a.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e03a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v03a.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e04a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v04a.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e05a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v05a.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e06a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v06a.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e07a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v07a.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e08a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v08a.length,\n                                                                                                                                                                                                                                                                                                                                                                                                          e09a ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v09a.length,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'readFile-no-such',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e10.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                              -4058 ||\n                                                                                                                                                                                                                                                                                                                                                                                                              e10.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                                -2\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e10.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e10.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v10 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e11.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e11.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v11 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e12.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e12.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v12 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e13.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e13.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v13 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e14.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e14.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v14 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e15.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e15.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v15 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e16.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e16.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v16 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e17.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e17.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v17 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e18.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e18.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v18 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'readFile-directory',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            !e19 ||\n                                                                                                                                                                                                                                                                                                                                                                                                              e19.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                                -4068 ||\n                                                                                                                                                                                                                                                                                                                                                                                                              e19.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                                -21\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          !e19 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e19.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e19 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e19.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v19 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e20 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e20.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e20 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e20.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v20 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e21 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e21.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e21 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e21.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v21 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e22 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e22.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e22 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e22.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v22 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e23 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e23.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e23 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e23.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v23 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e24 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e24.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e24 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e24.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v24 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e25 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e25.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e25 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e25.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v25 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e26 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e26.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e26 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e26.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v26 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e27 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e27.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          !e27 ||\n                                                                                                                                                                                                                                                                                                                                                                                                            e27.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v27 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'open',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e28 ===\n                                                                                                                                                                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e28 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v28,\n                                                                                                                                                                                                                                                                                                                                                                                                          e29 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v29,\n                                                                                                                                                                                                                                                                                                                                                                                                          e30 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v30,\n                                                                                                                                                                                                                                                                                                                                                                                                          e31 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v31,\n                                                                                                                                                                                                                                                                                                                                                                                                          e32 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v32,\n                                                                                                                                                                                                                                                                                                                                                                                                          e33 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v33,\n                                                                                                                                                                                                                                                                                                                                                                                                          e34 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v34,\n                                                                                                                                                                                                                                                                                                                                                                                                          e35 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v35,\n                                                                                                                                                                                                                                                                                                                                                                                                          e36 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v36,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'open-no-such',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e37.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                              -4058 ||\n                                                                                                                                                                                                                                                                                                                                                                                                              e37.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                                -2\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e37.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e37.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v37 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e38.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e38.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v38 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e39.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e39.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v39 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e40.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e40.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v40 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e41.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e41.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v41 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e42.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e42.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v42 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e43.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e43.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v43 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e44.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e44.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v44 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e45.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e45.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v45 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'open-directory',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e46 ===\n                                                                                                                                                                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e46 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v46,\n                                                                                                                                                                                                                                                                                                                                                                                                          e47 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v47,\n                                                                                                                                                                                                                                                                                                                                                                                                          e48 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v48,\n                                                                                                                                                                                                                                                                                                                                                                                                          e49 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v49,\n                                                                                                                                                                                                                                                                                                                                                                                                          e50 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v50,\n                                                                                                                                                                                                                                                                                                                                                                                                          e51 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v51,\n                                                                                                                                                                                                                                                                                                                                                                                                          e52 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v52,\n                                                                                                                                                                                                                                                                                                                                                                                                          e53 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v53,\n                                                                                                                                                                                                                                                                                                                                                                                                          e54 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          typeof v54,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'readdir',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e55 ===\n                                                                                                                                                                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            v55.length >\n                                                                                                                                                                                                                                                                                                                                                                                                              0\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e55 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v55.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n                                                                                                                                                                                                                                                                                                                                                                                                          e56 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v56.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n                                                                                                                                                                                                                                                                                                                                                                                                          e57 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v57.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n                                                                                                                                                                                                                                                                                                                                                                                                          e58 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v58.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n                                                                                                                                                                                                                                                                                                                                                                                                          e59 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v59.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n                                                                                                                                                                                                                                                                                                                                                                                                          e60 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v60.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n                                                                                                                                                                                                                                                                                                                                                                                                          e61 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v61.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n                                                                                                                                                                                                                                                                                                                                                                                                          e62 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v62.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n                                                                                                                                                                                                                                                                                                                                                                                                          e63 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v63.length >\n                                                                                                                                                                                                                                                                                                                                                                                                            0,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'readdir-no-such',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e64.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                              -4058 ||\n                                                                                                                                                                                                                                                                                                                                                                                                              e64.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                                -2\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e64.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e64.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v64 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e65.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e65.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v65 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e66.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e66.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v66 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e67.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e67.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v67 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e68.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e68.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v68 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e69.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e69.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v69 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e70.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e70.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v70 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e71.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e71.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v71 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e72.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e72.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v72 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'readdir-file',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e73.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                              -4052 ||\n                                                                                                                                                                                                                                                                                                                                                                                                              e73.errno ===\n                                                                                                                                                                                                                                                                                                                                                                                                                -20\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e73.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e73.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v73 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e74.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e74.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v74 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e75.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e75.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v75 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e76.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e76.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v76 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e77.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e77.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v77 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e78.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e78.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v78 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e79.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e79.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v79 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e80.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e80.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v80 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                                                                                                                                                                          e81.errno,\n                                                                                                                                                                                                                                                                                                                                                                                                          e81.code,\n                                                                                                                                                                                                                                                                                                                                                                                                          v81 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            undefined,\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                                                                                                                                                                          'fstat',\n                                                                                                                                                                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                                                                                                                                                                            e136 ===\n                                                                                                                                                                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                                                                                                                                                                          e136 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v136.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v136.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v136.isDirectory(),\n                                                                                                                                                                                                                                                                                                                                                                                                          e137 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v137.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v137.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v137.isDirectory(),\n                                                                                                                                                                                                                                                                                                                                                                                                          e138 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v138.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v138.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v138.isDirectory(),\n                                                                                                                                                                                                                                                                                                                                                                                                          e139 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v139.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v139.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v139.isDirectory(),\n                                                                                                                                                                                                                                                                                                                                                                                                          e140 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v140.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v140.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v140.isDirectory(),\n                                                                                                                                                                                                                                                                                                                                                                                                          e141 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v141.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v141.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v141.isDirectory(),\n                                                                                                                                                                                                                                                                                                                                                                                                          e142 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v142.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v142.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v142.isDirectory(),\n                                                                                                                                                                                                                                                                                                                                                                                                          e143 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v143.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v143.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v143.isDirectory(),\n                                                                                                                                                                                                                                                                                                                                                                                                          e144 ===\n                                                                                                                                                                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                                                                                                                                                                          v144.mode,\n                                                                                                                                                                                                                                                                                                                                                                                                          v144.isFile(),\n                                                                                                                                                                                                                                                                                                                                                                                                          v144.isDirectory(),\n\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                                                                                                                                                                        ].join(\n                                                                                                                                                                                                                                                                                                                                                                                                          '\\n'\n                                                                                                                                                                                                                                                                                                                                                                                                        )\n                                                                                                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                }\n                                                                                                                                                                                                              );\n                                                                                                                                                                                                            }\n                                                                                                                                                                                                          );\n                                                                                                                                                                                                        }\n                                                                                                                                                                                                      );\n                                                                                                                                                                                                    }\n                                                                                                                                                                                                  );\n                                                                                                                                                                                                }\n                                                                                                                                                                                              );\n                                                                                                                                                                                            }\n                                                                                                                                                                                          );\n                                                                                                                                                                                        }\n                                                                                                                                                                                      );\n                                                                                                                                                                                    }\n                                                                                                                                                                                  );\n                                                                                                                                                                                }\n                                                                                                                                                                              );\n                                                                                                                                                                            }\n                                                                                                                                                                          );\n                                                                                                                                                                        }\n                                                                                                                                                                      );\n                                                                                                                                                                    }\n                                                                                                                                                                  );\n                                                                                                                                                                }\n                                                                                                                                                              );\n                                                                                                                                                            }\n                                                                                                                                                          );\n                                                                                                                                                        }\n                                                                                                                                                      );\n                                                                                                                                                    }\n                                                                                                                                                  );\n                                                                                                                                                }\n                                                                                                                                              );\n                                                                                                                                            }\n                                                                                                                                          );\n                                                                                                                                        }\n                                                                                                                                      );\n                                                                                                                                    }\n                                                                                                                                  );\n                                                                                                                                }\n                                                                                                                              );\n                                                                                                                            }\n                                                                                                                          );\n                                                                                                                        }\n                                                                                                                      );\n                                                                                                                    }\n                                                                                                                  );\n                                                                                                                }\n                                                                                                              );\n                                                                                                            }\n                                                                                                          );\n                                                                                                        }\n                                                                                                      );\n                                                                                                    }\n                                                                                                  );\n                                                                                                }\n                                                                                              );\n                                                                                            }\n                                                                                          );\n                                                                                        }\n                                                                                      );\n                                                                                    }\n                                                                                  );\n                                                                                }\n                                                                              );\n                                                                            }\n                                                                          );\n                                                                        }\n                                                                      );\n                                                                    }\n                                                                  );\n                                                                }\n                                                              );\n                                                            }\n                                                          );\n                                                        }\n                                                      );\n                                                    }\n                                                  );\n                                                }\n                                              );\n                                            }\n                                          );\n                                        }\n                                      );\n                                    }\n                                  );\n                                }\n                              );\n                            }\n                          );\n                        }\n                      );\n                    }\n                  );\n                }\n              );\n            }\n          );\n        }\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer/test-x3-index.js",
    "content": "/* eslint-disable brace-style */\n/* eslint-disable no-path-concat */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar assert = require('assert');\nvar theRequireContentA = './test-z-asset-A.css';\nvar theRequireContentB = 'test-z-asset-B.css';\n\nfunction firstLowerCase(s) {\n  return s.slice(0, 1).toLowerCase() + s.slice(1);\n}\n\nfunction firstUpperCase(s) {\n  return s.slice(0, 1).toUpperCase() + s.slice(1);\n}\n\n// ///////////////////////////////////////////////////////////////////////////\n\nfs.exists(path.join(__dirname, theRequireContentA), function (e82, v82) {\n  fs.exists(__dirname + path.sep + theRequireContentB, function (e83, v83) {\n    fs.exists(__dirname + '/' + theRequireContentB, function (e84, v84) {\n      fs.exists(\n        firstLowerCase(path.join(__dirname, theRequireContentA)),\n        function (e85, v85) {\n          fs.exists(\n            firstLowerCase(__dirname + path.sep + theRequireContentB),\n            function (e86, v86) {\n              fs.exists(\n                firstLowerCase(__dirname + '/' + theRequireContentB),\n                function (e87, v87) {\n                  fs.exists(\n                    firstUpperCase(path.join(__dirname, theRequireContentA)),\n                    function (e88, v88) {\n                      fs.exists(\n                        firstUpperCase(\n                          __dirname + path.sep + theRequireContentB\n                        ),\n                        function (e89, v89) {\n                          fs.exists(\n                            firstUpperCase(\n                              __dirname + '/' + theRequireContentB\n                            ),\n                            function (e90, v90) {\n                              //\n\n                              fs.exists(\n                                path.join(\n                                  __dirname,\n                                  theRequireContentA + '-no-such'\n                                ),\n                                function (e91, v91) {\n                                  fs.exists(\n                                    __dirname +\n                                      path.sep +\n                                      theRequireContentB +\n                                      '-no-such',\n                                    function (e92, v92) {\n                                      fs.exists(\n                                        __dirname +\n                                          '/' +\n                                          theRequireContentB +\n                                          '-no-such',\n                                        function (e93, v93) {\n                                          fs.exists(\n                                            firstLowerCase(\n                                              path.join(\n                                                __dirname,\n                                                theRequireContentA + '-no-such'\n                                              )\n                                            ),\n                                            function (e94, v94) {\n                                              fs.exists(\n                                                firstLowerCase(\n                                                  __dirname +\n                                                    path.sep +\n                                                    theRequireContentB +\n                                                    '-no-such'\n                                                ),\n                                                function (e95, v95) {\n                                                  fs.exists(\n                                                    firstLowerCase(\n                                                      __dirname +\n                                                        '/' +\n                                                        theRequireContentB +\n                                                        '-no-such'\n                                                    ),\n                                                    function (e96, v96) {\n                                                      fs.exists(\n                                                        firstUpperCase(\n                                                          path.join(\n                                                            __dirname,\n                                                            theRequireContentA +\n                                                              '-no-such'\n                                                          )\n                                                        ),\n                                                        function (e97, v97) {\n                                                          fs.exists(\n                                                            firstUpperCase(\n                                                              __dirname +\n                                                                path.sep +\n                                                                theRequireContentB +\n                                                                '-no-such'\n                                                            ),\n                                                            function (\n                                                              e98,\n                                                              v98\n                                                            ) {\n                                                              fs.exists(\n                                                                firstUpperCase(\n                                                                  __dirname +\n                                                                    '/' +\n                                                                    theRequireContentB +\n                                                                    '-no-such'\n                                                                ),\n                                                                function (\n                                                                  e99,\n                                                                  v99\n                                                                ) {\n                                                                  //\n\n                                                                  fs.access(\n                                                                    path.join(\n                                                                      __dirname,\n                                                                      theRequireContentA\n                                                                    ),\n                                                                    function (\n                                                                      e100,\n                                                                      v100\n                                                                    ) {\n                                                                      fs.access(\n                                                                        __dirname +\n                                                                          path.sep +\n                                                                          theRequireContentB,\n                                                                        function (\n                                                                          e101,\n                                                                          v101\n                                                                        ) {\n                                                                          fs.access(\n                                                                            __dirname +\n                                                                              '/' +\n                                                                              theRequireContentB,\n                                                                            function (\n                                                                              e102,\n                                                                              v102\n                                                                            ) {\n                                                                              fs.access(\n                                                                                firstLowerCase(\n                                                                                  path.join(\n                                                                                    __dirname,\n                                                                                    theRequireContentA\n                                                                                  )\n                                                                                ),\n                                                                                function (\n                                                                                  e103,\n                                                                                  v103\n                                                                                ) {\n                                                                                  fs.access(\n                                                                                    firstLowerCase(\n                                                                                      __dirname +\n                                                                                        path.sep +\n                                                                                        theRequireContentB\n                                                                                    ),\n                                                                                    function (\n                                                                                      e104,\n                                                                                      v104\n                                                                                    ) {\n                                                                                      fs.access(\n                                                                                        firstLowerCase(\n                                                                                          __dirname +\n                                                                                            '/' +\n                                                                                            theRequireContentB\n                                                                                        ),\n                                                                                        function (\n                                                                                          e105,\n                                                                                          v105\n                                                                                        ) {\n                                                                                          fs.access(\n                                                                                            firstUpperCase(\n                                                                                              path.join(\n                                                                                                __dirname,\n                                                                                                theRequireContentA\n                                                                                              )\n                                                                                            ),\n                                                                                            function (\n                                                                                              e106,\n                                                                                              v106\n                                                                                            ) {\n                                                                                              fs.access(\n                                                                                                firstUpperCase(\n                                                                                                  __dirname +\n                                                                                                    path.sep +\n                                                                                                    theRequireContentB\n                                                                                                ),\n                                                                                                function (\n                                                                                                  e107,\n                                                                                                  v107\n                                                                                                ) {\n                                                                                                  fs.access(\n                                                                                                    firstUpperCase(\n                                                                                                      __dirname +\n                                                                                                        '/' +\n                                                                                                        theRequireContentB\n                                                                                                    ),\n                                                                                                    function (\n                                                                                                      e108,\n                                                                                                      v108\n                                                                                                    ) {\n                                                                                                      //\n\n                                                                                                      fs.access(\n                                                                                                        path.join(\n                                                                                                          __dirname,\n                                                                                                          theRequireContentA +\n                                                                                                            '-no-such'\n                                                                                                        ),\n                                                                                                        function (\n                                                                                                          e109,\n                                                                                                          v109\n                                                                                                        ) {\n                                                                                                          fs.access(\n                                                                                                            __dirname +\n                                                                                                              path.sep +\n                                                                                                              theRequireContentB +\n                                                                                                              '-no-such',\n                                                                                                            function (\n                                                                                                              e110,\n                                                                                                              v110\n                                                                                                            ) {\n                                                                                                              fs.access(\n                                                                                                                __dirname +\n                                                                                                                  '/' +\n                                                                                                                  theRequireContentB +\n                                                                                                                  '-no-such',\n                                                                                                                function (\n                                                                                                                  e111,\n                                                                                                                  v111\n                                                                                                                ) {\n                                                                                                                  fs.access(\n                                                                                                                    firstLowerCase(\n                                                                                                                      path.join(\n                                                                                                                        __dirname,\n                                                                                                                        theRequireContentA +\n                                                                                                                          '-no-such'\n                                                                                                                      )\n                                                                                                                    ),\n                                                                                                                    function (\n                                                                                                                      e112,\n                                                                                                                      v112\n                                                                                                                    ) {\n                                                                                                                      fs.access(\n                                                                                                                        firstLowerCase(\n                                                                                                                          __dirname +\n                                                                                                                            path.sep +\n                                                                                                                            theRequireContentB +\n                                                                                                                            '-no-such'\n                                                                                                                        ),\n                                                                                                                        function (\n                                                                                                                          e113,\n                                                                                                                          v113\n                                                                                                                        ) {\n                                                                                                                          fs.access(\n                                                                                                                            firstLowerCase(\n                                                                                                                              __dirname +\n                                                                                                                                '/' +\n                                                                                                                                theRequireContentB +\n                                                                                                                                '-no-such'\n                                                                                                                            ),\n                                                                                                                            function (\n                                                                                                                              e114,\n                                                                                                                              v114\n                                                                                                                            ) {\n                                                                                                                              fs.access(\n                                                                                                                                firstUpperCase(\n                                                                                                                                  path.join(\n                                                                                                                                    __dirname,\n                                                                                                                                    theRequireContentA +\n                                                                                                                                      '-no-such'\n                                                                                                                                  )\n                                                                                                                                ),\n                                                                                                                                function (\n                                                                                                                                  e115,\n                                                                                                                                  v115\n                                                                                                                                ) {\n                                                                                                                                  fs.access(\n                                                                                                                                    firstUpperCase(\n                                                                                                                                      __dirname +\n                                                                                                                                        path.sep +\n                                                                                                                                        theRequireContentB +\n                                                                                                                                        '-no-such'\n                                                                                                                                    ),\n                                                                                                                                    function (\n                                                                                                                                      e116,\n                                                                                                                                      v116\n                                                                                                                                    ) {\n                                                                                                                                      fs.access(\n                                                                                                                                        firstUpperCase(\n                                                                                                                                          __dirname +\n                                                                                                                                            '/' +\n                                                                                                                                            theRequireContentB +\n                                                                                                                                            '-no-such'\n                                                                                                                                        ),\n                                                                                                                                        function (\n                                                                                                                                          e117,\n                                                                                                                                          v117\n                                                                                                                                        ) {\n                                                                                                                                          //\n\n                                                                                                                                          fs.stat(\n                                                                                                                                            path.join(\n                                                                                                                                              __dirname,\n                                                                                                                                              theRequireContentA\n                                                                                                                                            ),\n                                                                                                                                            function (\n                                                                                                                                              e118,\n                                                                                                                                              v118\n                                                                                                                                            ) {\n                                                                                                                                              fs.stat(\n                                                                                                                                                __dirname +\n                                                                                                                                                  path.sep +\n                                                                                                                                                  theRequireContentB,\n                                                                                                                                                function (\n                                                                                                                                                  e119,\n                                                                                                                                                  v119\n                                                                                                                                                ) {\n                                                                                                                                                  fs.stat(\n                                                                                                                                                    __dirname +\n                                                                                                                                                      '/' +\n                                                                                                                                                      theRequireContentB,\n                                                                                                                                                    function (\n                                                                                                                                                      e120,\n                                                                                                                                                      v120\n                                                                                                                                                    ) {\n                                                                                                                                                      fs.stat(\n                                                                                                                                                        firstLowerCase(\n                                                                                                                                                          path.join(\n                                                                                                                                                            __dirname,\n                                                                                                                                                            theRequireContentA\n                                                                                                                                                          )\n                                                                                                                                                        ),\n                                                                                                                                                        function (\n                                                                                                                                                          e121,\n                                                                                                                                                          v121\n                                                                                                                                                        ) {\n                                                                                                                                                          fs.stat(\n                                                                                                                                                            firstLowerCase(\n                                                                                                                                                              __dirname +\n                                                                                                                                                                path.sep +\n                                                                                                                                                                theRequireContentB\n                                                                                                                                                            ),\n                                                                                                                                                            function (\n                                                                                                                                                              e122,\n                                                                                                                                                              v122\n                                                                                                                                                            ) {\n                                                                                                                                                              fs.stat(\n                                                                                                                                                                firstLowerCase(\n                                                                                                                                                                  __dirname +\n                                                                                                                                                                    '/' +\n                                                                                                                                                                    theRequireContentB\n                                                                                                                                                                ),\n                                                                                                                                                                function (\n                                                                                                                                                                  e123,\n                                                                                                                                                                  v123\n                                                                                                                                                                ) {\n                                                                                                                                                                  fs.stat(\n                                                                                                                                                                    firstUpperCase(\n                                                                                                                                                                      path.join(\n                                                                                                                                                                        __dirname,\n                                                                                                                                                                        theRequireContentA\n                                                                                                                                                                      )\n                                                                                                                                                                    ),\n                                                                                                                                                                    function (\n                                                                                                                                                                      e124,\n                                                                                                                                                                      v124\n                                                                                                                                                                    ) {\n                                                                                                                                                                      fs.stat(\n                                                                                                                                                                        firstUpperCase(\n                                                                                                                                                                          __dirname +\n                                                                                                                                                                            path.sep +\n                                                                                                                                                                            theRequireContentB\n                                                                                                                                                                        ),\n                                                                                                                                                                        function (\n                                                                                                                                                                          e125,\n                                                                                                                                                                          v125\n                                                                                                                                                                        ) {\n                                                                                                                                                                          fs.stat(\n                                                                                                                                                                            firstUpperCase(\n                                                                                                                                                                              __dirname +\n                                                                                                                                                                                '/' +\n                                                                                                                                                                                theRequireContentB\n                                                                                                                                                                            ),\n                                                                                                                                                                            function (\n                                                                                                                                                                              e126,\n                                                                                                                                                                              v126\n                                                                                                                                                                            ) {\n                                                                                                                                                                              //\n\n                                                                                                                                                                              fs.lstat(\n                                                                                                                                                                                path.join(\n                                                                                                                                                                                  __dirname,\n                                                                                                                                                                                  theRequireContentA\n                                                                                                                                                                                ),\n                                                                                                                                                                                function (\n                                                                                                                                                                                  e127,\n                                                                                                                                                                                  v127\n                                                                                                                                                                                ) {\n                                                                                                                                                                                  fs.lstat(\n                                                                                                                                                                                    __dirname +\n                                                                                                                                                                                      path.sep +\n                                                                                                                                                                                      theRequireContentB,\n                                                                                                                                                                                    function (\n                                                                                                                                                                                      e128,\n                                                                                                                                                                                      v128\n                                                                                                                                                                                    ) {\n                                                                                                                                                                                      fs.lstat(\n                                                                                                                                                                                        __dirname +\n                                                                                                                                                                                          '/' +\n                                                                                                                                                                                          theRequireContentB,\n                                                                                                                                                                                        function (\n                                                                                                                                                                                          e129,\n                                                                                                                                                                                          v129\n                                                                                                                                                                                        ) {\n                                                                                                                                                                                          fs.lstat(\n                                                                                                                                                                                            firstLowerCase(\n                                                                                                                                                                                              path.join(\n                                                                                                                                                                                                __dirname,\n                                                                                                                                                                                                theRequireContentA\n                                                                                                                                                                                              )\n                                                                                                                                                                                            ),\n                                                                                                                                                                                            function (\n                                                                                                                                                                                              e130,\n                                                                                                                                                                                              v130\n                                                                                                                                                                                            ) {\n                                                                                                                                                                                              fs.lstat(\n                                                                                                                                                                                                firstLowerCase(\n                                                                                                                                                                                                  __dirname +\n                                                                                                                                                                                                    path.sep +\n                                                                                                                                                                                                    theRequireContentB\n                                                                                                                                                                                                ),\n                                                                                                                                                                                                function (\n                                                                                                                                                                                                  e131,\n                                                                                                                                                                                                  v131\n                                                                                                                                                                                                ) {\n                                                                                                                                                                                                  fs.lstat(\n                                                                                                                                                                                                    firstLowerCase(\n                                                                                                                                                                                                      __dirname +\n                                                                                                                                                                                                        '/' +\n                                                                                                                                                                                                        theRequireContentB\n                                                                                                                                                                                                    ),\n                                                                                                                                                                                                    function (\n                                                                                                                                                                                                      e132,\n                                                                                                                                                                                                      v132\n                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                      fs.lstat(\n                                                                                                                                                                                                        firstUpperCase(\n                                                                                                                                                                                                          path.join(\n                                                                                                                                                                                                            __dirname,\n                                                                                                                                                                                                            theRequireContentA\n                                                                                                                                                                                                          )\n                                                                                                                                                                                                        ),\n                                                                                                                                                                                                        function (\n                                                                                                                                                                                                          e133,\n                                                                                                                                                                                                          v133\n                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                          fs.lstat(\n                                                                                                                                                                                                            firstUpperCase(\n                                                                                                                                                                                                              __dirname +\n                                                                                                                                                                                                                path.sep +\n                                                                                                                                                                                                                theRequireContentB\n                                                                                                                                                                                                            ),\n                                                                                                                                                                                                            function (\n                                                                                                                                                                                                              e134,\n                                                                                                                                                                                                              v134\n                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                              fs.lstat(\n                                                                                                                                                                                                                firstUpperCase(\n                                                                                                                                                                                                                  __dirname +\n                                                                                                                                                                                                                    '/' +\n                                                                                                                                                                                                                    theRequireContentB\n                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                  e135,\n                                                                                                                                                                                                                  v135\n                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                  //\n\n                                                                                                                                                                                                                  fs.realpath(\n                                                                                                                                                                                                                    path.join(\n                                                                                                                                                                                                                      __dirname,\n                                                                                                                                                                                                                      theRequireContentA\n                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                      e145,\n                                                                                                                                                                                                                      v145\n                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                      fs.realpath(\n                                                                                                                                                                                                                        __dirname +\n                                                                                                                                                                                                                          path.sep +\n                                                                                                                                                                                                                          theRequireContentB,\n                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                          e146,\n                                                                                                                                                                                                                          v146\n                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                          fs.realpath(\n                                                                                                                                                                                                                            __dirname +\n                                                                                                                                                                                                                              '/' +\n                                                                                                                                                                                                                              theRequireContentB,\n                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                              e147,\n                                                                                                                                                                                                                              v147\n                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                              fs.realpath(\n                                                                                                                                                                                                                                firstLowerCase(\n                                                                                                                                                                                                                                  path.join(\n                                                                                                                                                                                                                                    __dirname,\n                                                                                                                                                                                                                                    theRequireContentA\n                                                                                                                                                                                                                                  )\n                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                  e148,\n                                                                                                                                                                                                                                  v148\n                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                  fs.realpath(\n                                                                                                                                                                                                                                    firstLowerCase(\n                                                                                                                                                                                                                                      __dirname +\n                                                                                                                                                                                                                                        path.sep +\n                                                                                                                                                                                                                                        theRequireContentB\n                                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                      e149,\n                                                                                                                                                                                                                                      v149\n                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                      fs.realpath(\n                                                                                                                                                                                                                                        firstLowerCase(\n                                                                                                                                                                                                                                          __dirname +\n                                                                                                                                                                                                                                            '/' +\n                                                                                                                                                                                                                                            theRequireContentB\n                                                                                                                                                                                                                                        ),\n                                                                                                                                                                                                                                        function (\n                                                                                                                                                                                                                                          e150,\n                                                                                                                                                                                                                                          v150\n                                                                                                                                                                                                                                        ) {\n                                                                                                                                                                                                                                          fs.realpath(\n                                                                                                                                                                                                                                            firstUpperCase(\n                                                                                                                                                                                                                                              path.join(\n                                                                                                                                                                                                                                                __dirname,\n                                                                                                                                                                                                                                                theRequireContentA\n                                                                                                                                                                                                                                              )\n                                                                                                                                                                                                                                            ),\n                                                                                                                                                                                                                                            function (\n                                                                                                                                                                                                                                              e151,\n                                                                                                                                                                                                                                              v151\n                                                                                                                                                                                                                                            ) {\n                                                                                                                                                                                                                                              fs.realpath(\n                                                                                                                                                                                                                                                firstUpperCase(\n                                                                                                                                                                                                                                                  __dirname +\n                                                                                                                                                                                                                                                    path.sep +\n                                                                                                                                                                                                                                                    theRequireContentB\n                                                                                                                                                                                                                                                ),\n                                                                                                                                                                                                                                                function (\n                                                                                                                                                                                                                                                  e152,\n                                                                                                                                                                                                                                                  v152\n                                                                                                                                                                                                                                                ) {\n                                                                                                                                                                                                                                                  fs.realpath(\n                                                                                                                                                                                                                                                    firstUpperCase(\n                                                                                                                                                                                                                                                      __dirname +\n                                                                                                                                                                                                                                                        '/' +\n                                                                                                                                                                                                                                                        theRequireContentB\n                                                                                                                                                                                                                                                    ),\n                                                                                                                                                                                                                                                    function (\n                                                                                                                                                                                                                                                      e153,\n                                                                                                                                                                                                                                                      v153\n                                                                                                                                                                                                                                                    ) {\n                                                                                                                                                                                                                                                      console.log(\n                                                                                                                                                                                                                                                        [\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                          'exists',\n                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                            v82 ===\n                                                                                                                                                                                                                                                              undefined\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e82,\n                                                                                                                                                                                                                                                          v82 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e83,\n                                                                                                                                                                                                                                                          v83 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e84,\n                                                                                                                                                                                                                                                          v84 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e85,\n                                                                                                                                                                                                                                                          v85 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e86,\n                                                                                                                                                                                                                                                          v86 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e87,\n                                                                                                                                                                                                                                                          v87 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e88,\n                                                                                                                                                                                                                                                          v88 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e89,\n                                                                                                                                                                                                                                                          v89 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e90,\n                                                                                                                                                                                                                                                          v90 ===\n                                                                                                                                                                                                                                                            undefined,\n\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                          'exists-no-such',\n                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                            v91 ===\n                                                                                                                                                                                                                                                              undefined\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e91,\n                                                                                                                                                                                                                                                          v91 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e92,\n                                                                                                                                                                                                                                                          v92 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e93,\n                                                                                                                                                                                                                                                          v93 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e94,\n                                                                                                                                                                                                                                                          v94 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e95,\n                                                                                                                                                                                                                                                          v95 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e96,\n                                                                                                                                                                                                                                                          v96 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e97,\n                                                                                                                                                                                                                                                          v97 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e98,\n                                                                                                                                                                                                                                                          v98 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e99,\n                                                                                                                                                                                                                                                          v99 ===\n                                                                                                                                                                                                                                                            undefined,\n\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                          'access',\n                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                            v100 ===\n                                                                                                                                                                                                                                                              undefined ||\n                                                                                                                                                                                                                                                              v100 ===\n                                                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e100 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v100 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v100 ===\n                                                                                                                                                                                                                                                              0, // odd behaviour in 0.12.14\n                                                                                                                                                                                                                                                          e101 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v101 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v101 ===\n                                                                                                                                                                                                                                                              0, // callback args are (null, 0). wtf 0?\n                                                                                                                                                                                                                                                          e102 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v102 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v102 ===\n                                                                                                                                                                                                                                                              0,\n                                                                                                                                                                                                                                                          e103 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v103 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v103 ===\n                                                                                                                                                                                                                                                              0,\n                                                                                                                                                                                                                                                          e104 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v104 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v104 ===\n                                                                                                                                                                                                                                                              0,\n                                                                                                                                                                                                                                                          e105 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v105 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v105 ===\n                                                                                                                                                                                                                                                              0,\n                                                                                                                                                                                                                                                          e106 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v106 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v106 ===\n                                                                                                                                                                                                                                                              0,\n                                                                                                                                                                                                                                                          e107 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v107 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v107 ===\n                                                                                                                                                                                                                                                              0,\n                                                                                                                                                                                                                                                          e108 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v108 ===\n                                                                                                                                                                                                                                                            undefined ||\n                                                                                                                                                                                                                                                            v108 ===\n                                                                                                                                                                                                                                                              0,\n\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                          'access-no-such',\n                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                            v109 ===\n                                                                                                                                                                                                                                                              undefined\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e109.errno,\n                                                                                                                                                                                                                                                          e109.code,\n                                                                                                                                                                                                                                                          v109 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e110.errno,\n                                                                                                                                                                                                                                                          e110.code,\n                                                                                                                                                                                                                                                          v110 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e111.errno,\n                                                                                                                                                                                                                                                          e111.code,\n                                                                                                                                                                                                                                                          v111 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e112.errno,\n                                                                                                                                                                                                                                                          e112.code,\n                                                                                                                                                                                                                                                          v112 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e113.errno,\n                                                                                                                                                                                                                                                          e113.code,\n                                                                                                                                                                                                                                                          v113 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e114.errno,\n                                                                                                                                                                                                                                                          e114.code,\n                                                                                                                                                                                                                                                          v114 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e115.errno,\n                                                                                                                                                                                                                                                          e115.code,\n                                                                                                                                                                                                                                                          v115 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e116.errno,\n                                                                                                                                                                                                                                                          e116.code,\n                                                                                                                                                                                                                                                          v116 ===\n                                                                                                                                                                                                                                                            undefined,\n                                                                                                                                                                                                                                                          e117.errno,\n                                                                                                                                                                                                                                                          e117.code,\n                                                                                                                                                                                                                                                          v117 ===\n                                                                                                                                                                                                                                                            undefined,\n\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                          'stat',\n                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                            e118 ===\n                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e118 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v118.mode,\n                                                                                                                                                                                                                                                          v118.isFile(),\n                                                                                                                                                                                                                                                          v118.isDirectory(),\n                                                                                                                                                                                                                                                          e119 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v119.mode,\n                                                                                                                                                                                                                                                          v119.isFile(),\n                                                                                                                                                                                                                                                          v119.isDirectory(),\n                                                                                                                                                                                                                                                          e120 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v120.mode,\n                                                                                                                                                                                                                                                          v120.isFile(),\n                                                                                                                                                                                                                                                          v120.isDirectory(),\n                                                                                                                                                                                                                                                          e121 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v121.mode,\n                                                                                                                                                                                                                                                          v121.isFile(),\n                                                                                                                                                                                                                                                          v121.isDirectory(),\n                                                                                                                                                                                                                                                          e122 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v122.mode,\n                                                                                                                                                                                                                                                          v122.isFile(),\n                                                                                                                                                                                                                                                          v122.isDirectory(),\n                                                                                                                                                                                                                                                          e123 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v123.mode,\n                                                                                                                                                                                                                                                          v123.isFile(),\n                                                                                                                                                                                                                                                          v123.isDirectory(),\n                                                                                                                                                                                                                                                          e124 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v124.mode,\n                                                                                                                                                                                                                                                          v124.isFile(),\n                                                                                                                                                                                                                                                          v124.isDirectory(),\n                                                                                                                                                                                                                                                          e125 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v125.mode,\n                                                                                                                                                                                                                                                          v125.isFile(),\n                                                                                                                                                                                                                                                          v125.isDirectory(),\n                                                                                                                                                                                                                                                          e126 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v126.mode,\n                                                                                                                                                                                                                                                          v126.isFile(),\n                                                                                                                                                                                                                                                          v126.isDirectory(),\n\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                          'lstat',\n                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                            e127 ===\n                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e127 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v127.mode,\n                                                                                                                                                                                                                                                          v127.isFile(),\n                                                                                                                                                                                                                                                          v127.isDirectory(),\n                                                                                                                                                                                                                                                          e128 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v128.mode,\n                                                                                                                                                                                                                                                          v128.isFile(),\n                                                                                                                                                                                                                                                          v128.isDirectory(),\n                                                                                                                                                                                                                                                          e129 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v129.mode,\n                                                                                                                                                                                                                                                          v129.isFile(),\n                                                                                                                                                                                                                                                          v129.isDirectory(),\n                                                                                                                                                                                                                                                          e130 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v130.mode,\n                                                                                                                                                                                                                                                          v130.isFile(),\n                                                                                                                                                                                                                                                          v130.isDirectory(),\n                                                                                                                                                                                                                                                          e131 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v131.mode,\n                                                                                                                                                                                                                                                          v131.isFile(),\n                                                                                                                                                                                                                                                          v131.isDirectory(),\n                                                                                                                                                                                                                                                          e132 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v132.mode,\n                                                                                                                                                                                                                                                          v132.isFile(),\n                                                                                                                                                                                                                                                          v132.isDirectory(),\n                                                                                                                                                                                                                                                          e133 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v133.mode,\n                                                                                                                                                                                                                                                          v133.isFile(),\n                                                                                                                                                                                                                                                          v133.isDirectory(),\n                                                                                                                                                                                                                                                          e134 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v134.mode,\n                                                                                                                                                                                                                                                          v134.isFile(),\n                                                                                                                                                                                                                                                          v134.isDirectory(),\n                                                                                                                                                                                                                                                          e135 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          v135.mode,\n                                                                                                                                                                                                                                                          v135.isFile(),\n                                                                                                                                                                                                                                                          v135.isDirectory(),\n\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n\n                                                                                                                                                                                                                                                          'realpath',\n                                                                                                                                                                                                                                                          assert(\n                                                                                                                                                                                                                                                            e145 ===\n                                                                                                                                                                                                                                                              null\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e145 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v145\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v145\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e146 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v146\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v146\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e147 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v147\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v147\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e148 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v148\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v148\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e149 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v149\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v149\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e150 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v150\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v150\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e151 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v151\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v151\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e152 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v152\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v152\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          e153 ===\n                                                                                                                                                                                                                                                            null,\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            v153\n                                                                                                                                                                                                                                                          ),\n                                                                                                                                                                                                                                                          path.basename(\n                                                                                                                                                                                                                                                            path.dirname(\n                                                                                                                                                                                                                                                              v153\n                                                                                                                                                                                                                                                            )\n                                                                                                                                                                                                                                                          ),\n\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                          '******************************************************',\n                                                                                                                                                                                                                                                        ].join(\n                                                                                                                                                                                                                                                          '\\n'\n                                                                                                                                                                                                                                                        )\n                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                }\n                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                            }\n                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                        }\n                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                    }\n                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                }\n                                                                                                                                                                                                              );\n                                                                                                                                                                                                            }\n                                                                                                                                                                                                          );\n                                                                                                                                                                                                        }\n                                                                                                                                                                                                      );\n                                                                                                                                                                                                    }\n                                                                                                                                                                                                  );\n                                                                                                                                                                                                }\n                                                                                                                                                                                              );\n                                                                                                                                                                                            }\n                                                                                                                                                                                          );\n                                                                                                                                                                                        }\n                                                                                                                                                                                      );\n                                                                                                                                                                                    }\n                                                                                                                                                                                  );\n                                                                                                                                                                                }\n                                                                                                                                                                              );\n                                                                                                                                                                            }\n                                                                                                                                                                          );\n                                                                                                                                                                        }\n                                                                                                                                                                      );\n                                                                                                                                                                    }\n                                                                                                                                                                  );\n                                                                                                                                                                }\n                                                                                                                                                              );\n                                                                                                                                                            }\n                                                                                                                                                          );\n                                                                                                                                                        }\n                                                                                                                                                      );\n                                                                                                                                                    }\n                                                                                                                                                  );\n                                                                                                                                                }\n                                                                                                                                              );\n                                                                                                                                            }\n                                                                                                                                          );\n                                                                                                                                        }\n                                                                                                                                      );\n                                                                                                                                    }\n                                                                                                                                  );\n                                                                                                                                }\n                                                                                                                              );\n                                                                                                                            }\n                                                                                                                          );\n                                                                                                                        }\n                                                                                                                      );\n                                                                                                                    }\n                                                                                                                  );\n                                                                                                                }\n                                                                                                              );\n                                                                                                            }\n                                                                                                          );\n                                                                                                        }\n                                                                                                      );\n                                                                                                    }\n                                                                                                  );\n                                                                                                }\n                                                                                              );\n                                                                                            }\n                                                                                          );\n                                                                                        }\n                                                                                      );\n                                                                                    }\n                                                                                  );\n                                                                                }\n                                                                              );\n                                                                            }\n                                                                          );\n                                                                        }\n                                                                      );\n                                                                    }\n                                                                  );\n                                                                }\n                                                              );\n                                                            }\n                                                          );\n                                                        }\n                                                      );\n                                                    }\n                                                  );\n                                                }\n                                              );\n                                            }\n                                          );\n                                        }\n                                      );\n                                    }\n                                  );\n                                }\n                              );\n                            }\n                          );\n                        }\n                      );\n                    }\n                  );\n                }\n              );\n            }\n          );\n        }\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer/test-z-asset-A.css",
    "content": ".ui-button,\n.ui-button:link,\n.ui-button:visited,\n.ui-button:hover,\n.ui-button:active {\n  text-decoration: none;\n}\n/* to make room for the icon, a width needs to be set here */\n.ui-button-icon-only {\n  width: 2.2em;\n}\n/* button elements seem to need a little more width */\nbutton.ui-button-icon-only {\n  width: 2.4em;\n}\n.ui-button-icons-only {\n  width: 3.4em;\n}\nbutton.ui-button-icons-only {\n  width: 3.7em;\n}\n\n/* button text element */\n.ui-button .ui-button-text {\n  display: block;\n  line-height: normal;\n}\n.ui-button-text-only .ui-button-text {\n  padding: 0.4em 1em;\n}\n.ui-button-icon-only .ui-button-text,\n.ui-button-icons-only .ui-button-text {\n  padding: 0.4em;\n  text-indent: -9999999px;\n}\n.ui-button-text-icon-primary .ui-button-text,\n.ui-button-text-icons .ui-button-text {\n  padding: 0.4em 1em 0.4em 2.1em;\n}\n.ui-button-text-icon-secondary .ui-button-text,\n.ui-button-text-icons .ui-button-text {\n  padding: 0.4em 2.1em 0.4em 1em;\n}\n.ui-button-text-icons .ui-button-text {\n  padding-left: 2.1em;\n  padding-right: 2.1em;\n}\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer/test-z-asset-B.css",
    "content": ".header {\n  background: #444;\n  border: solid;\n  padding: 10px;\n  border-radius: 10px 5px 10px 5px;\n  color: #b4b472;\n}\n\n#main li {\n  color: green;\n  margin: 10px;\n  padding: 10px;\n  font-size: 18px;\n}\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer-2/main.js",
    "content": "#!/usr/bin/env node\n\n/* eslint-disable no-multi-spaces */\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\n// see readFromSnapshot \"NODE_VERSION_MAJOR\"\n\nfunction bitty(version) {\n  return (\n    (4 * /^(node|v)?8/.test(version)) |\n    (8 * /^(node|v)?10/.test(version)) |\n    (16 * /^(node|v)?12/.test(version)) |\n    (32 * /^(node|v)?14/.test(version)) |\n    (64 * /^(node|v)?16/.test(version)) |\n    (128 * /^(node|v)?18/.test(version))\n  );\n}\n\nconst version1 = process.version;\nconst version2 = target;\n\nif (bitty(version1) === bitty(version2)) {\n  let left, right;\n  utils.mkdirp.sync(path.dirname(output));\n\n  left = utils.spawn.sync('node', [path.basename(input)], {\n    cwd: path.dirname(input),\n  });\n\n  utils.pkg.sync(['--target', target, '--output', output, input]);\n\n  right = utils.spawn.sync('./' + path.basename(output), [], {\n    cwd: path.dirname(output),\n  });\n\n  left = left.split('\\n');\n  right = right.split('\\n');\n  // right may have less lines, premature exit,\n  // less trusted, so using left.length here\n  for (let i = 0; i < left.length; i += 1) {\n    if (/is out of range/.test(left[i]) && /is out of range/.test(right[i])) {\n      left[i] = left[i].replace(/ It must be .*\\. /, ' ');\n      right[i] = right[i].replace(/ It must be .*\\. /, ' ');\n    }\n    assert.strictEqual(left[i], right[i]);\n  }\n\n  utils.vacuum.sync(path.dirname(output));\n}\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer-2/test-x-index.js",
    "content": "/* eslint-disable max-statements-per-line */\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst theFile = path.join(__dirname, 'test-z-asset.css');\nconst theDirectory = __dirname;\n\nfunction dumpError(error) {\n  let s = error.message;\n  if (s === 'Bad argument') {\n    s = 'fd must be a file descriptor';\n  } else if (s === 'EBADF, bad file descriptor' && error.syscall === 'fstat') {\n    s = 'EBADF: bad file descriptor, fstat';\n  } else if (s === 'EBADF, bad file descriptor') {\n    s = 'EBADF: bad file descriptor';\n  } else if (s === 'EBADF: bad file descriptor, close') {\n    s = 'EBADF: bad file descriptor';\n  } else if (s === 'EISDIR, illegal operation on a directory') {\n    s = 'EISDIR: illegal operation on a directory, read';\n  }\n  console.log(s);\n}\n\ntest01();\n\nfunction test01() {\n  console.log('<<< test01 >>>');\n\n  fs.stat(theFile, function (error, stats) {\n    console.log('fs.stat.error === null', error === null);\n    console.log('stats.size', stats.size);\n    fs.open(theFile, 'r', function (error2, fd) {\n      console.log('fs.open.error2 === null', error2 === null);\n      console.log('typeof fd', typeof fd);\n      fs.fstat(fd, function (error3, fstats) {\n        console.log('fs.fstat.error3 === null', error3 === null);\n        console.log('fstats.size', fstats.size);\n        const buffer = Buffer.alloc((stats.size / 2) | 0);\n        fs.read(\n          fd,\n          buffer,\n          0,\n          buffer.length,\n          null,\n          function (error4, bytesRead, buffer2) {\n            console.log('fs.read.error4 === null', error4 === null);\n            console.log('buffer === buffer2', buffer === buffer2); // should be same instances\n            const data2 = buffer2.toString('utf8', 0, buffer2.length);\n            console.log('data2', data2);\n            fs.close(fd, function (error5, wtf) {\n              console.log('fs.close.error5 === null', error5 === null);\n              console.log('typeof wtf', typeof wtf);\n              fs.readFile(theFile, function (error6, buffer3) {\n                console.log('fs.readFile.error6 === null', error6 === null);\n                const data3 = buffer3.toString('utf8', 0, buffer3.length);\n                console.log('data3', data3);\n                const buffer4 = buffer3;\n                fs.writeFile(theFile, buffer4, function (error7, wtf2) {\n                  if (process.pkg) {\n                    assert.strictEqual(typeof error7, 'object'); // TODO maybe code=EACCESS?\n                  } else {\n                    assert.strictEqual(error7, null);\n                  }\n                  console.log('typeof wtf2', typeof wtf2);\n                  fs.readdir(theDirectory, function (error8, list) {\n                    console.log('fs.readdir.error8 === null', error8 === null);\n                    console.log('Array.isArray(list)', Array.isArray(list));\n                    fs.exists(theFile, function (value, wtf3) {\n                      console.log('value', value);\n                      console.log('typeof wtf3', typeof wtf3);\n                      fs.exists(theDirectory, function (value2, wtf4) {\n                        console.log('value2', value2);\n                        console.log('typeof wtf4', typeof wtf4);\n                        fs.realpath(theFile, function (error9, real) {\n                          console.log(\n                            'fs.realpath.error9 === null',\n                            error9 === null\n                          );\n                          console.log('typeof real', typeof real);\n                          test01e(fd);\n                        });\n                        console.log('after fs.realpath');\n                      });\n                      console.log('after fs.exists(theDirectory)');\n                    });\n                    console.log('after fs.exists(theFile)');\n                  });\n                  console.log('after fs.readdir');\n                });\n                console.log('after fs.writeFile');\n              });\n              console.log('after fs.readFile');\n            });\n            console.log('after fs.close');\n          }\n        );\n        console.log('after fs.read');\n      });\n      console.log('after fs.fstat');\n    });\n    console.log('after fs.open');\n  });\n  console.log('after fs.stat');\n}\n\nfunction test01e(badFd) {\n  console.log('<<< test01e >>>');\n\n  fs.stat('notExists', function (error) {\n    console.log('fs.stat.error.code', error.code);\n    fs.open('notExists', 'r', function (error2, fd) {\n      console.log('fs.open.error2.code', error2.code);\n      fd = badFd;\n      fs.fstat(fd, function (error3) {\n        console.log('fs.fstat.error3.code', error3.code);\n        const buffer = Buffer.alloc(1024);\n        fs.read(\n          fd,\n          buffer,\n          0,\n          buffer.length,\n          null,\n          function (error4, bytesRead, buffer2) {\n            console.log('fs.read.error4.code', error4.code);\n            console.log('typeof bytesRead', typeof bytesRead);\n            console.log('typeof buffer2', typeof buffer2);\n            fs.close(fd, function (error5, wtf) {\n              console.log('fs.close.error5.code', error5.code);\n              console.log('typeof wtf', typeof wtf);\n              fs.readFile(theDirectory, function (error6, buffer3) {\n                console.log('fs.readFile.error6.code', error6.code);\n                console.log('typeof buffer3', typeof buffer3);\n                fs.readFile('notExists', function (error7, buffer4) {\n                  console.log('fs.readFile.error7.code', error7.code);\n                  console.log('typeof buffer4', typeof buffer4);\n                  const buffer5 = Buffer.alloc(1024);\n                  fs.writeFile(\n                    theFile + '/canNotWrite',\n                    buffer5,\n                    function (error8, wtf2) {\n                      assert(\n                        error8.code === 'ENOENT' || error8.code === 'ENOTDIR'\n                      );\n                      console.log('typeof wtf2', typeof wtf2);\n                      fs.readdir(theFile, function (error9, list) {\n                        console.log('fs.readdir.error9.code', error9.code);\n                        console.log('typeof list', typeof list);\n                        fs.readdir('notExists', function (error10, list2) {\n                          console.log('fs.readdir.error10.code', error10.code);\n                          console.log('typeof list2', typeof list2);\n                          fs.exists('notExists', function (value, wtf3) {\n                            console.log('value', value);\n                            console.log('typeof wtf3', typeof wtf3);\n                            fs.realpath('notExists', function (error11, real) {\n                              console.log(\n                                'fs.realpath.error11.code',\n                                error11.code\n                              );\n                              console.log('typeof real', typeof real);\n                              test02();\n                            });\n                            console.log('after fs.realpath');\n                          });\n                          console.log('after fs.exists');\n                        });\n                        console.log('after fs.readdir(notExists)');\n                      });\n                      console.log('after fs.readdir(theFile)');\n                    }\n                  );\n                  console.log('after fs.writeFile');\n                });\n                console.log('after fs.readFile(notExists)');\n              });\n              console.log('after fs.readFile(theDirectory)');\n            });\n            console.log('after fs.close');\n          }\n        );\n        console.log('after fs.read');\n      });\n      console.log('after fs.fstat');\n    });\n    console.log('after fs.open');\n  });\n  console.log('after fs.stat');\n}\n\nfunction test02() {\n  console.log('<<< test02 >>>');\n\n  const stats = fs.statSync(theFile);\n  console.log('stats.size', stats.size);\n  const fd = fs.openSync(theFile, 'r');\n  const fstats = fs.fstatSync(fd);\n  console.log('fstats.size', fstats.size);\n  const buffer = Buffer.alloc(stats.size);\n  const bytesRead = fs.readSync(fd, buffer, 0, buffer.length);\n  console.log('bytesRead', bytesRead);\n  const data = buffer.toString('utf8', 0, buffer.length);\n  console.log('data', data);\n  fs.closeSync(fd);\n  test03();\n}\n\nfunction test03() {\n  console.log('<<< test03 >>>');\n\n  const stats = fs.statSync(theFile);\n  console.log('stats.size', stats.size);\n  const fd = fs.openSync(theFile, 'r');\n  const fstats = fs.fstatSync(fd);\n  console.log('fstats.size', fstats.size);\n  const buffer = Buffer.alloc(6);\n  let bytesRead = fs.readSync(fd, buffer, 0, 6);\n  console.log('bytesRead_a', bytesRead, 'buffer', buffer[0], buffer[1]);\n  bytesRead = fs.readSync(fd, buffer, 0, 6);\n  console.log('bytesRead_b', bytesRead, 'buffer', buffer[0], buffer[1]);\n  bytesRead = fs.readSync(fd, buffer, 1, 5);\n  console.log('bytesRead_c', bytesRead, 'buffer', buffer[1], buffer[2]);\n  try {\n    bytesRead = fs.readSync(fd, buffer, 1, 6);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log('bytesRead_d', bytesRead, 'buffer', buffer[1], buffer[2]);\n  bytesRead = fs.readSync(fd, buffer, 5, 1);\n  console.log('bytesRead_e', bytesRead, 'buffer', buffer[4], buffer[5]);\n  try {\n    bytesRead = fs.readSync(fd, buffer, 6, 0);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log('bytesRead_f', bytesRead, 'buffer', buffer[4], buffer[5]);\n  try {\n    bytesRead = fs.readSync(fd, buffer, -1, 5);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log('bytesRead_g', bytesRead, 'buffer', buffer[4], buffer[5]);\n  try {\n    bytesRead = fs.readSync(fd, buffer, -1, 9);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log('bytesRead_h', bytesRead, 'buffer', buffer[4], buffer[5]);\n  bytesRead = fs.readSync(fd, buffer, 0, 6);\n  console.log('bytesRead_i', bytesRead, 'buffer', buffer[0], buffer[1]);\n  bytesRead = fs.readSync(fd, buffer, 0, 6);\n  console.log('bytesRead_j', bytesRead, 'buffer', buffer[0], buffer[1]);\n  bytesRead = fs.readSync(fd, buffer, 0, 6);\n  console.log('bytesRead_k', bytesRead, 'buffer', buffer[0], buffer[1]);\n  bytesRead = fs.readSync(fd, buffer, 0, 6);\n  console.log('bytesRead_l', bytesRead, 'buffer', buffer[0], buffer[1]);\n  bytesRead = fs.readSync(fd, buffer, 0, 6);\n  console.log('bytesRead_m', bytesRead, 'buffer', buffer[0], buffer[1]);\n  bytesRead = fs.readSync(fd, buffer, 0, 6, 20);\n  console.log('bytesRead_n', bytesRead, 'buffer', buffer[0], buffer[1]);\n  bytesRead = fs.readSync(fd, buffer, 0, 6, 80);\n  console.log('bytesRead_o', bytesRead, 'buffer', buffer[0], buffer[1]);\n  // this does not work properly. TODO some rework of readFromSnapshot is needed\n  // try { bytesRead = fs.readSync(fd, buffer, 424242, 1); } catch (error) { dumpError(error); }\n  // console.log('bytesRead_p', bytesRead, 'buffer', buffer[0], buffer[1]);\n  fs.closeSync(fd);\n  test04();\n}\n\nfunction test04() {\n  const stats = fs.statSync(theDirectory);\n  console.log(stats.mode);\n  const fd = fs.openSync(theDirectory, 'r');\n  const fstats = fs.fstatSync(fd);\n  console.log(fstats.mode);\n  const buffer = Buffer.from([12, 34, 56, 78]);\n  let bytesRead;\n  try {\n    bytesRead = fs.readSync(fd, buffer, 0, 6);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log(bytesRead, buffer[0], buffer[1]);\n  try {\n    bytesRead = fs.readSync(fd, buffer, 6, 0);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log(bytesRead, buffer[0], buffer[1]);\n  try {\n    bytesRead = fs.readSync(fd, buffer, -1, 3);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log(bytesRead, buffer[0], buffer[1]);\n  try {\n    bytesRead = fs.readSync(fd, buffer, 0, 4);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log(bytesRead, buffer[0], buffer[1]);\n  fs.closeSync(fd);\n  test05();\n}\n\nfunction test05() {\n  const fd = 'incorrect fd as string';\n  const buffer = Buffer.from([12, 34, 56, 78]);\n  let bytesRead;\n  try {\n    bytesRead = fs.readSync(fd, buffer, 0, 6);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log(bytesRead, buffer[0], buffer[1]);\n  try {\n    console.log(fs.fstatSync(fd));\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log(bytesRead, buffer[0], buffer[1]);\n  try {\n    fs.closeSync(fd);\n  } catch (error) {\n    dumpError(error);\n  }\n  test06();\n}\n\nfunction test06() {\n  const fd = 7890;\n  const buffer = Buffer.from([12, 34, 56, 78]);\n  let bytesRead;\n  try {\n    bytesRead = fs.readSync(fd, buffer, 0, 6);\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log(bytesRead, buffer[0], buffer[1]);\n  try {\n    console.log(fs.fstatSync(fd));\n  } catch (error) {\n    dumpError(error);\n  }\n  console.log(bytesRead, buffer[0], buffer[1]);\n  try {\n    fs.closeSync(fd);\n    console.log('EBADF: bad file descriptor');\n  } catch (error) {\n    dumpError(error);\n  }\n  test07();\n}\n\nfunction test07() {\n  console.log('before createReadStream');\n  const rs = fs.createReadStream(theFile);\n  console.log('after createReadStream');\n\n  rs.on('open', function () {\n    console.log('open');\n  });\n\n  rs.on('readable', function () {\n    console.log('before read');\n    let r = rs.read();\n    console.log('after read');\n    if (!r) {\n      r = 'null';\n    } else if (r.length >= 2) {\n      console.log('length:', r.length);\n      r = r[0].toString() + ', ' + r[1].toString();\n    }\n    console.log('readable:', r);\n  });\n\n  rs.on('end', function () {\n    console.log('end');\n  });\n}\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer-2/test-z-asset.css",
    "content": ".header {\n  background: #444;\n}\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer-3/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(\n  right,\n  'true\\n' +\n    'false\\n' +\n    'Cannot write to packaged file\\n' +\n    'true\\n' +\n    'closed\\n' +\n    'false\\n' +\n    'Cannot write to packaged file\\n' +\n    'Cannot write to packaged file\\n' +\n    'undefined\\n' +\n    'Cannot write to packaged file\\n' +\n    'undefined\\n'\n);\n\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer-3/test-x-index.js",
    "content": "/* eslint-disable no-buffer-constructor */\n/* eslint-disable max-statements-per-line */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar theFile = path.join(__dirname, 'test-z-asset.css');\n\ntest01();\n\nfunction test01() {\n  fs.open(theFile, 'w+', function (error, fd) {\n    console.log(error === null);\n    var buffer = Buffer.from('FOO');\n    fs.write(fd, buffer, 0, buffer.length, null, function (error2) {\n      console.log(error2 === null);\n      if (error2) console.log(error2.message);\n      fs.close(fd, function (error3) {\n        console.log(error3 === null);\n        console.log('closed');\n        fs.writeFile(theFile, 'BAR BAZ', function (error4) {\n          console.log(error4 === null);\n          if (error4) console.log(error4.message);\n          test02();\n        });\n      });\n    });\n  });\n}\n\nfunction test02() {\n  var fd = fs.openSync(theFile, 'w+');\n  var buffer = Buffer.from('QUX BARABAZ');\n  var bytesWritten;\n  try {\n    bytesWritten = fs.writeSync(fd, buffer, 0, buffer.length);\n  } catch (error) {\n    console.log(error.message);\n  }\n  console.log(bytesWritten);\n  fs.closeSync(fd);\n  try {\n    bytesWritten = fs.writeFileSync(theFile, 'GARAQUX');\n  } catch (error) {\n    console.log(error.message);\n  }\n  console.log(bytesWritten);\n}\n"
  },
  {
    "path": "test/test-50-fs-runtime-layer-3/test-z-asset.css",
    "content": ".header {\n  background: #444;\n}\n"
  },
  {
    "path": "test/test-50-global-object/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-global-object/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"scripts\": \"test-y-*\"\n  }\n}\n"
  },
  {
    "path": "test/test-50-global-object/test-x-index.js",
    "content": "/* eslint-disable no-useless-concat */\n\n'use strict';\n\nvar theA = './test-y-resolve-A.js';\nvar theB = './test-y-' + 'resolve-B.js';\n\nrequire(theA).toString();\nrequire(theB).toString();\n"
  },
  {
    "path": "test/test-50-global-object/test-y-resolve-A.js",
    "content": "'use strict';\n\nglobal.x = 42;\nconsole.log(x);\n"
  },
  {
    "path": "test/test-50-global-object/test-y-resolve-B.js",
    "content": "'use strict';\n\nglobal.y = 84;\nconsole.log(y);\n"
  },
  {
    "path": "test/test-50-inspect/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nutils.spawn.sync('./' + path.basename(output), ['--inspect'], {\n  cwd: path.dirname(output),\n  env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },\n  stdio: 'pipe',\n  expect: 9,\n});\n\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-inspect/test-x-index.js",
    "content": "'use strict';\n\nsetTimeout(function () {\n  console.log('ok');\n}, 3000);\n"
  },
  {
    "path": "test/test-50-invalid/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(['--target', target, '--output', 'no-output', '12345'], {\n  stdio: inspect,\n  expect: 2,\n});\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.indexOf('Error!') >= 0);\nassert(right.indexOf('does not exist') >= 0);\nassert(right.indexOf('12345') >= 0);\n"
  },
  {
    "path": "test/test-50-invalid-package-json/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(['--target', target, '--output', 'no-output', '.'], {\n  stdio: inspect,\n  expect: 2,\n});\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.indexOf('Error!') >= 0);\nassert(right.indexOf('does not exist') >= 0);\nassert(right.indexOf('package.json') >= 0);\n"
  },
  {
    "path": "test/test-50-invalid-package-json-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst path = require('path');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(\n  ['--target', target, '--output', output, input],\n  inspect\n);\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.indexOf('Warning') >= 0);\nassert(right.indexOf(\"Entry 'main' not found\") >= 0);\nassert(right.indexOf('crusader' + path.sep + 'package.json') >= 0);\n\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-invalid-package-json-2/test-x-index.js",
    "content": "'use strict';\n\nrequire('crusader');\n"
  },
  {
    "path": "test/test-50-invalid-package-json-bin/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(['--target', target, '--output', 'no-output', '.'], {\n  stdio: inspect,\n  expect: 2,\n});\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.indexOf('Error!') >= 0);\nassert(right.indexOf(\"Property 'bin' does not exist\") >= 0);\nassert(right.indexOf('package.json') >= 0);\n"
  },
  {
    "path": "test/test-50-invalid-package-json-bin/package.json",
    "content": "{\n  \"name\": \"busboy\"\n}\n"
  },
  {
    "path": "test/test-50-invalid-package-json-bin-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(['--target', target, '--output', 'no-output', '.'], {\n  stdio: inspect,\n  expect: 2,\n});\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.indexOf('Error!') >= 0);\nassert(right.indexOf('does not exist') >= 0);\nassert(right.indexOf('package.json') >= 0);\n"
  },
  {
    "path": "test/test-50-invalid-package-json-bin-2/package.json",
    "content": "{\n  \"name\": \"busboy\",\n  \"bin\": \"bin.js\"\n}\n"
  },
  {
    "path": "test/test-50-invalid-unknown-token/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(\n  ['--target', 'node7-x6', '--output', 'no-output', 'test-x-index.js'],\n  { stdio: inspect, expect: 2 }\n);\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\nassert(right.indexOf('Error!') >= 0);\nassert(right.indexOf('node7-x6') >= 0);\nassert(right.indexOf('Unknown token') >= 0);\n"
  },
  {
    "path": "test/test-50-invalid-unknown-token/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-50-many-arrow-functions/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nconst arch = process.arch; // TODO extract arch from `target` once it contains\nif (arch === 'arm') return;\nconst version1 = process.version;\nif (/^(node|v)?0/.test(version1)) return;\nconst version2 = target;\nif (/^(node|v)?0/.test(version2)) return;\n\nlet left, right;\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-many-arrow-functions/test-x-index.js",
    "content": "'use strict';\n\nfunction EventEmitter() {\n  this.listeners = [];\n}\nEventEmitter.prototype.on = function (name, listener) {\n  this.listeners.push(listener);\n};\nEventEmitter.prototype.emit = function (name, data) {\n  this.listeners.some((listener) => {\n    listener(data);\n  });\n};\nconst ee = new EventEmitter();\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.on('message', (data) => {\n  console.log(data);\n});\nee.emit('message', 'hooray');\n"
  },
  {
    "path": "test/test-50-many-arrow-functions/test-z-creator.js",
    "content": "'use strict';\n\nlet s =\n  'function EventEmitter () {\\n' +\n  '  this.listeners = [];\\n' +\n  '}\\n' +\n  'EventEmitter.prototype.on = function (name, listener) {\\n' +\n  '  this.listeners.push(listener);\\n' +\n  '};\\n' +\n  'EventEmitter.prototype.emit = function (name, data) {\\n' +\n  '  this.listeners.some((listener) => {\\n' +\n  '    listener(data);\\n' +\n  '  });\\n' +\n  '};\\n' +\n  'const ee = new EventEmitter();\\n';\n\nfor (let i = 0; i < 140; i += 1) {\n  s += \"ee.on('message', (data) => {\\n  console.log(data);\\n});\\n\";\n}\n\ns += \"ee.emit('message', 'hooray');\\n\";\n\ns = \"'use strict';\\n\\n\" + s;\n\nrequire('fs').writeFileSync('test-x-index.js', s);\n"
  },
  {
    "path": "test/test-50-many-callbacks/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nif (process.arch === 'arm') return;\n\nlet left, right;\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-many-callbacks/test-x-index.js",
    "content": "'use strict';\n\nsetTimeout(function () {\n  setTimeout(function () {\n    setTimeout(function () {\n      setTimeout(function () {\n        setTimeout(function () {\n          setTimeout(function () {\n            setTimeout(function () {\n              setTimeout(function () {\n                setTimeout(function () {\n                  setTimeout(function () {\n                    setTimeout(function () {\n                      setTimeout(function () {\n                        setTimeout(function () {\n                          setTimeout(function () {\n                            setTimeout(function () {\n                              setTimeout(function () {\n                                setTimeout(function () {\n                                  setTimeout(function () {\n                                    setTimeout(function () {\n                                      setTimeout(function () {\n                                        setTimeout(function () {\n                                          setTimeout(function () {\n                                            setTimeout(function () {\n                                              setTimeout(function () {\n                                                setTimeout(function () {\n                                                  setTimeout(function () {\n                                                    setTimeout(function () {\n                                                      setTimeout(function () {\n                                                        setTimeout(function () {\n                                                          setTimeout(\n                                                            function () {\n                                                              setTimeout(\n                                                                function () {\n                                                                  setTimeout(\n                                                                    function () {\n                                                                      setTimeout(\n                                                                        function () {\n                                                                          setTimeout(\n                                                                            function () {\n                                                                              setTimeout(\n                                                                                function () {\n                                                                                  setTimeout(\n                                                                                    function () {\n                                                                                      setTimeout(\n                                                                                        function () {\n                                                                                          setTimeout(\n                                                                                            function () {\n                                                                                              setTimeout(\n                                                                                                function () {\n                                                                                                  setTimeout(\n                                                                                                    function () {\n                                                                                                      setTimeout(\n                                                                                                        function () {\n                                                                                                          setTimeout(\n                                                                                                            function () {\n                                                                                                              setTimeout(\n                                                                                                                function () {\n                                                                                                                  setTimeout(\n                                                                                                                    function () {\n                                                                                                                      setTimeout(\n                                                                                                                        function () {\n                                                                                                                          setTimeout(\n                                                                                                                            function () {\n                                                                                                                              setTimeout(\n                                                                                                                                function () {\n                                                                                                                                  setTimeout(\n                                                                                                                                    function () {\n                                                                                                                                      setTimeout(\n                                                                                                                                        function () {\n                                                                                                                                          setTimeout(\n                                                                                                                                            function () {\n                                                                                                                                              setTimeout(\n                                                                                                                                                function () {\n                                                                                                                                                  setTimeout(\n                                                                                                                                                    function () {\n                                                                                                                                                      setTimeout(\n                                                                                                                                                        function () {\n                                                                                                                                                          setTimeout(\n                                                                                                                                                            function () {\n                                                                                                                                                              setTimeout(\n                                                                                                                                                                function () {\n                                                                                                                                                                  setTimeout(\n                                                                                                                                                                    function () {\n                                                                                                                                                                      setTimeout(\n                                                                                                                                                                        function () {\n                                                                                                                                                                          setTimeout(\n                                                                                                                                                                            function () {\n                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                function () {\n                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                    function () {\n                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                        function () {\n                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                            function () {\n                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                function () {\n                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                                                                                                                                      setTimeout(\n                                                                                                                                                                                                                                                                                                                                        function () {\n                                                                                                                                                                                                                                                                                                                                          setTimeout(\n                                                                                                                                                                                                                                                                                                                                            function () {\n                                                                                                                                                                                                                                                                                                                                              setTimeout(\n                                                                                                                                                                                                                                                                                                                                                function () {\n                                                                                                                                                                                                                                                                                                                                                  setTimeout(\n                                                                                                                                                                                                                                                                                                                                                    function () {\n                                                                                                                                                                                                                                                                                                                                                      console.log(\n                                                                                                                                                                                                                                                                                                                                                        'test'\n                                                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                                                },\n                                                                                                                                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                                                            },\n                                                                                                                                                                                                                                                                                                                                            0\n                                                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                                                        },\n                                                                                                                                                                                                                                                                                                                                        0\n                                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                                },\n                                                                                                                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                                            },\n                                                                                                                                                                                                                                                                                                                            0\n                                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                                        },\n                                                                                                                                                                                                                                                                                                                        0\n                                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                                },\n                                                                                                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                                            },\n                                                                                                                                                                                                                                                                                                            0\n                                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                                        },\n                                                                                                                                                                                                                                                                                                        0\n                                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                                },\n                                                                                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                                            },\n                                                                                                                                                                                                                                                                                            0\n                                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                                        },\n                                                                                                                                                                                                                                                                                        0\n                                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                                },\n                                                                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                                            },\n                                                                                                                                                                                                                                                                            0\n                                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                                        },\n                                                                                                                                                                                                                                                                        0\n                                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                                },\n                                                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                                            },\n                                                                                                                                                                                                                                                            0\n                                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                                        },\n                                                                                                                                                                                                                                                        0\n                                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                                },\n                                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                                            },\n                                                                                                                                                                                                                                            0\n                                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                                        },\n                                                                                                                                                                                                                                        0\n                                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                                },\n                                                                                                                                                                                                                                0\n                                                                                                                                                                                                                              );\n                                                                                                                                                                                                                            },\n                                                                                                                                                                                                                            0\n                                                                                                                                                                                                                          );\n                                                                                                                                                                                                                        },\n                                                                                                                                                                                                                        0\n                                                                                                                                                                                                                      );\n                                                                                                                                                                                                                    },\n                                                                                                                                                                                                                    0\n                                                                                                                                                                                                                  );\n                                                                                                                                                                                                                },\n                                                                                                                                                                                                                0\n                                                                                                                                                                                                              );\n                                                                                                                                                                                                            },\n                                                                                                                                                                                                            0\n                                                                                                                                                                                                          );\n                                                                                                                                                                                                        },\n                                                                                                                                                                                                        0\n                                                                                                                                                                                                      );\n                                                                                                                                                                                                    },\n                                                                                                                                                                                                    0\n                                                                                                                                                                                                  );\n                                                                                                                                                                                                },\n                                                                                                                                                                                                0\n                                                                                                                                                                                              );\n                                                                                                                                                                                            },\n                                                                                                                                                                                            0\n                                                                                                                                                                                          );\n                                                                                                                                                                                        },\n                                                                                                                                                                                        0\n                                                                                                                                                                                      );\n                                                                                                                                                                                    },\n                                                                                                                                                                                    0\n                                                                                                                                                                                  );\n                                                                                                                                                                                },\n                                                                                                                                                                                0\n                                                                                                                                                                              );\n                                                                                                                                                                            },\n                                                                                                                                                                            0\n                                                                                                                                                                          );\n                                                                                                                                                                        },\n                                                                                                                                                                        0\n                                                                                                                                                                      );\n                                                                                                                                                                    },\n                                                                                                                                                                    0\n                                                                                                                                                                  );\n                                                                                                                                                                },\n                                                                                                                                                                0\n                                                                                                                                                              );\n                                                                                                                                                            },\n                                                                                                                                                            0\n                                                                                                                                                          );\n                                                                                                                                                        },\n                                                                                                                                                        0\n                                                                                                                                                      );\n                                                                                                                                                    },\n                                                                                                                                                    0\n                                                                                                                                                  );\n                                                                                                                                                },\n                                                                                                                                                0\n                                                                                                                                              );\n                                                                                                                                            },\n                                                                                                                                            0\n                                                                                                                                          );\n                                                                                                                                        },\n                                                                                                                                        0\n                                                                                                                                      );\n                                                                                                                                    },\n                                                                                                                                    0\n                                                                                                                                  );\n                                                                                                                                },\n                                                                                                                                0\n                                                                                                                              );\n                                                                                                                            },\n                                                                                                                            0\n                                                                                                                          );\n                                                                                                                        },\n                                                                                                                        0\n                                                                                                                      );\n                                                                                                                    },\n                                                                                                                    0\n                                                                                                                  );\n                                                                                                                },\n                                                                                                                0\n                                                                                                              );\n                                                                                                            },\n                                                                                                            0\n                                                                                                          );\n                                                                                                        },\n                                                                                                        0\n                                                                                                      );\n                                                                                                    },\n                                                                                                    0\n                                                                                                  );\n                                                                                                },\n                                                                                                0\n                                                                                              );\n                                                                                            },\n                                                                                            0\n                                                                                          );\n                                                                                        },\n                                                                                        0\n                                                                                      );\n                                                                                    },\n                                                                                    0\n                                                                                  );\n                                                                                },\n                                                                                0\n                                                                              );\n                                                                            },\n                                                                            0\n                                                                          );\n                                                                        },\n                                                                        0\n                                                                      );\n                                                                    },\n                                                                    0\n                                                                  );\n                                                                },\n                                                                0\n                                                              );\n                                                            },\n                                                            0\n                                                          );\n                                                        }, 0);\n                                                      }, 0);\n                                                    }, 0);\n                                                  }, 0);\n                                                }, 0);\n                                              }, 0);\n                                            }, 0);\n                                          }, 0);\n                                        }, 0);\n                                      }, 0);\n                                    }, 0);\n                                  }, 0);\n                                }, 0);\n                              }, 0);\n                            }, 0);\n                          }, 0);\n                        }, 0);\n                      }, 0);\n                    }, 0);\n                  }, 0);\n                }, 0);\n              }, 0);\n            }, 0);\n          }, 0);\n        }, 0);\n      }, 0);\n    }, 0);\n  }, 0);\n}, 0);\n"
  },
  {
    "path": "test/test-50-many-callbacks/test-z-creator.js",
    "content": "'use strict';\n\nlet s = \"console.log('test');\\n\";\n\nfor (let i = 0; i < 100; i += 1) {\n  s = 'setTimeout(function () {\\n' + s + '}, 0);\\n';\n}\n\ns = \"'use strict';\\n\\n\" + s;\n\nrequire('fs').writeFileSync('test-x-index.js', s);\n"
  },
  {
    "path": "test/test-50-may-exclude/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-may-exclude/test-x-index.js",
    "content": "'use strict';\n\n// 1\n\nvar error1;\n\nfunction func1() {\n  require.resolve('not-exists-1', 'may-exclude');\n}\n\ntry {\n  func1();\n} catch (e) {\n  error1 = e;\n}\n\n// 2\n\nvar error2;\n\nfunction func2() {\n  require.resolve('not-exists-2', 'may-exclude');\n}\n\ntry {\n  func2();\n} catch (e) {\n  error2 = e;\n}\n\n// 3\n\nvar error3;\n\ntry {\n  require.resolve('not-exists-3');\n} catch (e) {\n  error3 = e;\n}\n\n// 4\n\nvar error4;\n\ntry {\n  if (process.env.HELLO !== 'WORLD') {\n    require.resolve('not-exists-4');\n  }\n} catch (e) {\n  error4 = e;\n}\n\nconsole.log(\n  [\n    error1.message.split('\\n')[0],\n    error1.code,\n    JSON.stringify(Object.assign(error1, { requireStack: undefined })),\n    error2.message.split('\\n')[0],\n    error2.code,\n    JSON.stringify(Object.assign(error2, { requireStack: undefined })),\n    error3.message.split('\\n')[0],\n    error3.code,\n    JSON.stringify(Object.assign(error3, { requireStack: undefined })),\n    error4.message.split('\\n')[0],\n    error4.code,\n    JSON.stringify(Object.assign(error4, { requireStack: undefined })),\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-may-exclude-must-exclude/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst standard = 'stdout';\n\nlet right;\n\nconst inspect =\n  standard === 'stdout'\n    ? ['inherit', 'pipe', 'inherit']\n    : ['inherit', 'inherit', 'pipe'];\n\nright = utils.pkg.sync(\n  ['--debug', '--target', target, '--output', output, input],\n  inspect\n);\n\nassert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\n\nright =\n  right\n    .split('\\n')\n    .filter(function (line) {\n      return line.indexOf(' [debug] ') >= 0 || line.indexOf(' Warning ') >= 0;\n    })\n    .filter(function (line) {\n      return (\n        line.indexOf('Targets:') < 0 &&\n        line.indexOf('added to queue') < 0 &&\n        line.indexOf('was included') < 0\n      );\n    })\n    .map(function (line) {\n      if (line.indexOf('Cannot find module') >= 0) {\n        return line.split(' from ')[0];\n      } else return line;\n    })\n    .join('\\n') + '\\n';\n\nassert.deepStrictEqual(right.split('\\n').slice(0, 16), [\n  \"> Warning Cannot resolve 'reqResSomeVar'\",\n  \"> [debug] Cannot resolve 'reqResSomeVarMay'\",\n  \"> Warning Malformed requirement for 'reqResSomeVar'\",\n  \"> Warning Malformed requirement for 'reqResSomeVar'\",\n\n  \"> Warning Cannot resolve 'reqSomeVar'\",\n  \"> [debug] Cannot resolve 'reqSomeVarMay'\",\n  \"> Warning Malformed requirement for 'reqSomeVar'\",\n  \"> Warning Malformed requirement for 'reqSomeVar'\",\n\n  \"> [debug] Cannot resolve 'tryReqResSomeVar'\",\n  \"> [debug] Cannot resolve 'tryReqResSomeVarMay'\",\n  \"> [debug] Cannot resolve 'tryReqSomeVar'\",\n  \"> [debug] Cannot resolve 'tryReqSomeVarMay'\",\n\n  \"> [debug] Cannot find module 'reqResSomeLit'\",\n  \"> [debug] Cannot find module 'reqResSomeLitMay'\",\n  \"> [debug] Cannot find module 'reqSomeLit'\",\n  \"> [debug] Cannot find module 'reqSomeLitMay'\",\n]);\n\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-may-exclude-must-exclude/test-x-index.js",
    "content": "/* eslint-disable max-statements-per-line */\n/* eslint-disable no-empty */\n\n'use strict';\n\ntry {\n  require.resolve('reqResSomeLit');\n} catch (_) {}\ntry {\n  require.resolve('reqResSomeLitMay', 'may-exclude');\n} catch (_) {}\ntry {\n  require.resolve('reqResSomeLitMust', 'must-exclude');\n} catch (_) {}\ntry {\n  require('reqSomeLit');\n} catch (_) {}\ntry {\n  require('reqSomeLitMay', 'may-exclude');\n} catch (_) {}\ntry {\n  require('reqSomeLitMust', 'must-exclude');\n} catch (_) {}\n\nvar tryReqResSomeVar = 'some';\nvar tryReqResSomeVarMay = 'some';\nvar tryReqResSomeVarMust = 'some';\n\nvar tryReqSomeVar = 'some';\nvar tryReqSomeVarMay = 'some';\nvar tryReqSomeVarMust = 'some';\n\ntry {\n  require.resolve(tryReqResSomeVar);\n} catch (_) {}\ntry {\n  require.resolve(tryReqResSomeVarMay, 'may-exclude');\n} catch (_) {}\ntry {\n  require.resolve(tryReqResSomeVarMust, 'must-exclude');\n} catch (_) {}\ntry {\n  require(tryReqSomeVar);\n} catch (_) {}\ntry {\n  require(tryReqSomeVarMay, 'may-exclude');\n} catch (_) {}\ntry {\n  require(tryReqSomeVarMust, 'must-exclude');\n} catch (_) {}\n\nvar reqResSomeVar = 'some';\nvar reqResSomeVarMay = 'some';\nvar reqResSomeVarMust = 'some';\n\nvar reqSomeVar = 'some';\nvar reqSomeVarMay = 'some';\nvar reqSomeVarMust = 'some';\n\nrequire.resolve(reqResSomeVar);\nrequire.resolve(reqResSomeVarMay, 'may-exclude');\nrequire.resolve(reqResSomeVarMust, 'must-exclude');\nrequire.resolve(reqResSomeVar, reqResSomeVar);\nrequire.resolve(reqResSomeVar, 'can-can');\nrequire(reqSomeVar);\nrequire(reqSomeVarMay, 'may-exclude');\nrequire(reqSomeVarMust, 'must-exclude');\nrequire(reqSomeVar, reqSomeVar);\nrequire(reqSomeVar, 'can-can');\n\nrequire.resolve('./test-y-index.js');\nrequire('./test-y-index.js');\n"
  },
  {
    "path": "test/test-50-may-exclude-must-exclude/test-y-index.js",
    "content": "'use strict';\n\nmodule.exports = 'hello';\n"
  },
  {
    "path": "test/test-50-module-parent/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nleft = left.split('\\n');\nright = right.split('\\n');\n// right may have less lines, premature exit,\n// less trusted, so using left.length here\nfor (let i = 0; i < left.length; i += 1) {\n  assert.strictEqual(left[i], right[i]);\n}\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-module-parent/test-x-index.js",
    "content": "'use strict';\n\nrequire('./test-y-fish-A.js');\nrequire('./test-y-fish-B.js');\n"
  },
  {
    "path": "test/test-50-module-parent/test-y-fish-A.js",
    "content": "'use strict';\n\nconsole.log('test-y-fish-A');\nconsole.log(require('./test-y-fish-C'));\n"
  },
  {
    "path": "test/test-50-module-parent/test-y-fish-B.js",
    "content": "'use strict';\n\nconsole.log('test-y-fish-B');\nconsole.log(require('./test-y-fish-C'));\n"
  },
  {
    "path": "test/test-50-module-parent/test-y-fish-C.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar mpfn = module.parent.filename;\nmodule.exports = mpfn.split(path.sep).slice(-2).join(path.sep);\n"
  },
  {
    "path": "test/test-50-mountpoints/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet right;\nutils.mkdirp.sync(path.dirname(output));\nutils.mkdirp.sync(path.join(path.dirname(output), 'plugins-D-ext'));\n\nfs.writeFileSync(\n  path.join(path.dirname(output), 'plugins-D-ext/test-y-require-D.js'),\n  fs.readFileSync('./plugins-D-ext/test-y-require-D.js')\n);\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(\n  right,\n  'I am C\\n' +\n    'I am D\\n' +\n    'test-x-index.js\\n' +\n    'test-y-common.js\\n' +\n    'plugins-C-int\\n' +\n    'plugins-D-ext\\n'\n);\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-mountpoints/plugins-C-int/test-y-require-C.js",
    "content": "'use strict';\n\nvar common = require('../test-y-common.js');\n\ncommon('I am C');\n"
  },
  {
    "path": "test/test-50-mountpoints/plugins-D-ext/test-y-require-D.js",
    "content": "'use strict';\n\nvar assert = require('assert');\nvar common = require('../test-y-common.js');\n\nif (__dirname.indexOf('snapshot') < 0) {\n  console.log(__dirname);\n  assert(false);\n}\n\ncommon('I am D');\n"
  },
  {
    "path": "test/test-50-mountpoints/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nrequire('./plugins-C-int/test-y-require-C.js');\n\n// require(path.join(path.dirname(process.execPath), \"plugins-D-ext/test-y-require-D.js\"));\n\nvar myDirectory = path.dirname(process.execPath);\n\nprocess.pkg.mount(\n  path.join(__dirname, 'plugins-D-ext'),\n  path.join(myDirectory, 'plugins-D-ext')\n);\n\nrequire('./plugins-D-ext/test-y-require-D.js'.slice());\n\nconsole.log(fs.readdirSync(__dirname).join('\\n'));\n"
  },
  {
    "path": "test/test-50-mountpoints/test-y-common.js",
    "content": "'use strict';\n\nmodule.exports = function (s) {\n  console.log(s);\n};\n"
  },
  {
    "path": "test/test-50-native-addon/lib/time.node",
    "content": "module.exports = 'test';\n"
  },
  {
    "path": "test/test-50-native-addon/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nfs.writeFileSync(\n  path.join(path.dirname(output), 'time.node'),\n  fs.readFileSync('./lib/time.node')\n);\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-native-addon/test-x-index.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Module = require('module');\nModule._extensions['.node'] = Module._extensions['.js'];\nconsole.log(fs.existsSync(path.join(__dirname, 'lib/time.node')));\nconsole.log(require('./lib/time.node'));\n"
  },
  {
    "path": "test/test-50-native-addon-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet left, right;\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-native-addon-2/test-x-index.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Module = require('module');\nModule._extensions['.node'] = Module._extensions['.js'];\nconsole.log(\n  fs.existsSync(path.join(__dirname, 'node_modules/dependency/time.node'))\n);\nconsole.log(require('dependency/time.node'));\n"
  },
  {
    "path": "test/test-50-native-addon-3/lib/community/test-y-index.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar Module = require('module');\nModule._extensions['.node'] = Module._extensions['.js'];\nconsole.log(require('dependency/time-d.node'));\nconsole.log(require('../time-x.node'));\nconsole.log(require('./time-y.node'));\n"
  },
  {
    "path": "test/test-50-native-addon-3/lib/community/time-y.node",
    "content": "module.exports = 'time-y';\n"
  },
  {
    "path": "test/test-50-native-addon-3/lib/enterprise/test-z-index.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar Module = require('module');\nModule._extensions['.node'] = Module._extensions['.js'];\nconsole.log(require('dependency/time-d.node'));\nconsole.log(require('../time-x.node'));\nconsole.log(require('../../lib/enterprise/time-z.node'));\n"
  },
  {
    "path": "test/test-50-native-addon-3/lib/enterprise/time-z.node",
    "content": "module.exports = 'time-z';\n"
  },
  {
    "path": "test/test-50-native-addon-3/lib/test-x-index.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Module = require('module');\nModule._extensions['.node'] = Module._extensions['.js'];\nconsole.log(\n  fs.existsSync(path.join(__dirname, '../node_modules/dependency/time-d.node'))\n);\nconsole.log(require('dependency/time-d.node'));\nconsole.log(fs.existsSync(path.join(__dirname, 'time-x.node')));\nconsole.log(require('./time-x.node'));\nconsole.log(fs.existsSync(path.join(__dirname, 'community/time-y.node')));\nconsole.log(require('./community/time-y.node'));\nconsole.log(\n  fs.existsSync(path.join(__dirname, '../lib/enterprise/time-z.node'))\n);\nconsole.log(require('../lib/enterprise/time-z.node'));\n"
  },
  {
    "path": "test/test-50-native-addon-3/lib/time-x.node",
    "content": "module.exports = 'test';\n"
  },
  {
    "path": "test/test-50-native-addon-3/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst pairs = [\n  { input: './lib/test-x-index.js', output: './lib/test-output.exe' },\n  { input: './lib/test-x-index.js', output: './lib/community/test-output.exe' },\n  {\n    input: './lib/test-x-index.js',\n    output: './lib/enterprise/test-output.exe',\n  },\n  {\n    input: './lib/community/test-y-index.js',\n    output: './lib/community/test-output.exe',\n  },\n  {\n    input: './lib/enterprise/test-z-index.js',\n    output: './lib/enterprise/test-output.exe',\n  },\n];\n\npairs.some(function (pair) {\n  const input = pair.input;\n  const output = pair.output;\n\n  let left, right;\n\n  left = utils.spawn.sync('node', [path.basename(input)], {\n    cwd: path.dirname(input),\n  });\n\n  utils.pkg.sync(['--target', target, '--output', output, input]);\n\n  right = utils.spawn.sync('./' + path.basename(output), [], {\n    cwd: path.dirname(output),\n  });\n\n  assert.strictEqual(left, right);\n  utils.vacuum.sync(output);\n});\n"
  },
  {
    "path": "test/test-50-native-addon-4/lib/time.node",
    "content": "module.exports = 'test';\n"
  },
  {
    "path": "test/test-50-native-addon-4/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-native-addon-4/test-x-index.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Module = require('module');\nModule._extensions['.node'] = Module._extensions['.js'];\nconsole.log(fs.existsSync(path.join(__dirname, 'lib/time.node')));\nconsole.log(require('./lib/time.node'));\n"
  },
  {
    "path": "test/test-50-no-signature/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst darwin = process.platform === 'darwin';\nif (!darwin) {\n  return;\n}\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output';\n\nlet right;\n\nutils.pkg.sync([\n  '--no-signature',\n  '--target',\n  target,\n  '--output',\n  output,\n  input,\n]);\n\nright = utils.spawn.sync('codesign', ['-dv', './' + path.basename(output)], {\n  stdio: 'pipe',\n  expect: 1,\n});\n\nassert.strictEqual(\n  right.stderr,\n  './test-output: code object is not signed at all\\n'\n);\n\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-no-signature/test-x-index.js",
    "content": "'use strict';\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-50-no-super-in-constructor/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nif (/^(node|v)?0/.test(target)) return;\nif (/^(node|v)?4/.test(target)) return;\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-no-super-in-constructor/test-x-index.js",
    "content": "'use strict';\n\nvar events = require('events');\nvar util = require('util');\n\nclass UpnpService {\n  constructor() {\n    console.log('ok');\n    events.EventEmitter.call(this);\n  }\n}\n\nutil.inherits(UpnpService, events.EventEmitter);\n\nconst u = new UpnpService();\nif (!u) throw new Error('hello');\n"
  },
  {
    "path": "test/test-50-node-modules-tree/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-node-modules-tree/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nconsole.log(\n  [\n    require('./test-y-fish-A'),\n    require('test-y-fish-B'),\n\n    //  fs.readFileSync(require.resolve(\"./test-y-fish-E\"), \"utf8\"),\n    //  fs.readFileSync(require.resolve(\"test-y-fish-F\"), \"utf8\"),\n    fs.readFileSync(path.join(__dirname, './test-y-fish-G'), 'utf8'),\n    fs.readFileSync(path.join(__dirname, 'test-y-fish-H'), 'utf8'),\n\n    fs.existsSync('./test-y-fish-C').toString(),\n    fs.existsSync('test-y-fish-D').toString(),\n    //  fs.existsSync(require.resolve(\"./test-y-fish-E\")).toString(),\n    //  fs.existsSync(require.resolve(\"test-y-fish-F\")).toString(),\n    fs.existsSync(path.join(__dirname, './test-y-fish-G')).toString(),\n    fs.existsSync(path.join(__dirname, 'test-y-fish-H')).toString(),\n\n    require('test-y-fish-I'), // разница в node_modules\\test-y-fish-I\\index.js\n    require('test-y-fish-J'),\n    JSON.stringify(require('test-y-fish-M')),\n    JSON.stringify(require('test-y-fish-N')),\n    require('test-y-fish-O'),\n    require('test-y-fish-P'),\n\n    require('test-y-fish-R'),\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-A.js",
    "content": "'use strict';\n\nmodule.exports = 'test-y-fish-A-supfile';\n"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-B.js",
    "content": "'use strict';\n\nmodule.exports = 'test-y-fish-B-supfile';\n"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-E",
    "content": "test-y-fish-E-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-F",
    "content": "test-y-fish-F-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-G",
    "content": "test-y-fish-G-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-H",
    "content": "test-y-fish-H-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-I",
    "content": "test-y-fish-I-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-J",
    "content": "test-y-fish-J-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-M",
    "content": "test-y-fish-M-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-N",
    "content": "test-y-fish-N-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-O",
    "content": "test-y-fish-O-supfile"
  },
  {
    "path": "test/test-50-node-modules-tree/test-y-fish-P",
    "content": "test-y-fish-P-supfile"
  },
  {
    "path": "test/test-50-non-ascii/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './АБРАКАДАБРА/test-output.exe'; // cyrillic\n\nlet right;\nutils.mkdirp.sync(path.dirname(output));\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync(output, [], {});\n\nassert.strictEqual(right, '42\\n42\\n');\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-non-ascii/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\nrequire('./test-y-$$');\n"
  },
  {
    "path": "test/test-50-non-ascii/test-y-$$.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-50-not-found-wording/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet right;\nutils.mkdirp.sync(path.dirname(output));\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert(\n  right\n    .split('*****')[0]\n    .indexOf('was not included into executable at compilation stage') >= 0\n);\n\nassert(right.split('*****')[1].indexOf('you want to compile the package') >= 0);\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-not-found-wording/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar name = path.join(__dirname, 'not' + 'exists'); // eslint-disable-line no-useless-concat\n\ntry {\n  fs.readFileSync(name);\n} catch (e) {\n  console.log(e.message);\n}\n\nconsole.log('*****');\n\ntry {\n  require('not-exists');\n} catch (e) {\n  console.log(e.message);\n}\n"
  },
  {
    "path": "test/test-50-not-found-wording-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-not-found-wording-2/test-x-index.js",
    "content": "'use strict';\n\nvar name = 'not-exists';\nvar error1, error2;\n\ntry {\n  require.resolve(name);\n} catch (e) {\n  error1 = e;\n}\n\ntry {\n  require(name);\n} catch (e) {\n  error2 = e;\n}\n\nconsole.log(\n  [\n    error1.message.split('\\n')[0],\n    error1.code,\n    error2.message.split('\\n')[0],\n    error2.code,\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-object-spread/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nif (/^(node|v)?0/.test(target)) return;\nif (/^(node|v)?4/.test(target)) return;\nif (/^(node|v)?6/.test(target)) return;\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-object-spread/test-x-index.js",
    "content": "'use strict';\n\nvar s = { o: 'o', k: 'k' };\nvar { o, ...other } = s;\nvar fn = ({ x, ...y }) => x(y.value);\n\nfn({ x: console.log, value: o + other.k });\n"
  },
  {
    "path": "test/test-50-observe-snapshot-root/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-observe-snapshot-root/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nif (process.platform === 'win32') {\n  var root = path.parse(process.argv[1]).root; // D:\\\\\n  if (fs.statSync(root + 'snapshot').isDirectory()) {\n    var root2 = root.slice(0, 2) + '/';\n    if (fs.statSync(root2 + 'snapshot').isDirectory()) {\n      try {\n        fs.statSync('/snapshot');\n      } catch (error) {\n        if (error.code === 'ENOENT') {\n          console.log('ok');\n        }\n      }\n    }\n  }\n} else {\n  if (fs.statSync('/snapshot').isDirectory()) {\n    try {\n      fs.statSync('K:\\\\snapshot');\n    } catch (error) {\n      if (error.code === 'ENOENT') {\n        console.log('ok');\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "test/test-50-observe-snapshot-root-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-observe-snapshot-root-2/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nif (process.platform === 'win32') {\n  var root = path.parse(process.argv[1]).root; // D:\\\\\n  if (fs.readdirSync(root).indexOf('snapshot') >= 0) {\n    var root2 = root.slice(0, 2) + '/';\n    if (fs.readdirSync(root2).indexOf('snapshot') >= 0) {\n      fs.readdir(root, function (error, entries) {\n        if (error) throw error;\n        if (entries.indexOf('snapshot')) {\n          fs.readdir(root2, function (error2, entries2) {\n            if (error2) throw error2;\n            if (entries2.indexOf('snapshot')) {\n              console.log('ok');\n            }\n          });\n        }\n      });\n    }\n  }\n} else {\n  if (fs.readdirSync('/').indexOf('snapshot') >= 0) {\n    fs.readdir('/', function (error, entries) {\n      if (error) throw error;\n      if (entries.indexOf('snapshot')) {\n        console.log('ok');\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "test/test-50-odd-entrypoint/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst windows = process.platform === 'win32';\nlet input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nif (windows) {\n  input = path.resolve(input).toLowerCase();\n} else {\n  // did not manage to find odd one for unix\n}\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-odd-entrypoint/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-50-package-a-binary/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-a-binary/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar crypto = require('crypto');\n\nfunction sha256(s) {\n  return crypto.createHash('sha256').update(s).digest('hex');\n}\n\nvar file = fs.readFileSync(path.join(__dirname, 'test-y-binary.png'));\nconsole.log(sha256(file)); // 72c388896ca159d734244fcf556cc7e06adb255ff09d5eb721f144066a65d3b0\n"
  },
  {
    "path": "test/test-50-package-json/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-json/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"scripts\": \"test-y-*\"\n  }\n}\n"
  },
  {
    "path": "test/test-50-package-json/test-x-index.js",
    "content": "/* eslint-disable no-useless-concat */\n\n'use strict';\n\nvar theA = './test-y-' + 'resolve-A.js';\nvar theB = './test-y-' + 'resolve-B.txt';\nvar theC = './test-y-' + 'resolve-C.json';\n\nconsole.log(\n  [\n    require(theA).toString(),\n    require(theB).toString(),\n    require(theC).toString(),\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-package-json/test-y-resolve-A.js",
    "content": "'use strict';\n\nmodule.exports = 'test-y-resolve-A';\n"
  },
  {
    "path": "test/test-50-package-json/test-y-resolve-B.txt",
    "content": "module.exports = \"test-y-resolve-B\";\n"
  },
  {
    "path": "test/test-50-package-json/test-y-resolve-C.json",
    "content": "\"test-y-resolve-C\"\n"
  },
  {
    "path": "test/test-50-package-json-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['sub/test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-json-2/package.json",
    "content": "{\n  \"bin\": \"sub/test-x-index.js\",\n  \"pkg\": {\n    \"scripts\": \"./test-y-data.json\"\n  }\n}\n"
  },
  {
    "path": "test/test-50-package-json-2/sub/test-x-index.js",
    "content": "'use strict';\n\nvar dataPath = '../test-y-data.json';\nvar data = require(dataPath);\nconsole.log(data);\n"
  },
  {
    "path": "test/test-50-package-json-2/test-y-data.json",
    "content": "\"test data\"\n"
  },
  {
    "path": "test/test-50-package-json-3/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './test-output.exe';\n\nlet left, right;\n\nleft = utils.spawn.sync('node', ['test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-3/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"patches\": {\n      \"test-x-index.js\": [\n        \"require(__dirname + '/' + dataPath);\",\n        \"require(process.cwd() + '/' + dataPath);\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "test/test-50-package-json-3/test-x-index.js",
    "content": "/* eslint-disable no-path-concat */\n\n'use strict';\n\nvar dataPath = 'test-y-data.json';\nvar data = require(__dirname + '/' + dataPath);\nconsole.log(data);\n"
  },
  {
    "path": "test/test-50-package-json-3/test-y-data.json",
    "content": "\"test data\"\n"
  },
  {
    "path": "test/test-50-package-json-4/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-4/test-x-index.js",
    "content": "'use strict';\n\nrequire('busboy');\nvar dataPath1 = 'busboy/lib/types/test-y-require.js';\nvar data1 = require(dataPath1);\nconsole.log(data1);\n\nrequire('log4js/index.js');\nvar dataPath2 = 'log4js/lib/appenders/test-z-require.js';\nvar data2 = require(dataPath2);\nconsole.log(data2);\n"
  },
  {
    "path": "test/test-50-package-json-5/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './node_modules/input/test-x-index.js';\nconst output = './test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-6/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-6/test-x-index.js",
    "content": "'use strict';\n\nrequire('./node_modules/alpha');\n"
  },
  {
    "path": "test/test-50-package-json-6b/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './node_modules/alpha/alpha.js';\nconst output = './test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-6c/beta/alpha.js",
    "content": "'use strict';\n\nrequire('../beta');\n\nif (process.pkg && require('path').sep === '/') {\n  if (__dirname === '/snapshot/pkg/test/test-50-package-json-6c/beta') {\n    try {\n      console.log(\n        require('fs').readFileSync('/snapshot/pkg/package.json', 'utf-8')\n      );\n    } catch (_) {\n      // must not take pkg/package.json into executable\n    }\n  } else {\n    require('assert')(__dirname === '/snapshot/beta');\n  }\n}\n"
  },
  {
    "path": "test/test-50-package-json-6c/beta/beta.js",
    "content": "'use strict';\n\nconsole.log('bar');\n"
  },
  {
    "path": "test/test-50-package-json-6c/beta/package.json",
    "content": "{\n  \"name\": \"beta\",\n  \"main\": \"beta.js\"\n}\n"
  },
  {
    "path": "test/test-50-package-json-6c/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './beta/alpha.js';\nconst output = './test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-6d/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-6d/test-x-index.js",
    "content": "'use strict';\n\nrequire('alpha');\n"
  },
  {
    "path": "test/test-50-package-json-7/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-7/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"dependencies\": {\n    \"delta\": \"*\",\n    \"normalize.css\": \"*\"\n  }\n}\n"
  },
  {
    "path": "test/test-50-package-json-7/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\n\nvar dataPath1 = 'delta';\nrequire(dataPath1);\nconsole.log(global.FOO);\n\nvar dataPath2 = 'normalize.css';\nvar css = fs.readFileSync(require.resolve(dataPath2), 'utf8');\nconsole.log(css);\n"
  },
  {
    "path": "test/test-50-package-json-7p/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-package-json-7p/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"delta\": \"*\"\n  }\n}\n"
  },
  {
    "path": "test/test-50-package-json-7p/test-x-index.js",
    "content": "'use strict';\n\nvar dataPath = 'delta';\nrequire(dataPath);\nconsole.log(global.FOO);\n"
  },
  {
    "path": "test/test-50-package-json-8/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['sub/test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-json-8/package.json",
    "content": "{\n  \"bin\": \"sub/test-x-index.js\",\n  \"files\": [\n    \"sub/sub\",\n    \"test-z-data.css\"\n  ]\n}\n"
  },
  {
    "path": "test/test-50-package-json-8/sub/sub/test-y-require.js",
    "content": "'use strict';\n\nvar assert = require('assert');\n\nfunction main() {\n  require('../test-z-require.js');\n}\n\nif (process.pkg) {\n  assert(main.toString().indexOf('test') < 0);\n}\n\nmain();\n"
  },
  {
    "path": "test/test-50-package-json-8/sub/test-x-index.js",
    "content": "'use strict';\n\nvar dataPath = './sub/test-y-require.js';\nrequire(dataPath);\n"
  },
  {
    "path": "test/test-50-package-json-8/sub/test-z-require.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar dataPath = '../test-z-data.css';\nvar data = fs.readFileSync(require.resolve(dataPath), 'utf8');\nconsole.log(data);\n"
  },
  {
    "path": "test/test-50-package-json-8/test-z-data.css",
    "content": "test data\n"
  },
  {
    "path": "test/test-50-package-json-8b/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['sub/test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-json-8b/package.json",
    "content": "{\n  \"bin\": \"sub/test-x-index.js\",\n  \"files\": [\n    \"/sub/sub\",\n    \"/test-z-data.css\"\n  ]\n}\n"
  },
  {
    "path": "test/test-50-package-json-8b/sub/sub/test-y-require.js",
    "content": "'use strict';\n\nvar assert = require('assert');\n\nfunction main() {\n  require('../test-z-require.js');\n}\n\nif (process.pkg) {\n  assert(main.toString().indexOf('test') < 0);\n}\n\nmain();\n"
  },
  {
    "path": "test/test-50-package-json-8b/sub/test-x-index.js",
    "content": "'use strict';\n\nvar dataPath = './sub/test-y-require.js';\nrequire(dataPath);\n"
  },
  {
    "path": "test/test-50-package-json-8b/sub/test-z-require.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar dataPath = '../test-z-data.css';\nvar data = fs.readFileSync(require.resolve(dataPath), 'utf8');\nconsole.log(data);\n"
  },
  {
    "path": "test/test-50-package-json-8b/test-z-data.css",
    "content": "test data\n"
  },
  {
    "path": "test/test-50-package-json-8p/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['sub/test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-json-8p/package.json",
    "content": "{\n  \"bin\": \"sub/test-x-index.js\",\n  \"pkg\": {\n    \"scripts\": [\n      \"sub/sub\"\n    ],\n    \"assets\": [\n      \"test-z-data.css\"\n    ]\n  }\n}\n"
  },
  {
    "path": "test/test-50-package-json-8p/sub/sub/test-y-require.js",
    "content": "'use strict';\n\nvar assert = require('assert');\n\nfunction main() {\n  require('../test-z-require.js');\n}\n\nif (process.pkg) {\n  assert(main.toString().indexOf('test') < 0);\n}\n\nmain();\n"
  },
  {
    "path": "test/test-50-package-json-8p/sub/test-x-index.js",
    "content": "'use strict';\n\nvar dataPath = './sub/test-y-require.js';\nrequire(dataPath);\n"
  },
  {
    "path": "test/test-50-package-json-8p/sub/test-z-require.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar dataPath = '../test-z-data.css';\nvar data = fs.readFileSync(require.resolve(dataPath), 'utf8');\nconsole.log(data);\n"
  },
  {
    "path": "test/test-50-package-json-8p/test-z-data.css",
    "content": "test data\n"
  },
  {
    "path": "test/test-50-package-json-9/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-json-9/test-x-index.js",
    "content": "'use strict';\n\nrequire('test-y-require');\n"
  },
  {
    "path": "test/test-50-package-json-9p/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-json-9p/test-x-index.js",
    "content": "'use strict';\n\nrequire('test-y-require');\n"
  },
  {
    "path": "test/test-50-package-json-A/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-package-json-A/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"data\": 42\n}\n"
  },
  {
    "path": "test/test-50-package-json-A/test-x-index.js",
    "content": "/* eslint-disable no-useless-concat */\n\n'use strict';\n\nvar thePJ = './package' + '.json';\nconsole.log(require(thePJ).data);\n"
  },
  {
    "path": "test/test-50-path-as-buffer/main.js",
    "content": "#!/usr/bin/env node\n\n/* eslint-disable no-multi-spaces */\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nfunction isNode8(version) {\n  return /^(node|v)?8/.test(version);\n}\n\nconst version1 = process.version;\nconst version2 = target;\n\nif (isNode8(version1) === isNode8(version2)) {\n  let left, right;\n\n  left = utils.spawn.sync('node', [path.basename(input)], {\n    cwd: path.dirname(input),\n  });\n\n  utils.pkg.sync(['--target', target, '--output', output, input]);\n\n  right = utils.spawn.sync('./' + path.basename(output), [], {\n    cwd: path.dirname(output),\n  });\n\n  assert.strictEqual(left, right);\n  utils.vacuum.sync(output);\n}\n"
  },
  {
    "path": "test/test-50-path-as-buffer/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar hasURL = typeof URL !== 'undefined';\n\nvar d = __dirname;\nvar f = path.join(__dirname, 'test-z-asset.css');\n\nconsole.log(fs.statSync(f).size);\nconsole.log(fs.statSync(Buffer.from(f)).size);\nif (hasURL) console.log(fs.statSync(new URL('file://' + f)).size);\n\nconsole.log(fs.readdirSync(d).includes('test-z-asset.css'));\nconsole.log(fs.readdirSync(Buffer.from(d)).includes('test-z-asset.css'));\nif (hasURL)\n  console.log(\n    fs.readdirSync(new URL('file://' + d)).includes('test-z-asset.css')\n  );\n"
  },
  {
    "path": "test/test-50-path-as-buffer/test-z-asset.css",
    "content": ".header {\n  background: #444;\n}\n"
  },
  {
    "path": "test/test-50-path-separators/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', ['test-x-index.js']);\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-path-separators/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"assets\": \"sub/*\"\n  }\n}\n"
  },
  {
    "path": "test/test-50-path-separators/sub/test-y-require-C.js",
    "content": "'use strict';\n\nmodule.exports = [];\n"
  },
  {
    "path": "test/test-50-path-separators/sub/test-y-require-D.js",
    "content": "'use strict';\n\nmodule.exports = [];\n"
  },
  {
    "path": "test/test-50-path-separators/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nconsole.log(\n  fs.readdirSync(path.join(__dirname, 'sub')),\n  fs.readdirSync(path.join(__dirname, 'sub/')),\n  fs.readdirSync(path.join(__dirname, 'sub//'))\n);\n"
  },
  {
    "path": "test/test-50-promisify/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet left, right;\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-promisify/test-x-index.js",
    "content": "'use strict';\n\nvar promisify = require('util').promisify;\nif (!promisify) return console.log('ok');\n\nvar fs = require('fs');\nvar execAsync = promisify(require('child_process').exec);\nvar existsAsync = promisify(fs.exists);\nvar readAsync = promisify(fs.read);\n\nexecAsync('whoami').then(function (output) {\n  console.log(JSON.stringify(output));\n  existsAsync('./main.js').then(function (existence) {\n    console.log(existence);\n    fs.open('./main.js', 'r', function (error, fd) {\n      if (error) return;\n      readAsync(fd, Buffer.alloc(10), 0, 10, 0).then(function (tuple) {\n        console.log(JSON.stringify(tuple));\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/test-50-public-packages/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nif (/^(node|v)?0/.test(target)) return;\n\nfor (const pub of ['swordsman', 'crusader', '*']) {\n  let right;\n\n  utils.pkg.sync([\n    '--public-packages=' + pub,\n    '--target',\n    target,\n    '--output',\n    output,\n    input,\n  ]);\n\n  right = utils.spawn.sync('./' + path.basename(output), [], {\n    cwd: path.dirname(output),\n  });\n\n  if (pub === 'swordsman') {\n    assert.strictEqual(right, '');\n  } else {\n    assert.strictEqual(right, 'ok\\n');\n  }\n\n  utils.vacuum.sync(output);\n}\n"
  },
  {
    "path": "test/test-50-public-packages/test-x-index.js",
    "content": "'use strict';\n\nrequire('crusader');\n"
  },
  {
    "path": "test/test-50-reproducible/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output1 = './test-output-1.exe';\nconst output2 = './test-output-2.exe';\n\n// v8 introduced random bits in snapshots\n// version 6.0 (nodejs 8.3.0)\n// TODO make v8 nullify pointers upon serializing\n\nutils.pkg.sync([\n  '--public',\n  '--no-signature', // the signature will make the build not reproducible\n  '--no-bytecode',\n  '--target',\n  target,\n  '--output',\n  output1,\n  input,\n]);\n\nutils.pkg.sync([\n  '--public',\n  '--no-signature',\n  '--no-bytecode',\n  '--target',\n  target,\n  '--output',\n  output2,\n  input,\n]);\n\nconst content1 = fs.readFileSync(output1);\nconst content2 = fs.readFileSync(output2);\nassert.strictEqual(Buffer.compare(content1, content2), 0);\nutils.vacuum.sync(output1);\nutils.vacuum.sync(output2);\n"
  },
  {
    "path": "test/test-50-reproducible/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-50-require-edge-cases/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-require-edge-cases/test-x-index.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar content = path.join(__dirname, 'test-x1-content.js');\n\nconsole.log(\n  [\n    require(content),\n    require('./test-x2-require-false.js'),\n    typeof require('./test-x3-empty-file.js'),\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-require-edge-cases/test-x1-content.js",
    "content": "'use strict';\n\nmodule.exports = 'hello';\n"
  },
  {
    "path": "test/test-50-require-edge-cases/test-x2-require-false.js",
    "content": "'use strict';\n\nmodule.exports = false;\n"
  },
  {
    "path": "test/test-50-require-edge-cases/test-x3-empty-file.js",
    "content": ""
  },
  {
    "path": "test/test-50-require-main-parent/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\n// это директории. под\n// виндой они case-insensitive\nleft = left.toLowerCase();\nright = right.toLowerCase();\n\nleft = left.split('\\n');\nright = right.split('\\n');\n\nassert.strictEqual(left.length, right.length);\nassert(left.length > 100);\n\nvar nonSnapshot;\nleft.some(function (leftValue, index) {\n  const rightValue = right[index];\n  if (leftValue.slice(1, 3) === ':\\\\') {\n    assert.strictEqual(rightValue.slice(1, 12), ':\\\\snapshot\\\\');\n    nonSnapshot = rightValue.length - 12;\n    assert.strictEqual(\n      leftValue.slice(-nonSnapshot),\n      rightValue.slice(-nonSnapshot)\n    );\n  } else if (leftValue.slice(0, 1) === '/') {\n    assert.strictEqual(rightValue.slice(0, 10), '/snapshot/');\n    nonSnapshot = rightValue.length - 10;\n    assert.strictEqual(\n      leftValue.slice(-nonSnapshot),\n      rightValue.slice(-nonSnapshot)\n    );\n  } else if (leftValue === '') {\n    assert.strictEqual(leftValue, rightValue);\n  } else if (leftValue === 'empty') {\n    assert.strictEqual(leftValue, rightValue);\n  } else if (leftValue === 'string') {\n    assert.strictEqual(leftValue, rightValue);\n  } else if (leftValue === 'object') {\n    assert.strictEqual(leftValue, rightValue);\n  } else if (leftValue === 'function') {\n    assert.strictEqual(leftValue, rightValue);\n  } else if (leftValue === 'true') {\n    assert.strictEqual(leftValue, rightValue);\n  } else if (leftValue === 'false') {\n    assert.strictEqual(leftValue, rightValue);\n  } else if (leftValue === 'null') {\n    assert.strictEqual(leftValue, rightValue);\n  } else {\n    console.log(leftValue, rightValue);\n    assert(false);\n  }\n});\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-require-main-parent/sub/test-y-require-C.js",
    "content": "/* eslint-disable no-nested-ternary */\n\n'use strict';\n\nmodule.exports = [\n  __dirname,\n  __filename,\n  typeof module.filename,\n  module.filename ? module.filename : 'empty',\n  typeof module.parent,\n  module.parent ? typeof module.parent.filename : 'empty',\n  module.parent\n    ? module.parent.filename\n      ? module.parent.filename\n      : 'empty'\n    : 'empty',\n  typeof module.require,\n  typeof global,\n  // в nodejs они разные // (module.require === require).toString(),\n  typeof require.main,\n  (require.main === module).toString(),\n  typeof require.main.parent,\n  (require.main.parent || 'null').toString(),\n  require.main.parent ? require.main.parent.id : 'empty',\n  require.main.parent ? require.main.parent.filename : 'empty',\n  typeof global,\n  typeof global.setTimeout,\n  global.module ? (global.module === module).toString() : 'true',\n  global.require ? (global.require === require).toString() : 'true',\n];\n"
  },
  {
    "path": "test/test-50-require-main-parent/sub/test-y-require-D.js",
    "content": "/* eslint-disable no-nested-ternary */\n\n'use strict';\n\nmodule.exports = [\n  __dirname,\n  __filename,\n  typeof module.filename,\n  module.filename ? module.filename : 'empty',\n  typeof module.parent,\n  module.parent ? typeof module.parent.filename : 'empty',\n  module.parent\n    ? module.parent.filename\n      ? module.parent.filename\n      : 'empty'\n    : 'empty',\n  typeof module.require,\n  typeof global,\n  // в nodejs они разные // (module.require === require).toString(),\n  typeof require.main,\n  (require.main === module).toString(),\n  typeof require.main.parent,\n  (require.main.parent || 'null').toString(),\n  require.main.parent ? require.main.parent.id : 'empty',\n  require.main.parent ? require.main.parent.filename : 'empty',\n  typeof global,\n  typeof global.setTimeout,\n  global.module ? (global.module === module).toString() : 'true',\n  global.require ? (global.require === require).toString() : 'true',\n];\n"
  },
  {
    "path": "test/test-50-require-main-parent/test-x-index.js",
    "content": "/* eslint-disable no-nested-ternary */\n\n'use strict';\n\nvar fs = require('fs');\n\nconsole.log(\n  [\n    typeof process.argv[0],\n    typeof process.argv[1],\n    process.platform === 'win32' ? fs.existsSync(process.argv[0]) : 'empty',\n    fs.existsSync(process.argv[1]), // argv[0] is just \"node\" in linux\n    __dirname,\n    __filename,\n    typeof module.filename,\n    module.filename ? module.filename : 'empty',\n    typeof module.parent,\n    module.parent ? typeof module.parent.filename : 'empty',\n    module.parent\n      ? module.parent.filename\n        ? module.parent.filename\n        : 'empty'\n      : 'empty',\n    typeof module.require,\n    typeof global,\n    // в nodejs они разные // (module.require === require).toString(),\n    typeof require.main,\n    (require.main === module).toString(),\n    typeof require.main.parent,\n    (require.main.parent || 'null').toString(),\n    require.main.parent ? require.main.parent.id : 'empty',\n    require.main.parent ? require.main.parent.filename : 'empty',\n    typeof require.cache,\n    typeof global,\n    typeof global.setTimeout,\n    global.module ? (global.module === module).toString() : 'true',\n    global.require ? (global.require === require).toString() : 'true',\n  ] /**/\n    .concat(require('./test-y-require-A.js'))\n    .concat(require('./test-y-require-A.js'))\n    .concat(require('../test-50-require-main-parent/test-y-require-B.js'))\n    .concat(require('../test-50-require-main-parent/test-y-require-B.js'))\n    .concat(require('./sub/test-y-require-C.js'))\n    .concat(require('./sub/test-y-require-C.js'))\n    .concat(require('../test-50-require-main-parent/sub/test-y-require-D.js'))\n    .concat(\n      require('../test-50-require-main-parent/sub/test-y-require-D.js')\n    ) /**/\n    .join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-require-main-parent/test-y-require-A.js",
    "content": "/* eslint-disable no-nested-ternary */\n\n'use strict';\n\nmodule.exports = [\n  __dirname,\n  __filename,\n  typeof module.filename,\n  module.filename ? module.filename : 'empty',\n  typeof module.parent,\n  module.parent ? typeof module.parent.filename : 'empty',\n  module.parent\n    ? module.parent.filename\n      ? module.parent.filename\n      : 'empty'\n    : 'empty',\n  typeof module.require,\n  typeof global,\n  // в nodejs они разные // (module.require === require).toString(),\n  typeof require.main,\n  (require.main === module).toString(),\n  typeof require.main.parent,\n  (require.main.parent || 'null').toString(),\n  require.main.parent ? require.main.parent.id : 'empty',\n  require.main.parent ? require.main.parent.filename : 'empty',\n  typeof global,\n  typeof global.setTimeout,\n  global.module ? (global.module === module).toString() : 'true',\n  global.require ? (global.require === require).toString() : 'true',\n];\n"
  },
  {
    "path": "test/test-50-require-main-parent/test-y-require-B.js",
    "content": "/* eslint-disable no-nested-ternary */\n\n'use strict';\n\nmodule.exports = [\n  __dirname,\n  __filename,\n  typeof module.filename,\n  module.filename ? module.filename : 'empty',\n  typeof module.parent,\n  module.parent ? typeof module.parent.filename : 'empty',\n  module.parent\n    ? module.parent.filename\n      ? module.parent.filename\n      : 'empty'\n    : 'empty',\n  typeof module.require,\n  typeof global,\n  // в nodejs они разные // (module.require === require).toString(),\n  typeof require.main,\n  (require.main === module).toString(),\n  typeof require.main.parent,\n  (require.main.parent || 'null').toString(),\n  require.main.parent ? require.main.parent.id : 'empty',\n  require.main.parent ? require.main.parent.filename : 'empty',\n  typeof global,\n  typeof global.setTimeout,\n  global.module ? (global.module === module).toString() : 'true',\n  global.require ? (global.require === require).toString() : 'true',\n];\n"
  },
  {
    "path": "test/test-50-require-resolve/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-require-resolve/test-x-index.js",
    "content": "/* eslint-disable no-multi-spaces */\n/* eslint-disable no-useless-concat */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nvar theResolve = require.resolve('./test-y-resolve.any');\n\nvar theReqCode1 = require('./test-z-require-code-1');\nvar theReqCode2b = require.resolve('./test-z-require-code-2');\nvar theReqCode3 = require('./test-z-require-code-3.js');\nvar theReqCode4b = require.resolve('./test-z-require-code-4.js');\n\nvar theReqCode1x = require('./test-z-require-code-1' + '');\nvar theReqCode2bx = require.resolve('./test-z-require-code-2' + '');\nvar theReqCode3x = require('./test-z-require-code-3.js' + '');\nvar theReqCode4bx = require.resolve('./test-z-require-code-4.js' + '');\n\nvar theReqContent = fs.readFileSync(\n  path.join(__dirname, './test-z-require-content.css')\n);\nvar theReqContentX = fs.readFileSync(\n  path.join(__dirname, './test-z-require-content.css' + '')\n);\n\nvar theReqJson1 = require('./test-z-require-json-1');\nvar theReqJson2b = require.resolve('./test-z-require-json-2');\nvar theReqJson3 = require('./test-z-require-json-3.json');\nvar theReqJson4b = require.resolve('./test-z-require-json-4.json');\n\nvar theReqJson1x = require('./test-z-require-json-1' + '');\nvar theReqJson2bx = require.resolve('./test-z-require-json-2' + '');\nvar theReqJson3x = require('./test-z-require-json-3.json' + '');\nvar theReqJson4bx = require.resolve('./test-z-require-json-4.json' + '');\n\nvar theReqJson5 = fs.readFileSync(\n  path.join(__dirname, './test-z-require-json-5.json')\n);\nvar theReqJson5s = fs.readFileSync(\n  require.resolve(path.join(__dirname, './test-z-require-json-5.json'))\n);\n\nconsole.log(\n  [\n    require(theResolve).what,\n\n    theReqCode1.what,\n    path.basename(theReqCode2b),\n    theReqCode3.what,\n    path.basename(theReqCode4b),\n\n    theReqCode1x.what,\n    path.basename(theReqCode2bx),\n    theReqCode3x.what,\n    path.basename(theReqCode4bx),\n\n    theReqContent.toString().split('\\n')[0].split(' ')[0],\n    theReqContentX.toString().split('\\n')[0].split(' ')[0],\n\n    theReqJson1.what,\n    path.basename(theReqJson2b),\n    theReqJson3.what,\n    path.basename(theReqJson4b),\n\n    theReqJson1x.what,\n    path.basename(theReqJson2bx),\n    theReqJson3x.what,\n    path.basename(theReqJson4bx),\n\n    theReqJson5.toString().split('\"')[3],\n    theReqJson5s.toString().split('\"')[3],\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-require-resolve/test-y-resolve.any",
    "content": "module.exports = {\n  what: \"test-y-resolve.any.body\"\n};\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-code-1.js",
    "content": "'use strict';\n\nmodule.exports = {\n  what: 'test-z-require-code1.js.body',\n};\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-code-2.js",
    "content": "'use strict';\n\nmodule.exports = {\n  what: 'test-z-require-code2.js.body',\n};\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-code-3.js",
    "content": "'use strict';\n\nmodule.exports = {\n  what: 'test-z-require-code3.js.body',\n};\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-code-4.js",
    "content": "'use strict';\n\nmodule.exports = {\n  what: 'test-z-require-code4.js.body',\n};\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-content.css",
    "content": "test-z-require-content.css.body {\n  display: inline-block;\n  position: relative;\n  padding: 0;\n  line-height: normal;\n  margin-right: 0.1em;\n  cursor: pointer;\n  vertical-align: middle;\n  text-align: center;\n  overflow: visible; /* removes extra width in IE */\n}\n.ui-button,\n.ui-button:link,\n.ui-button:visited,\n.ui-button:hover,\n.ui-button:active {\n  text-decoration: none;\n}\n/* to make room for the icon, a width needs to be set here */\n.ui-button-icon-only {\n  width: 2.2em;\n}\n/* button elements seem to need a little more width */\nbutton.ui-button-icon-only {\n  width: 2.4em;\n}\n.ui-button-icons-only {\n  width: 3.4em;\n}\nbutton.ui-button-icons-only {\n  width: 3.7em;\n}\n\n/* button text element */\n.ui-button .ui-button-text {\n  display: block;\n  line-height: normal;\n}\n.ui-button-text-only .ui-button-text {\n  padding: 0.4em 1em;\n}\n.ui-button-icon-only .ui-button-text,\n.ui-button-icons-only .ui-button-text {\n  padding: 0.4em;\n  text-indent: -9999999px;\n}\n.ui-button-text-icon-primary .ui-button-text,\n.ui-button-text-icons .ui-button-text {\n  padding: 0.4em 1em 0.4em 2.1em;\n}\n.ui-button-text-icon-secondary .ui-button-text,\n.ui-button-text-icons .ui-button-text {\n  padding: 0.4em 2.1em 0.4em 1em;\n}\n.ui-button-text-icons .ui-button-text {\n  padding-left: 2.1em;\n  padding-right: 2.1em;\n}\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-json-1.json",
    "content": "{\n  \"what\": \"test-z-require-json1.json.body\"\n}\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-json-2.json",
    "content": "{\n  \"what\": \"test-z-require-json2.json.body\"\n}\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-json-3.json",
    "content": "{\n  \"what\": \"test-z-require-json3.json.body\"\n}\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-json-4.json",
    "content": "{\n  \"what\": \"test-z-require-json4.json.body\"\n}\n"
  },
  {
    "path": "test/test-50-require-resolve/test-z-require-json-5.json",
    "content": "{\n  \"what\": \"test-z-require-json5.json.body\"\n}\n"
  },
  {
    "path": "test/test-50-require-resolve-2/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\nconst output3 = './run-time-3/dummy';\n\nlet left, right, right3;\nutils.mkdirp.sync(path.dirname(output));\nutils.mkdirp.sync(path.dirname(output3));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nfs.readdirSync('./').some(function (file) {\n  if (/^test-/.test(file)) {\n    const nf = path.join(\n      path.dirname(file),\n      path.basename(path.dirname(output)),\n      path.basename(file)\n    );\n    fs.writeFileSync(\n      nf,\n      fs.readFileSync(file, 'utf8').replace('compile-time', 'run-time')\n    );\n    const nf3 = path.join(\n      path.dirname(file),\n      path.basename(path.dirname(output3)),\n      path.basename(file)\n    );\n    fs.writeFileSync(\n      nf3,\n      fs.readFileSync(file, 'utf8').replace('compile-time', 'run-time-3')\n    );\n  }\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nright3 = utils.spawn.sync(\n  './' + path.join('..', path.dirname(output), path.basename(output)),\n  [],\n  { cwd: path.dirname(output3) }\n);\n\nright = ['require-code-J', 'require-content-K', 'require-content-L'].reduce(\n  function (x, y) {\n    const r = x.replace(new RegExp(y + '-run-time', 'g'), y + '-compile-time');\n    // assert(r !== x);\n    return r;\n  },\n  right\n);\n\nright3 = ['require-code-J'].reduce(function (x, y) {\n  const r = x.replace(new RegExp(y + '-run-time', 'g'), y + '-compile-time');\n  // assert(r !== x);\n  return r;\n}, right3);\n\nright3 = ['require-content-K', 'require-content-L'].reduce(function (x, y) {\n  const r = x.replace(new RegExp(y + '-run-time-3', 'g'), y + '-compile-time');\n  // assert(r !== x);\n  return r;\n}, right3);\n\nif (left.length === 0) {\n  left = 'left is empty';\n}\n\nif (right.length === 0) {\n  right = 'right is empty';\n}\n\nif (right3.length === 0) {\n  right3 = 'right3 is empty';\n}\n\nassert.strictEqual(left, right);\nassert.strictEqual(left, right3);\nutils.vacuum.sync(path.dirname(output));\nutils.vacuum.sync(path.dirname(output3));\n"
  },
  {
    "path": "test/test-50-require-resolve-2/test-x-index.js",
    "content": "/* eslint-disable no-multi-spaces */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\n/*\nvar theResolveA =    require.resolve(\"./test-y-resolve-A.txt\");\nvar theResolveB =    require.resolve(\"./test-y-resolve-B.txt\", \"must-exclude\");\nvar theResolveB2 =   require.resolve(\"./test-y-resolve-B.txt\", \"may-exclude\");\nvar theResolvePathC =                \"./test-y-resolve-C.txt\"; var theResolveC = require.resolve(theResolvePathC);\nvar theResolvePathD =                \"./test-y-resolve-D.txt\"; var theResolveD = require.resolve(theResolvePathD, \"must-exclude\");\nvar theResolvePathD2 =               \"./test-y-resolve-D.txt\"; var theResolveD2 = require.resolve(theResolvePathD2, \"may-exclude\");\nvar theResolveE =    require.resolve(\"./test-y-resolve-E.txt\");\nvar theResolveF =    require.resolve(\"./test-y-resolve-F.txt\", \"must-exclude\");\nvar theResolveF2 =   require.resolve(\"./test-y-resolve-F.txt\", \"may-exclude\");\nvar theResolvePathG =                \"./test-y-resolve-G.txt\"; var theResolveG = require.resolve(theResolvePathG);\nvar theResolvePathH =                \"./test-y-resolve-H.txt\"; var theResolveH = require.resolve(theResolvePathH, \"must-exclude\");\nvar theResolvePathH2 =               \"./test-y-resolve-H.txt\"; var theResolveH2 = require.resolve(theResolvePathH2, \"may-exclude\");\n*/\nvar theReqCodeI = require('./test-z-require-code-I.js');\nvar theReqCodeJ = require('./test-z-require-code-J.js', 'must-exclude');\nvar theReqCodeJ2 = require('./test-z-require-code-J.js', 'may-exclude');\nvar theReqContentK = fs.readFileSync('./test-z-require-content-K.txt');\nvar theReqContentL = fs.readFileSync(\n  './test-z-require-content-L.txt',\n  null,\n  'must-exclude'\n);\nvar theReqContentL2 = fs.readFileSync(\n  './test-z-require-content-L.txt',\n  null,\n  'may-exclude'\n);\nvar theReqContentM = fs.readFileSync(\n  path.join(__dirname, './test-z-require-content-M.txt')\n);\nvar theReqContentN = fs.readFileSync(\n  path.join(__dirname, './test-z-require-content-N.txt'),\n  null,\n  'must-exclude'\n);\nvar theReqContentN2 = fs.readFileSync(\n  path.join(__dirname, './test-z-require-content-N.txt'),\n  null,\n  'may-exclude'\n);\n\nconsole.log(\n  [\n    //  fs.readFileSync(theResolveA).toString(),\n    //  fs.readFileSync(theResolveB).toString(),\n    //  fs.readFileSync(theResolveC).toString(),\n    //  fs.readFileSync(theResolveD).toString(),\n    //  fs.readFileSync(theResolveE).toString(),\n    //  fs.readFileSync(theResolveF, null, \"must-exclude\").toString(),\n    //  fs.readFileSync(theResolveG).toString(),\n    //  fs.readFileSync(theResolveH, null, \"must-exclude\").toString(),\n    theReqCodeI.v,\n    theReqCodeJ.v,\n    theReqCodeJ2.v,\n    theReqContentK.toString(),\n    theReqContentL.toString(),\n    theReqContentL2.toString(),\n    theReqContentM.toString(),\n    theReqContentN.toString(),\n    theReqContentN2.toString(),\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-require-resolve-2/test-y-resolve-A.txt",
    "content": "test-z-resolve-A-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-y-resolve-B.txt",
    "content": "test-z-resolve-B-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-y-resolve-C.txt",
    "content": "test-z-resolve-C-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-y-resolve-D.txt",
    "content": "test-z-resolve-D-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-y-resolve-E.txt",
    "content": "test-z-resolve-E-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-y-resolve-F.txt",
    "content": "test-z-resolve-F-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-y-resolve-G.txt",
    "content": "test-z-resolve-G-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-y-resolve-H.txt",
    "content": "test-z-resolve-H-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-z-require-code-I.js",
    "content": "'use strict';\n\nmodule.exports.v = 'test-z-require-code-I-compile-time';\n"
  },
  {
    "path": "test/test-50-require-resolve-2/test-z-require-code-J.js",
    "content": "'use strict';\n\nmodule.exports.v = 'test-z-require-code-J-compile-time';\n"
  },
  {
    "path": "test/test-50-require-resolve-2/test-z-require-content-K.txt",
    "content": "test-z-require-content-K-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-z-require-content-L.txt",
    "content": "test-z-require-content-L-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-z-require-content-M.txt",
    "content": "test-z-require-content-M-compile-time"
  },
  {
    "path": "test/test-50-require-resolve-2/test-z-require-content-N.txt",
    "content": "test-z-require-content-N-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst output = './run-time/test-output.exe';\nconst output3 = './run-time-3/dummy';\n\nlet left, right, right3;\nutils.mkdirp.sync(path.dirname(output));\nutils.mkdirp.sync(path.dirname(output3));\n\nleft = utils.spawn.sync('node', ['test-x-index.js']);\n\nfs.readdirSync('./').some(function (file) {\n  if (/^test-/.test(file)) {\n    const nf = path.join(\n      path.dirname(file),\n      path.basename(path.dirname(output)),\n      path.basename(file)\n    );\n    fs.writeFileSync(\n      nf,\n      fs.readFileSync(file, 'utf8').replace('compile-time', 'run-time')\n    );\n    const nf3 = path.join(\n      path.dirname(file),\n      path.basename(path.dirname(output3)),\n      path.basename(file)\n    );\n    fs.writeFileSync(\n      nf3,\n      fs.readFileSync(file, 'utf8').replace('compile-time', 'run-time-3')\n    );\n  }\n});\n\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nright3 = utils.spawn.sync(\n  './' + path.join('..', path.dirname(output), path.basename(output)),\n  [],\n  { cwd: path.dirname(output3) }\n);\n\nright = right\n  .replace(/-J-run-time/g, '-J-compile-time')\n  .replace(/-K-run-time/g, '-K-compile-time')\n  .replace(/-L-run-time/g, '-L-compile-time');\n\nright3 = right3\n  .replace(/-J-run-time-3/g, '-J-compile-time')\n  .replace(/-K-run-time-3/g, '-K-compile-time')\n  .replace(/-L-run-time-3/g, '-L-compile-time');\n\nif (left.length === 0) {\n  left = 'left is empty';\n}\n\nif (right.length === 0) {\n  right = 'right is empty';\n}\n\nif (right3.length === 0) {\n  right3 = 'right3 is empty';\n}\n\nassert.strictEqual(left, right);\nassert.strictEqual(left, right3);\nutils.vacuum.sync(path.dirname(output));\nutils.vacuum.sync(path.dirname(output3));\n"
  },
  {
    "path": "test/test-50-require-with-config/package.json",
    "content": "{\n  \"bin\": \"test-x-index.js\",\n  \"pkg\": {\n    \"scripts\": \"test-z-*.js\",\n    \"assets\": \"test-*.txt\"\n  }\n}\n"
  },
  {
    "path": "test/test-50-require-with-config/test-x-index.js",
    "content": "/* eslint-disable max-statements-per-line */\n/* eslint-disable no-multi-spaces */\n/* eslint-disable no-useless-concat */\n\n'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar theResolveA = require.resolve('./test-y-' + 'resolve-A.txt');\nvar theResolveB = require.resolve(\n  './test-y-' + 'resolve-B.txt',\n  'must-exclude'\n);\nvar theResolvePathC = './test-y-' + 'resolve-C.txt';\nvar theResolveC = require.resolve(theResolvePathC);\nvar theResolvePathD = './test-y-' + 'resolve-D.txt';\nvar theResolveD = require.resolve(theResolvePathD, 'must-exclude');\nvar theResolveE = require.resolve('./test-y-' + 'resolve-E.txt');\nvar theResolveF = require.resolve(\n  './test-y-' + 'resolve-F.txt',\n  'must-exclude'\n);\nvar theResolvePathG = './test-y-' + 'resolve-G.txt';\nvar theResolveG = require.resolve(theResolvePathG);\nvar theResolvePathH = './test-y-' + 'resolve-H.txt';\nvar theResolveH = require.resolve(theResolvePathH, 'must-exclude');\nvar theReqCodeI = require('./test-z-' + 'require-code-I.js');\nvar theReqCodeJ = require(path.resolve('./test-z-' + 'require-code-J'));\nvar theReqContentK = fs.readFileSync('./test-z-' + 'require-content-K.txt');\nvar theReqContentL = fs.readFileSync(\n  './test-z-' + 'require-content-L.txt',\n  null,\n  'must-exclude'\n);\nvar theReqContentM = fs.readFileSync(\n  path.join(__dirname, './test-z-' + 'require-content-M.txt')\n);\nvar theReqContentN = fs.readFileSync(\n  path.join(__dirname, './test-z-' + 'require-content-N.txt'),\n  null,\n  'must-exclude'\n);\n\nconsole.log(\n  [\n    fs.readFileSync(theResolveA).toString(),\n    fs.readFileSync(theResolveB).toString(),\n    fs.readFileSync(theResolveC).toString(),\n    fs.readFileSync(theResolveD).toString(),\n    fs.readFileSync(theResolveE).toString(),\n    fs.readFileSync(theResolveF, null, 'must-exclude').toString(),\n    fs.readFileSync(theResolveG).toString(),\n    fs.readFileSync(theResolveH, null, 'must-exclude').toString(),\n    theReqCodeI.v,\n    theReqCodeJ.v,\n    theReqContentK.toString(),\n    theReqContentL.toString(),\n    theReqContentM.toString(),\n    theReqContentN.toString(),\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-require-with-config/test-y-resolve-A.txt",
    "content": "test-z-resolve-A-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-y-resolve-B.txt",
    "content": "test-z-resolve-B-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-y-resolve-C.txt",
    "content": "test-z-resolve-C-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-y-resolve-D.txt",
    "content": "test-z-resolve-D-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-y-resolve-E.txt",
    "content": "test-z-resolve-E-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-y-resolve-F.txt",
    "content": "test-z-resolve-F-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-y-resolve-G.txt",
    "content": "test-z-resolve-G-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-y-resolve-H.txt",
    "content": "test-z-resolve-H-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-z-require-code-I.js",
    "content": "'use strict';\n\nmodule.exports.v = 'test-z-require-code-I-compile-time';\n"
  },
  {
    "path": "test/test-50-require-with-config/test-z-require-code-J.js",
    "content": "'use strict';\n\nmodule.exports.v = 'test-z-require-code-J-compile-time';\n"
  },
  {
    "path": "test/test-50-require-with-config/test-z-require-content-K.txt",
    "content": "test-z-require-content-K-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-z-require-content-L.txt",
    "content": "test-z-require-content-L-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-z-require-content-M.txt",
    "content": "test-z-require-content-M-compile-time"
  },
  {
    "path": "test/test-50-require-with-config/test-z-require-content-N.txt",
    "content": "test-z-require-content-N-compile-time"
  },
  {
    "path": "test/test-50-resolve-and-nearby/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-resolve-and-nearby/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nconsole.log(\n  [\n    require('test-y-fish'), // both should have same names\n    fs.readFileSync(path.join(__dirname, 'test-y-fish')),\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-resolve-and-nearby/test-y-fish",
    "content": "module.exports = \"test-y-fish-file\";\n"
  },
  {
    "path": "test/test-50-should-disclose-package/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst standard = 'stdout';\n\nfunction rightReducer(mappy, line, index, right) {\n  if (\n    line.indexOf('Cannot resolve') >= 0 ||\n    line.indexOf('The file was included') >= 0\n  ) {\n    const name = path.basename(right[index + 1]);\n    let value = right[index].split(' as ')[1] || '';\n    value = value || right[index].split(' Warning ')[1];\n    if (mappy[name]) assert.strictEqual(mappy[name], value);\n    mappy[name] = value;\n  }\n\n  return mappy;\n}\n\nfor (const pub of [false, true]) {\n  let right;\n\n  const inspect =\n    standard === 'stdout'\n      ? ['inherit', 'pipe', 'inherit']\n      : ['inherit', 'inherit', 'pipe'];\n\n  right = utils.pkg.sync(\n    ['--debug', '--target', target, '--output', output, input].concat(\n      pub ? ['--public'] : []\n    ),\n    inspect\n  );\n\n  assert(right.indexOf('\\x1B\\x5B') < 0, 'colors detected');\n\n  right = right.split('\\n');\n  const mappy = right.reduce(rightReducer, {});\n\n  const lines =\n    Object.keys(mappy)\n      .sort()\n      .map(function (key) {\n        return key + ' = ' + mappy[key];\n      })\n      .join('\\n') + '\\n';\n\n  assert.strictEqual(\n    lines,\n    'connect.js = DISCLOSED code (with sources)\\n' +\n      'has-no-license.js = bytecode (no sources)\\n' +\n      'has-permissive-license.js = DISCLOSED code (with sources)\\n' +\n      'has-strict-license.js = bytecode (no sources)\\n' +\n      'package.json = DISCLOSED code (with sources)\\n' +\n      (pub\n        ? 'test-x-index.js = DISCLOSED code (with sources)\\n'\n        : 'test-x-index.js = bytecode (no sources)\\n')\n  );\n\n  utils.vacuum.sync(output);\n}\n"
  },
  {
    "path": "test/test-50-should-disclose-package/test-x-index.js",
    "content": "'use strict';\n\nrequire('connect');\nrequire('has-no-license');\nrequire('has-permissive-license');\nrequire('has-strict-license');\n"
  },
  {
    "path": "test/test-50-signature/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nlet spoiler = fs.readFileSync(output);\nspoiler = Buffer.concat([\n  spoiler,\n  Buffer.from([\n    0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xbc,\n    0xcd, 0xde, 0xef, 0xfe, 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,\n    0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe, 0x01, 0x12, 0x23, 0x34,\n    0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe,\n    0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xbc,\n    0xcd, 0xde, 0xef, 0xfe, 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,\n    0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe, 0x01, 0x12, 0x23, 0x34,\n    0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe,\n    0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xbc,\n    0xcd, 0xde, 0xef,\n  ]),\n]);\nfs.writeFileSync(output, spoiler);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-signature/test-x-index.js",
    "content": "'use strict';\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-50-sigusr1/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst windows = process.platform === 'win32';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nif (windows) return;\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], { expect: null });\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-sigusr1/test-x-index.js",
    "content": "'use strict';\n\nsetTimeout(function () {\n  console.log('ok');\n  process.kill(process.pid, 'SIGUSR1');\n}, 3000);\n"
  },
  {
    "path": "test/test-50-spawn/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nconst target = process.argv[2] || host;\n\nfunction rnd() {\n  return Math.random().toString().slice(-6);\n}\n\nconst pairs = fs\n  .readdirSync('.')\n  .filter(function (f) {\n    return /\\.js$/.test(f) && f !== 'main.js' && !/-child\\.js$/.test(f);\n  })\n  .map(function (f) {\n    return {\n      input: f,\n      output: './test-output-' + rnd() + '.exe',\n    };\n  });\n\nassert(pairs.length > 6);\n\nfunction stripTraceOpt(lines) {\n  return lines\n    .split('\\n')\n    .filter(function (line) {\n      return (\n        line.indexOf('[disabled optimization') < 0 &&\n        line.indexOf('[marking') < 0 &&\n        line.indexOf('[compiling method') < 0 &&\n        line.indexOf('[optimizing') < 0 &&\n        line.indexOf('[completed optimizing') < 0 &&\n        line.indexOf('einfo:') < 0\n      );\n    })\n    .join('\\n');\n}\n\npairs.some(function (pair) {\n  const input = pair.input;\n  const output = pair.output;\n\n  let left, right;\n  utils.mkdirp.sync(path.dirname(output));\n\n  left = utils.spawn.sync('node', [path.basename(input)], {\n    cwd: path.dirname(input),\n  });\n\n  utils.pkg.sync(['--target', target, '--output', output, input]);\n\n  right = utils.spawn.sync('./' + path.basename(output), [], {\n    cwd: path.dirname(output),\n  });\n\n  right = stripTraceOpt(right);\n  left = stripTraceOpt(left);\n  if (left !== right) {\n    console.log(JSON.stringify(pair));\n    console.log('<<left<<\\n' + left);\n    console.log('>>right>>\\n' + right);\n    throw new Error('Assertion');\n  }\n\n  utils.vacuum.sync(output);\n  console.log(__dirname, input, 'ok');\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-cluster-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(process.send);\nassert(cluster.worker);\n\nconsole.log('Hello from cluster-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n\nprocess.on('message', function (value) {\n  if (value === 128) process.exit();\n  process.send(value * 2);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-cluster.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\nvar child;\n\nif (process.send) {\n  require('./test-cluster-child.js');\n  return;\n}\n\nassert(cluster.isMaster);\n\ntry {\n  child = cluster.fork();\n} catch (e) {\n  console.log(e.message);\n}\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\ncluster.on('exit', function (_, code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-cpfork-a-1.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cp = require('child_process');\nvar child;\n\nassert(!process.send);\n\ntry {\n  child = cp.fork(require.resolve('./test-cpfork-a-child.js'));\n} catch (e) {\n  console.log(e.message);\n}\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-cpfork-a-2.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cp = require('child_process');\nvar child;\n\nassert(!process.send);\n\ntry {\n  child = cp.fork(require.resolve('./test-cpfork-a-child.js'), [\n    'argx',\n    '--argvy',\n  ]);\n} catch (e) {\n  console.log(e.message);\n}\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-cpfork-a-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from cpfork-a-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n\nprocess.on('message', function (value) {\n  if (value === 128) process.exit();\n  process.send(value * 2);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-cpfork-b-1.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar path = require('path');\nvar cp = require('child_process');\nvar child;\n\nassert(!process.send);\n\ntry {\n  child = cp.fork(path.join(process.cwd(), 'test-cpfork-b-child.js'));\n} catch (e) {\n  console.log(e.message);\n}\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-cpfork-b-2.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar path = require('path');\nvar cp = require('child_process');\nvar child;\n\nassert(!process.send);\n\ntry {\n  child = cp.fork(path.join(process.cwd(), 'test-cpfork-b-child.js'), [\n    'argvx',\n    '--argvy',\n  ]);\n} catch (e) {\n  console.log(e.message);\n}\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-cpfork-b-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from cpfork-b-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n\nprocess.on('message', function (value) {\n  if (value === 128) process.exit();\n  process.send(value * 2);\n});\n\nvar fs = require('fs');\n\ntry {\n  // must patch fs even if entrypoint is not in snapshot\n  console.log(fs.readFileSync('dirty-hack-for-testing-purposes'));\n} catch (error) {\n  if (!process.pkg) console.log('dirty-hack-for-testing-purposes');\n}\n"
  },
  {
    "path": "test/test-50-spawn/test-exec-1.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\n// AppVeyor: unquoted execPath inside 'Program Files'\nif (process.platform === 'win32') return;\nvar exec = require('child_process').exec;\n\nvar child = exec(\n  process.execPath +\n    ' ' +\n    [require.resolve('./test-exec-child.js'), 'argvx', '--argvy'].join(' ')\n  // leave without callback for coverage\n);\n\nchild.stdout.pipe(process.stdout);\nchild.stderr.pipe(process.stderr);\n\nchild.on('exit', function (code) {\n  setTimeout(function () {\n    console.log('Child exited with code', code);\n  }, 100);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-exec-2.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar exec = require('child_process').exec;\n\nvar child = exec(\n  '\"' +\n    process.execPath +\n    '\" ' +\n    [require.resolve('./test-exec-child.js'), 'argvx', '--argvy'].join(' '),\n  function (error) {\n    if (error) return console.error(error);\n    console.log('exec done');\n  }\n);\n\nchild.stdout.pipe(process.stdout);\nchild.stderr.pipe(process.stderr);\n\nchild.on('exit', function (code) {\n  setTimeout(function () {\n    console.log('Child exited with code', code);\n  }, 100);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-exec-3.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar exec = require('child_process').exec;\n\nvar child = exec(\n  JSON.stringify(process.execPath) +\n    ' ' +\n    [require.resolve('./test-exec-child.js'), 'argvx', '--argvy'].join(' '),\n  function (error) {\n    if (error) return console.error(error);\n    console.log('exec done');\n  }\n);\n\nchild.stdout.pipe(process.stdout);\nchild.stderr.pipe(process.stderr);\n\nchild.on('exit', function (code) {\n  setTimeout(function () {\n    console.log('Child exited with code', code);\n  }, 100);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-exec-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(!process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from exec-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n"
  },
  {
    "path": "test/test-50-spawn/test-execFile-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(!process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from execFile-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n"
  },
  {
    "path": "test/test-50-spawn/test-execFile.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar execFile = require('child_process').execFile;\n\nvar child = execFile(\n  process.execPath,\n  [require.resolve('./test-execFile-child.js'), 'argvx', '--argvy'],\n  function (error) {\n    if (error) return console.error(error);\n    console.log('execFile done');\n  }\n);\n\nchild.stdout.pipe(process.stdout);\nchild.stderr.pipe(process.stderr);\n\nchild.on('exit', function (code) {\n  setTimeout(function () {\n    console.log('Child exited with code', code);\n  }, 100);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-execFileSync-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(!process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from execFileSync-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n"
  },
  {
    "path": "test/test-50-spawn/test-execFileSync.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar execFileSync = require('child_process').execFileSync;\n\nexecFileSync(\n  process.execPath,\n  [require.resolve('./test-execFileSync-child.js'), 'argvx', '--argvy'],\n  { stdio: 'inherit' }\n);\n"
  },
  {
    "path": "test/test-50-spawn/test-execSync-1.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\n// AppVeyor: unquoted execPath inside 'Program Files'\nif (process.platform === 'win32') return;\nvar execSync = require('child_process').execSync;\n\nexecSync(\n  process.execPath +\n    ' ' +\n    [require.resolve('./test-execSync-child.js'), 'argvx', '--argvy'].join(' '),\n  { stdio: 'inherit' }\n);\n"
  },
  {
    "path": "test/test-50-spawn/test-execSync-2.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar execSync = require('child_process').execSync;\n\nexecSync(\n  '\"' +\n    process.execPath +\n    '\" ' +\n    [require.resolve('./test-execSync-child.js'), 'argvx', '--argvy'].join(' '),\n  { stdio: 'inherit' }\n);\n"
  },
  {
    "path": "test/test-50-spawn/test-execSync-3.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar execSync = require('child_process').execSync;\n\nexecSync(\n  JSON.stringify(process.execPath) +\n    ' ' +\n    [require.resolve('./test-execSync-child.js'), 'argvx', '--argvy'].join(' '),\n  { stdio: 'inherit' }\n);\n"
  },
  {
    "path": "test/test-50-spawn/test-execSync-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(!process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from execSync-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n"
  },
  {
    "path": "test/test-50-spawn/test-node.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar spawnSync = require('child_process').spawnSync;\n\nvar child = spawnSync(process.execPath, ['-e', 'process.stdout.write(\"42\")'], {\n  stdio: 'pipe',\n  // if run under node (process.execPath points to node.exe),\n  // then node ignores PKG_EXECPATH, but if run as pkged app,\n  // PKG_INVOKE_NODEJS is a hack to access internal nodejs\n  env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },\n});\n\nconsole.log(child.stdout.toString());\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-a-1.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar spawn = require('child_process').spawn;\n\nif (process.send) {\n  require('./test-spawn-a-child.js');\n  return;\n}\n\nvar child = spawn(process.execPath, [__filename, 'argvx', '--argvy'], {\n  stdio: ['inherit', 'inherit', 'inherit', 'ipc'],\n});\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-a-2.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar path = require('path');\nvar spawn = require('child_process').spawn;\n\nif (process.send) {\n  require('./test-spawn-a-child.js');\n  return;\n}\n\nvar child = spawn(\n  process.execPath,\n  [path.basename(__filename), 'argvx', '--argvy'],\n  { stdio: ['inherit', 'inherit', 'inherit', 'ipc'] }\n);\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-a-3.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar spawn = require('child_process').spawn;\n\nvar child = spawn(\n  process.execPath,\n  [require.resolve('./test-spawn-a-child.js'), 'argvx', '--argvy'],\n  { stdio: ['inherit', 'inherit', 'inherit', 'ipc'] }\n);\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-a-4.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar spawn = require('child_process').spawn;\n\nif (process.send) {\n  require('./test-spawn-a-child.js');\n  return;\n}\n\nvar child = spawn(process.execPath, [process.argv[1], 'argvx', '--argvy'], {\n  stdio: ['inherit', 'inherit', 'inherit', 'ipc'],\n});\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-a-5.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar path = require('path');\nvar spawn = require('child_process').spawn;\n\nif (process.send) {\n  require('./test-spawn-a-child.js');\n  return;\n}\n\nvar child = spawn(\n  process.argv[0],\n  [path.join(process.cwd(), path.basename(__filename)), 'argvx', '--argvy'],\n  { stdio: ['inherit', 'inherit', 'inherit', 'ipc'] }\n);\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-a-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from spawn-a-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n\nprocess.on('message', function (value) {\n  if (value === 128) process.exit();\n  process.send(value * 2);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-b-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from spawn-b-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n\nprocess.on('message', function (value) {\n  if (value === 128) process.exit();\n  process.send(value * 2);\n});\n\nvar fs = require('fs');\n\ntry {\n  // must patch fs even if entrypoint is not in snapshot\n  console.log(fs.readFileSync('dirty-hack-for-testing-purposes'));\n} catch (error) {\n  if (!process.pkg) console.log('dirty-hack-for-testing-purposes');\n}\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-b.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar path = require('path');\nvar spawn = require('child_process').spawn;\n\nvar child = spawn(\n  process.execPath,\n  [path.join(process.cwd(), 'test-spawn-b-child.js'), 'argvx', '--argvy'],\n  { stdio: ['inherit', 'inherit', 'inherit', 'ipc'] }\n);\n\nchild.on('message', function (value) {\n  console.log(value.toString());\n  child.send(value);\n});\n\nchild.send(2);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-c-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(!process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from spawn-c-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-c.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nif (process.platform !== 'win32') return;\nvar spawn = require('child_process').spawn;\n\nvar child = spawn(\n  'cmd.exe',\n  [\n    '/s',\n    '/c',\n    '\"node ' + require.resolve('./test-spawn-c-child.js') + ' argvx argvy\"',\n  ],\n  { stdio: 'inherit', windowsVerbatimArguments: true }\n);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-d-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(!process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from spawn-d-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n"
  },
  {
    "path": "test/test-50-spawn/test-spawn-d.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar pp = process.platform;\nif (pp !== 'darwin' && pp !== 'linux') return;\nvar spawn = require('child_process').spawn;\n\nvar child = spawn(\n  '/bin/bash',\n  ['-c', 'node ' + require.resolve('./test-spawn-d-child.js') + ' argvx argvy'],\n  { stdio: 'inherit' }\n);\n\nchild.on('exit', function (code) {\n  console.log('Child exited with code', code);\n});\n"
  },
  {
    "path": "test/test-50-spawn/test-spawnSync-child.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar assert = require('assert');\nvar cluster = require('cluster');\n\nassert(!process.send);\nassert(!cluster.worker);\n\nconsole.log('Hello from spawnSync-child!');\nconsole.log('Args', JSON.stringify(process.argv.slice(2)));\n"
  },
  {
    "path": "test/test-50-spawn/test-spawnSync.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar spawnSync = require('child_process').spawnSync;\n\nvar child = spawnSync(\n  process.execPath,\n  [require.resolve('./test-spawnSync-child.js'), 'argvx', '--argvy'],\n  { stdio: 'inherit' }\n);\n\nconsole.log('Child exited with code', child.status);\n"
  },
  {
    "path": "test/test-50-symlink/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\n// test symlinks on unix only // TODO junction\nif (process.platform === 'win32') return;\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\nconst symlink = './test-symlink.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nfs.symlinkSync(output, symlink);\n\nright = utils.spawn.sync('./' + path.basename(symlink), [], {\n  cwd: path.dirname(symlink),\n});\n\nassert.strictEqual(right, '42\\n');\nutils.vacuum.sync(output);\nutils.vacuum.sync(symlink);\n"
  },
  {
    "path": "test/test-50-symlink/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(42);\n"
  },
  {
    "path": "test/test-50-tamper-core/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet left, right;\nutils.mkdirp.sync(path.dirname(output));\n\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-50-tamper-core/test-x-index.js",
    "content": "'use strict';\n\nvar fsname = 'fs';\nvar fs = require(fsname);\nvar pathname = 'path';\nvar pathp = require.resolve(pathname);\nvar path = require(pathp);\n\nconsole.log(\n  [\n    typeof fs,\n    fs ? typeof fs.statSync : 'empty',\n    typeof path,\n    path ? typeof path.basename : 'empty',\n  ].join('\\n')\n);\n"
  },
  {
    "path": "test/test-50-undo-patch/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet right;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), ['./test-y-index.js'], {\n  cwd: path.dirname(output),\n  env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },\n});\n\nassert.strictEqual(right, 'ok\\n');\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-50-undo-patch/test-x-index.js",
    "content": "'use strict';\n\nconsole.log('should not be executed');\n"
  },
  {
    "path": "test/test-50-undo-patch/test-y-index.js",
    "content": "'use strict';\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-77-compare-dicts-and-tests/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\n\nlet configs = fs.readdirSync('../../dictionary');\nconfigs = configs\n  .filter(function (config) {\n    return config !== '.eslintrc.json';\n  })\n  .map(function (config) {\n    assert.strictEqual(config.slice(-3), '.js');\n    return config.slice(0, -3);\n  });\n\nlet tests = fs.readdirSync('../test-79-npm');\ntests = tests.filter(function (test) {\n  if (test === '_isolator') return false;\n  const full = path.join('../test-79-npm', test);\n  return fs.statSync(full).isDirectory();\n});\n\ntests.push('etc'); // TODO who creates it?\ntests.push('steam-resources'); // absent in npm. installed via github\n\nconfigs.push('etc'); // TODO who creates it?\nconfigs.push('express-with-jade');\nconfigs.push('redis-with-hiredis');\n\nlet absent = false;\n\nconfigs.some(function (config) {\n  if (tests.indexOf(config) < 0) {\n    console.log(config + ' is absent in tests');\n    absent = true;\n  }\n});\n\ntests.some(function (test) {\n  if (configs.indexOf(test) < 0) {\n    console.log(test + ' is absent in dictionary');\n    absent = true;\n  }\n});\n\nassert(!absent);\n"
  },
  {
    "path": "test/test-78-verify-pkg-version/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './test-output.exe';\n\nlet left, right;\n\nleft = require('../../package.json').version;\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(left[0], '5');\nassert.strictEqual(right[0], '5');\nassert.strictEqual(left + '\\n', right);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-78-verify-pkg-version/test-x-index.js",
    "content": "'use strict';\n\nconsole.log(process.versions.pkg);\n"
  },
  {
    "path": "test/test-79-npm/angular-bridge/angular-bridge.js",
    "content": "'use strict';\n\nvar Bridge = require('angular-bridge');\nif (typeof Bridge === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/angular-bridge/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/any-promise/any-promise.js",
    "content": "'use strict';\n\nvar Promise = require('any-promise');\n\nfunction p() {\n  return new Promise((resolve) => {\n    resolve('ok');\n  });\n}\n\np().then((result) => {\n  console.log(result);\n});\n"
  },
  {
    "path": "test/test-79-npm/any-promise/any-promise.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: stamp.m >= 46,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/any-promise/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/async/async.js",
    "content": "'use strict';\n\nvar async = require('async');\nif (async.waterfall) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/async/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/aws-sdk/aws-sdk.js",
    "content": "'use strict';\n\nvar aws = require('aws-sdk');\n\nvar s3 = new aws.S3({\n  accessKeyId: 'ABRACADABRABRACADABR',\n  secretAccessKey: 'TdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTd',\n});\n\ns3.listObjects(\n  {\n    Bucket: 'enclosejs',\n  },\n  function (error) {\n    if (error) {\n      if (error.message.indexOf('does not exist') >= 0) {\n        console.log('ok');\n      }\n    }\n  }\n);\n"
  },
  {
    "path": "test/test-79-npm/aws-sdk/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/babel-core/babel-core.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar babel = require('babel-core');\nvar body8 = fs.readFileSync(path.join(__dirname, 'babel-core.txt'), 'utf8');\nvar code = babel.transform(body8, { ast: false }).code;\nif (code.length > 20) console.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/babel-core/babel-core.txt",
    "content": "let p = process;\nObject.keys(p).some((key) => {\n  console.log(key);\n});\n"
  },
  {
    "path": "test/test-79-npm/babel-core/babel-core@4.7.16.js",
    "content": "'use strict';\n\nrequire('./babel-core.js');\n"
  },
  {
    "path": "test/test-79-npm/babel-core/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/batch/batch.js",
    "content": "'use strict';\n\nvar Batch = require('batch');\nvar batch = new Batch();\n\nbatch.concurrency(4);\n\nvar ids = [4, 7, 12, 25];\n\nids.forEach(function () {\n  batch.push(function (done) {\n    setTimeout(function () {\n      done();\n    }, 100);\n  });\n});\n\nvar passed = 0;\n\nbatch.on('progress', function () {\n  passed += 1;\n});\n\nbatch.end(function (error) {\n  if (error) {\n    throw error;\n  }\n  if (passed > 3) {\n    console.log('ok');\n  }\n});\n"
  },
  {
    "path": "test/test-79-npm/batch/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/bcrypt/bcrypt.js",
    "content": "'use strict';\n\nvar bcrypt = require('bcrypt');\nvar saltRounds = 10;\nvar myPlaintextPassword = 'P4$$w0rD';\nbcrypt.genSalt(saltRounds, function (error, salt) {\n  if (error) return;\n  bcrypt.hash(myPlaintextPassword, salt, function (error2, hash) {\n    if (error2) return;\n    if (typeof hash === 'string') {\n      console.log('ok');\n    }\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/bcrypt/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/better-sqlite3/.gitignore",
    "content": "*.sqlite\n"
  },
  {
    "path": "test/test-79-npm/better-sqlite3/better-sqlite3.js",
    "content": "'use strict';\n\nconst db = require('better-sqlite3')('test-db.sqlite');\n\ndb.exec('CREATE TABLE IF NOT EXISTS cats ( name TEXT , age INTEGER )');\n\nconst insert = db.prepare('INSERT INTO cats (name, age) VALUES (@name, @age)');\n\nconst insertMany = db.transaction((cats) => {\n  for (const cat of cats) insert.run(cat);\n});\n\ninsertMany([\n  { name: 'Joey', age: 2 },\n  { name: 'Sally', age: 4 },\n  { name: 'Junior', age: 1 },\n]);\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/better-sqlite3/better-sqlite3.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/better-sqlite3/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/bignum/bignum.js",
    "content": "'use strict';\n\nvar bignum = require('bignum');\nif (bignum.div) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/bignum/bignum.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    note: 'requires C:\\\\OpenSSL-Win64\\\\lib\\\\libeay32.lib',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/bignum/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/bindings/bindings.js",
    "content": "'use strict';\n\nvar bindings = require('bindings');\nif (typeof bindings === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/bindings/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/blessed/blessed.js",
    "content": "'use strict';\n\nvar blessed = require('blessed');\nif (typeof blessed === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/blessed/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/body-parser/body-parser.js",
    "content": "'use strict';\n\nvar parser = require('body-parser');\nvar req = { headers: {} };\nvar res = {};\n\nvar middleware = parser.json();\n\nmiddleware(req, res, function () {\n  var middleware2 = parser.urlencoded({ extended: true });\n  middleware2(req, res, function () {\n    var middleware3 = parser.urlencoded({ extended: false });\n    middleware3(req, res, function () {\n      console.log('ok');\n    });\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/body-parser/body-parser@1.10.2.js",
    "content": "'use strict';\n\nrequire('./body-parser.js');\n"
  },
  {
    "path": "test/test-79-npm/body-parser/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/browserify/browserify.js",
    "content": "'use strict';\n\n// dont remove --help\nprocess.argv.push('--help');\nrequire('browserify/bin/cmd.js');\n\nsetTimeout(function () {\n  console.log('ok');\n}, 200);\n"
  },
  {
    "path": "test/test-79-npm/browserify/browserify.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    take: 'last-line',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/browserify/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/bson/bson.js",
    "content": "'use strict';\n\nvar bson = require('bson');\n\nvar Long = bson.Long;\nvar doc = { long: Long.fromNumber(100) };\nvar BSON = bson.BSON;\nvar obj = new BSON();\nvar data = obj.serialize(doc, false, true, false);\nvar doc2 = obj.deserialize(data);\n\nif (doc2.long === 100) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/bson/bson@0.2.22.js",
    "content": "'use strict';\n\nvar bson = require('bson');\n\nvar pure = {};\npure.Long = bson.pure().Long;\npure.doc = { long: pure.Long.fromNumber(100) };\npure.BSON = bson.pure().BSON;\npure.obj = new pure.BSON();\npure.data = pure.obj.serialize(pure.doc, false, true, false);\npure.doc2 = pure.obj.deserialize(pure.data);\n\nvar natv = {};\nnatv.Long = bson.native().Long;\nnatv.doc = { long: natv.Long.fromNumber(200) };\nnatv.BSON = bson.native().BSON;\nnatv.obj = new natv.BSON();\nnatv.data = natv.obj.serialize(natv.doc, false, true, false);\nnatv.doc2 = natv.obj.deserialize(natv.data);\n\nif (pure.doc2.long === 100) {\n  if (natv.doc2.long === 200) {\n    console.log('ok');\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/bson/bson@0.2.22.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    take: 'last-line',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/bson/bson@0.4.0.js",
    "content": "'use strict';\n\nrequire('./bson@0.2.22.js');\n"
  },
  {
    "path": "test/test-79-npm/bson/bson@0.4.0.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./bson@0.2.22.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/bson/bson@1.0.0.js",
    "content": "'use strict';\n\nrequire('./bson.js');\n"
  },
  {
    "path": "test/test-79-npm/bson/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/buffermaker/buffermaker.js",
    "content": "'use strict';\n\nvar Buffermaker = require('buffermaker');\nvar buffermaker = new Buffermaker();\nif (buffermaker.plan) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/buffermaker/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/bunyan/bunyan.js",
    "content": "'use strict';\n\nvar bunyan = require('bunyan');\nvar fs = require('fs');\n\nvar logger = bunyan.createLogger({\n  name: 'pkg',\n  streams: [\n    {\n      type: 'rotating-file',\n      path: 'pkg.log',\n      level: 'info',\n    },\n  ],\n});\n\nif (logger) {\n  fs.unlinkSync('pkg.log');\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/bunyan/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/busboy/busboy.js",
    "content": "'use strict';\n\nvar busboy = require('busboy');\nif (typeof busboy === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/busboy/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/bytes/bytes.js",
    "content": "'use strict';\n\nvar bytes = require('bytes');\nif (bytes(1024 * 1.7, { decimalPlaces: 0 }) === '2KB') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/bytes/bytes@2.5.0.js",
    "content": "'use strict';\n\nvar bytes = require('bytes');\nif (bytes(1024 * 1.7, { decimalPlaces: 0 }) === '2kB') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/bytes/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/callsites/callsites.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar callsites = require('callsites');\nvar fns = callsites().map(function (c) {\n  return c.getFileName();\n});\nif (\n  fns[1] === 'pkg/prelude/bootstrap.js' ||\n  path.basename(fns[0]) === 'callsites.js'\n) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/callsites/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/checklist.htm",
    "content": "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en-us\">\n  <head>\n    <script src=\"checklist.js\"></script>\n  </head>\n  <body></body>\n  <script>\n    var add = '<table>';\n    var columns = [];\n    add = add + '<tr>';\n    add = add + '<td></td>';\n\n    Object.keys(table).forEach(function (row_key) {\n      var row = table[row_key];\n      Object.keys(row).forEach(function (cell_key) {\n        if (columns.indexOf(cell_key) < 0) {\n          var narrow = cell_key\n            .replace(/\\//g, '<br>')\n            .replace(/win32/g, 'win')\n            .replace(/linux/g, 'lnx')\n            .replace(/darwin/g, 'dwn');\n          add = add + '<td>' + narrow + '</td>';\n          columns.push(cell_key);\n        }\n      });\n    });\n\n    add = add + '</tr>';\n\n    Object.keys(table).forEach(function (row_key) {\n      var row = table[row_key];\n      add = add + '<tr>';\n      add = add + '<td>' + row_key + '</td>';\n      columns.forEach(function (column) {\n        var cell = row[column];\n        if (typeof cell === 'undefined') cell = 'n/a';\n        cell = cell.split(',')[0];\n        cell = cell.replace(/error/g, 'err');\n        var bcolor = 'red';\n        var fcolor = 'white';\n        if (cell === 'ok') bcolor = 'green';\n        if (cell === 'nop') bcolor = 'blue';\n        if (cell === 'n/a') {\n          cell = 'n/a';\n          bcolor = 'white';\n          fcolor = 'black';\n        }\n        var style = 'background-color:' + bcolor;\n        style = style + ';color:' + fcolor;\n        add = add + \"<td style='\" + style + \"'>\" + cell + '</td>';\n      });\n      add = add + '</tr>';\n    });\n\n    add = add + '</table>';\n    document.body.innerHTML = add;\n  </script>\n</html>\n"
  },
  {
    "path": "test/test-79-npm/checklist.js",
    "content": "/* eslint-disable no-unused-vars */\n/* eslint-disable quotes */\n\n'use strict';\n\nconst table = {};\nconst changes = [];\n"
  },
  {
    "path": "test/test-79-npm/chokidar/chokidar.js",
    "content": "'use strict';\n\nvar chokidar = require('chokidar');\n\nvar watcher = chokidar.watch('./chokidar.js', {\n  persistent: true,\n});\n\nwatcher.on('ready', function () {\n  console.log('ok');\n  process.exit();\n});\n"
  },
  {
    "path": "test/test-79-npm/chokidar/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/coffee-script/coffee-script-example.coffee",
    "content": "console.log 'ok'\n"
  },
  {
    "path": "test/test-79-npm/coffee-script/coffee-script.js",
    "content": "'use strict';\n\nvar path = require('path');\nprocess.argv.push(path.join(__dirname, 'coffee-script-example.coffee'));\nrequire('coffee-script/bin/coffee');\n"
  },
  {
    "path": "test/test-79-npm/coffee-script/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/colors/colors.js",
    "content": "'use strict';\n\nvar colors = require('colors');\n\nif (typeof colors.green === 'function') {\n  var gopd = Object.getOwnPropertyDescriptor;\n  var grass = gopd(String.prototype, 'green');\n  if (grass && typeof grass.get === 'function') {\n    console.log('ok');\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/colors/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/compression/compression.js",
    "content": "'use strict';\n\nvar compression = require('compression');\nvar req = { headers: {} };\nvar res = {};\n\nvar middleware = compression();\n\nmiddleware(req, res, function () {\n  console.log('ok');\n});\n"
  },
  {
    "path": "test/test-79-npm/compression/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/compressjs/compressjs.js",
    "content": "'use strict';\n\nvar compressjs = require('compressjs');\nvar algorithm = compressjs.Lzp3;\n\nif (algorithm.MAGIC === 'lzp3') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/compressjs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/connect/connect.js",
    "content": "'use strict';\n\nvar connect = require('connect');\nif (typeof connect === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/connect/connect@2.3.9.js",
    "content": "'use strict';\n\nvar connect = require('connect');\nvar noop = function () {};\nvar req = { headers: {}, url: '/', originalUrl: '/' };\nvar res = {\n  setHeader: noop,\n  end: function (s) {\n    if (s.length > 100) {\n      console.log('ok');\n      process.exit();\n    }\n  },\n};\n\nvar middleware = connect.directory.html;\n\nmiddleware(\n  req,\n  res,\n  ['file-name'],\n  function () {\n    console.log('Error not expected');\n  },\n  'directory-name'\n);\n"
  },
  {
    "path": "test/test-79-npm/connect/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/connect-mongo/connect-mongo.js",
    "content": "'use strict';\n\nfunction Store() {\n  this.emit = function () {};\n}\n\nfunction MemoryStore() {}\n\nvar session = { Store: Store, MemoryStore: MemoryStore };\nvar MongoStore = require('connect-mongo')(session);\nif (typeof MongoStore === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/connect-mongo/connect-mongo.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: stamp.m >= 46,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/connect-mongo/connect-mongo@0.8.2.js",
    "content": "'use strict';\n\nrequire('./connect-mongo.js');\n"
  },
  {
    "path": "test/test-79-npm/connect-mongo/connect-mongo@0.8.2.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./connect-mongo.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/connect-mongo/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/connect-mongodb/connect-mongodb.js",
    "content": "'use strict';\n\nvar MongoStore = require('connect-mongodb');\nif (typeof MongoStore === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/connect-mongodb/connect-mongodb.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    take: 'last-line',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/connect-mongodb/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/connect-redis/connect-redis.js",
    "content": "'use strict';\n\nfunction Store() {\n  this.emit = function () {};\n}\n\nfunction MemoryStore() {}\n\nvar session = { Store: Store, MemoryStore: MemoryStore };\nvar RedisStore = require('connect-redis')(session);\nif (typeof RedisStore === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/connect-redis/connect-redis.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: stamp.m >= 46,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/connect-redis/connect-redis@2.5.1.js",
    "content": "'use strict';\n\nrequire('./connect-redis.js');\n"
  },
  {
    "path": "test/test-79-npm/connect-redis/connect-redis@2.5.1.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./connect-redis.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/connect-redis/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/consolidate/consolidate.js",
    "content": "'use strict';\n\nrequire('consolidate');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/consolidate/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/cookie/cookie.js",
    "content": "'use strict';\n\nvar cookie = require('cookie');\nvar cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2');\nif (cookies.equation === 'E=mc^2') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/cookie/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/cookie-parser/cookie-parser.js",
    "content": "'use strict';\n\nvar cookieParser = require('cookie-parser');\nvar req = { headers: { cookie: 'MyCookie=Hello' } };\nvar res = {};\n\nvar middleware = cookieParser();\n\nmiddleware(req, res, function () {\n  if (req.cookies) {\n    if (req.cookies.MyCookie === 'Hello') {\n      console.log('ok');\n    }\n  }\n});\n"
  },
  {
    "path": "test/test-79-npm/cookie-parser/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/cors/cors.js",
    "content": "'use strict';\n\nvar cors = require('cors');\nvar req = { method: 'OPTIONS', headers: {} };\nvar res = {\n  headers: {},\n  getHeader: function (name) {\n    return this.headers[name];\n  },\n  setHeader: function (name, value) {\n    this.headers[name] = value;\n  },\n  end: function () {\n    if (res.headers['Access-Control-Allow-Origin'] === '*') {\n      console.log('ok');\n    }\n  },\n};\n\nvar middleware = cors();\nmiddleware(req, res);\n"
  },
  {
    "path": "test/test-79-npm/cors/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/cron/cron.js",
    "content": "'use strict';\n\nvar CronJob = require('cron').CronJob;\n\nvar counter = 0;\n\nnew CronJob( // eslint-disable-line no-new\n  '* * * * * *',\n  function () {\n    counter += 1;\n  },\n  null,\n  true,\n  'America/Los_Angeles'\n);\n\nsetTimeout(function () {\n  if (counter === 4) console.log('ok');\n  process.exit();\n}, 4500);\n"
  },
  {
    "path": "test/test-79-npm/cron/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/cross-env/cross-env.js",
    "content": "'use strict';\n\nrequire('cross-env');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/cross-env/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/cross-spawn-async/cross-spawn-async.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar spawn = require('cross-spawn-async');\nvar bin = path.join(__dirname, 'fixture.js');\nvar args = [];\n\nif (process.pkg) {\n  args.unshift(bin);\n  bin = process.execPath;\n} else {\n  fs.chmodSync(bin, 511);\n}\n\nspawn(bin, args, { stdio: 'inherit' });\n"
  },
  {
    "path": "test/test-79-npm/cross-spawn-async/fixture.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/cross-spawn-async/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/curve25519/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/curve25519/see.hap-nodejs.meta.js",
    "content": "// hap-nodejs использует git-версию\n// а та, что в npm даже не компилируется\n"
  },
  {
    "path": "test/test-79-npm/data-preflight/data-preflight.js",
    "content": "'use strict';\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/data-preflight/data-preflight.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    allow: false,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/data-preflight/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/debug/debug.js",
    "content": "'use strict';\n\nvar debug = require('debug');\nif (typeof debug === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/debug/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/denymount/denymount.js",
    "content": "'use strict';\n\nvar denymount = require('denymount');\nif (typeof denymount === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/denymount/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/diff/diff.js",
    "content": "'use strict';\n\nvar jsdiff = require('diff');\nvar one = 'beep boop';\nvar other = 'beep boob blah';\nvar diff = jsdiff.diffChars(one, other);\nvar join = '';\n\ndiff.forEach(function (part) {\n  var color = 'grey';\n  if (part.added) color = 'green';\n  if (part.removed) color = 'red';\n  join += color + ':[' + part.value + ']';\n});\n\nif (join === 'grey:[beep boo]red:[p]green:[b blah]') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/diff/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/drivelist/drivelist.js",
    "content": "'use strict';\n\nrequire('./drivelist@3.0.0.js');\n"
  },
  {
    "path": "test/test-79-npm/drivelist/drivelist.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./drivelist@3.0.0.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/drivelist/drivelist@3.0.0.js",
    "content": "'use strict';\n\nvar drivelist = require('drivelist');\ndrivelist.list(function (error, list) {\n  if (error) throw error;\n  if (list.length > 0) {\n    console.log('ok');\n  }\n});\n"
  },
  {
    "path": "test/test-79-npm/drivelist/drivelist@3.0.0.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    deployFilesFrom: ['drivelist'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/drivelist/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/ed25519/ed25519.js",
    "content": "'use strict';\n\nvar ed25519 = require('ed25519');\nif (ed25519.MakeKeypair) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/ed25519/ed25519.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    note: 'requires C:\\\\OpenSSL-Win64\\\\lib\\\\libeay32.lib',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/ed25519/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/ejs/ejs.js",
    "content": "'use strict';\n\nvar ejs = require('ejs');\n\nvar s = '<% if (user) { %><h2><%= user.name %></h2><% } %>';\n\nvar template = ejs.compile(s, { client: true });\nvar out = template({ user: { name: 'klopov' } });\nif (out === '<h2>klopov</h2>') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/ejs/ejs@0.8.8.js",
    "content": "'use strict';\n\nrequire('./ejs.js');\n"
  },
  {
    "path": "test/test-79-npm/ejs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/elasticsearch/elasticsearch.js",
    "content": "'use strict';\n\nrequire('elasticsearch');\nvar Log = require('elasticsearch/src/lib/log.js');\nvar log = new Log({ log: ['warning'] });\nlog.warning('warning');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/elasticsearch/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/electron/electron.js",
    "content": "'use strict';\n\n// see nightmare\nrequire('electron');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/electron/electron.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    deployFilesFrom: ['electron'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/electron/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/emailjs/emailjs.js",
    "content": "'use strict';\n\nvar emailjs = require('emailjs');\nif (typeof emailjs.server.connect === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/emailjs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/engine.io/engine.io.js",
    "content": "'use strict';\n\nvar http = require('http');\nvar engine = require('engine.io');\nengine.listen(3000);\n\nsetTimeout(function () {\n  http.get('http://127.0.0.1:3000/socket.io/socket.io.js', function (res) {\n    var chunks = '';\n    res\n      .on('data', function (chunk) {\n        chunks += chunk.toString();\n      })\n      .on('end', function () {\n        if (chunks === 'Not Implemented') {\n          console.log('ok');\n        }\n        process.exit();\n      });\n  });\n}, 100);\n"
  },
  {
    "path": "test/test-79-npm/engine.io/engine.io@1.8.0.js",
    "content": "'use strict';\n\nrequire('./engine.io.js');\n"
  },
  {
    "path": "test/test-79-npm/engine.io/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/epoll/epoll.js",
    "content": "'use strict';\n\nvar Epoll = require('epoll').Epoll;\nif (Epoll.EPOLLPRI) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/epoll/epoll.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp) && stamp.p === 'linux',\n    note: 'only linux is supported',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/epoll/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/errorhandler/errorhandler.js",
    "content": "'use strict';\n\nvar errorhandler = require('errorhandler');\nvar noop = function () {};\nvar req = { headers: { Accept: 'text/html' } };\nvar res = { setHeader: noop, end: noop };\n\nvar middleware = errorhandler();\nvar wasCalled = false;\n\nmiddleware('Message', req, res, function () {\n  wasCalled = true;\n});\n\nsetTimeout(function () {\n  if (!wasCalled) console.log('ok');\n}, 200);\n"
  },
  {
    "path": "test/test-79-npm/errorhandler/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/errors/errors.js",
    "content": "'use strict';\n\nrequire('errors');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/errors/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/eslint/eslint.js",
    "content": "'use strict';\n\nrequire('eslint/bin/eslint.js');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/eslint/eslint.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    take: 'last-line',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/eslint/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/etcher-image-write/etcher-image-write.js",
    "content": "'use strict';\n\nvar writer = require('etcher-image-write');\nif (writer.write) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/etcher-image-write/etcher-image-write.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp) && stamp.m >= 48,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/etcher-image-write/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/exceljs/exceljs.js",
    "content": "'use strict';\n\nvar Excel = require('exceljs');\nvar workbook = new Excel.Workbook();\nif (workbook.created) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/exceljs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/exiftool.pl/exiftool.pl.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar exiftool = require('exiftool.pl');\n\nif (fs.existsSync(exiftool)) {\n  console.log('ok');\n} else {\n  console.log('Unable to open file:', exiftool);\n}\n"
  },
  {
    "path": "test/test-79-npm/exiftool.pl/exiftool.pl.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    deployFilesFrom: ['exiftool.pl'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/exiftool.pl/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/express/express.js",
    "content": "'use strict';\n\nvar express = require('express');\nif (typeof express === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/express/express@3.5.3.js",
    "content": "'use strict';\n\nrequire('./express.js');\n"
  },
  {
    "path": "test/test-79-npm/express/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/express-load/controllers/fixture.js",
    "content": "'use strict';\n\nmodule.exports.index = function (req, res, next) {\n  res.send('Hello world!');\n  if (next) return next();\n};\n"
  },
  {
    "path": "test/test-79-npm/express-load/express-load.config.json",
    "content": "{\n  \"bin\": \"express-load.js\",\n  \"pkg\": {\n    \"scripts\": [\"controllers/*.js\", \"routes/*.js\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/express-load/express-load.js",
    "content": "'use strict';\n\nvar load = require('express-load');\n\nvar app = {};\napp.get = function () {};\napp.index = 'Welcome!';\n\nvar opts = {};\n// opts.verbose = true;\n\nload('controllers', opts).then('routes').into(app);\n\nif (app.controllers.fixture && app.routes.fixture) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/express-load/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/express-load/routes/fixture.js",
    "content": "'use strict';\n\nmodule.exports = function (app) {\n  return app.controllers.fixture.index;\n};\n"
  },
  {
    "path": "test/test-79-npm/express-session/express-session.js",
    "content": "'use strict';\n\nvar session = require('express-session');\nvar req = { url: '/', headers: {} };\nvar res = {};\n\nfunction genuuid() {\n  return 'SESSIONID';\n}\n\nvar middleware = session({\n  genid: function () {\n    return genuuid();\n  },\n  resave: false,\n  saveUninitialized: false,\n  secret: 'keyboard cat',\n});\n\nmiddleware(req, res, function () {\n  if (req.sessionID === 'SESSIONID') {\n    console.log('ok');\n  }\n});\n"
  },
  {
    "path": "test/test-79-npm/express-session/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express.config.json",
    "content": "{\n  \"bin\": \"express.js\",\n  \"dependencies\": {\n    \"jade\": \"*\"\n  },\n  \"pkg\": {\n    \"assets\": [\"views/*.jade\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express.js",
    "content": "'use strict';\n\nvar http = require('http');\nvar express = require('express');\nvar app = express();\napp.set('views', 'views');\napp.set('view engine', 'jade');\n\napp.get('/', function (req, res) {\n  res.render('fixture.jade', { title: 'Hey', message: 'Hello there!' });\n});\n\nvar server = app.listen(1337, function () {\n  var port = server.address().port;\n  setTimeout(function () {\n    http.get('http://127.0.0.1:' + port.toString() + '/', function (res) {\n      var chunks = '';\n      res\n        .on('data', function (chunk) {\n          chunks += chunk.toString();\n        })\n        .on('end', function () {\n          if (\n            chunks ===\n            '<html><head><title>Hey</title></head>' +\n              '<body><h1>Hello there!</h1></body></html>'\n          ) {\n            console.log('ok');\n          }\n          server.close();\n        });\n    });\n  }, 100);\n});\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    packages: ['jade'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express@3.0.6.config.json",
    "content": "{\n  \"bin\": \"express@3.0.6.js\",\n  \"dependencies\": {\n    \"jade\": \"*\"\n  },\n  \"pkg\": {\n    \"assets\": [\"views/*.jade\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express@3.0.6.js",
    "content": "'use strict';\n\nrequire('./express.js');\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express@3.0.6.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./express.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express@3.21.2.config.json",
    "content": "{\n  \"bin\": \"express@3.21.2.js\",\n  \"dependencies\": {\n    \"jade\": \"*\"\n  },\n  \"pkg\": {\n    \"assets\": [\"views/*.jade\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express@3.21.2.js",
    "content": "'use strict';\n\nrequire('./express.js');\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/express@3.21.2.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./express.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/express-with-jade/views/fixture.jade",
    "content": "html\r\n  head\r\n    title!= title\r\n  body\r\n    h1!= message\r\n"
  },
  {
    "path": "test/test-79-npm/extender/extender.js",
    "content": "'use strict';\n\nvar extender = require('extender');\n\nvar e = extender.define({\n  multiply: function (str, times) {\n    var ret = str;\n    for (var i = 1; i < times; i += 1) {\n      ret += str;\n    }\n    return ret;\n  },\n});\n\nvar v = e('hello').multiply(2).value();\n\nif (v === 'hellohello') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/extender/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/extsprintf/extsprintf.js",
    "content": "'use strict';\n\nvar sprintf = require('extsprintf').sprintf;\nif (typeof sprintf === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/extsprintf/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/faye-websocket/faye-websocket.js",
    "content": "'use strict';\n\nvar websocket = require('faye-websocket');\nif (websocket.Client) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/faye-websocket/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/feathers/feathers.js",
    "content": "'use strict';\n\nvar feathers = require('feathers');\nvar http = require('http');\nvar app = feathers();\n\napp.get('/', function (req, res) {\n  res.end('Hello there!');\n});\n\nvar server = app.listen(1337, function () {\n  var port = server.address().port;\n  setTimeout(function () {\n    http.get('http://127.0.0.1:' + port.toString() + '/', function (res) {\n      var chunks = '';\n      res\n        .on('data', function (chunk) {\n          chunks += chunk.toString();\n        })\n        .on('end', function () {\n          if (chunks === 'Hello there!') {\n            console.log('ok');\n          }\n          server.close();\n        });\n    });\n  }, 100);\n});\n"
  },
  {
    "path": "test/test-79-npm/feathers/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/findup-sync/findup-sync.js",
    "content": "'use strict';\n\nvar findup = require('findup-sync');\nvar pj = findup('package.json');\nconsole.log(pj ? 'ok' : 'bad');\n"
  },
  {
    "path": "test/test-79-npm/findup-sync/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/floordate/floordate.js",
    "content": "'use strict';\n\nvar floordate = require('floordate');\nvar d = new Date();\nvar v = floordate(d, 'year').getFullYear();\nif (v > 2015 && v < 2075) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/floordate/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/fmt/fmt.js",
    "content": "'use strict';\n\nvar fmt = require('fmt');\n\nvar save;\nconsole.log = function (s) {\n  save = s;\n};\n\nfmt.sep();\n\nif (save.slice(0, 3) === '===') {\n  process.stdout.write('ok\\n');\n}\n"
  },
  {
    "path": "test/test-79-npm/fmt/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/formidable/formidable.js",
    "content": "'use strict';\n\nrequire('formidable');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/formidable/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/fs-extra/fs-extra.js",
    "content": "'use strict';\n\n// only pkg-ed run\nif (!process.pkg) {\n  console.log('ok');\n  return;\n}\n\nvar fs = require('fs-extra');\nvar hack = 'dirty-hack-for-testing-purposes';\nif (fs.readFileSync(hack) === hack) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/fs-extra/fs-extra@0.20.1.js",
    "content": "'use strict';\n\nrequire('./fs-extra.js');\n"
  },
  {
    "path": "test/test-79-npm/fs-extra/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/fsevents/fsevents.js",
    "content": "'use strict';\n\nvar fsevents = require('fsevents');\nif (typeof fsevents === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/fsevents/fsevents.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp) && stamp.p === 'darwin',\n    note: 'only macos is supported',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/fsevents/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/geoip-lite/geoip-lite.js",
    "content": "'use strict';\n\nvar geoip = require('geoip-lite');\nvar ip = '207.97.227.239';\nvar geo = geoip.lookup(ip);\nif (geo.country === 'US') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/geoip-lite/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/github/github.js",
    "content": "'use strict';\n\nvar GitHubApi = require('github');\nvar github = new GitHubApi();\ngithub.users.getForUser(\n  {\n    username: 'igorklopov',\n  },\n  function (error, res) {\n    if (error) return;\n    if (res.data.name === 'Igor Klopov') {\n      console.log('ok');\n    }\n  }\n);\n"
  },
  {
    "path": "test/test-79-npm/github/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/gm/gm.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar gm = require('gm').subClass({ imageMagick: true });\n\nvar input = path.join(__dirname, 'piechart.png');\nvar inputStream = fs.createReadStream(input);\nvar output = 'piechart-resize.png';\n\ngm(inputStream)\n  .resize(240, 240)\n  .write(output, function (error) {\n    if (error) throw error;\n    if (fs.existsSync(output)) {\n      fs.unlinkSync(output);\n      console.log('ok');\n    }\n  });\n"
  },
  {
    "path": "test/test-79-npm/gm/gm.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    note: 'requires GraphicsMagick/ImageMagick installed',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/gm/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/google-closure-compiler/google-closure-compiler.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar Compiler = require('google-closure-compiler').compiler;\nif (\n  fs.existsSync(Compiler.JAR_PATH) &&\n  Compiler.JAR_PATH.indexOf('snapshot') < 0\n) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/google-closure-compiler/google-closure-compiler.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    deployFilesFrom: ['google-closure-compiler-java'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/google-closure-compiler/google-closure-compiler@20180610.0.2.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar Compiler = require('google-closure-compiler').compiler;\nif (\n  fs.existsSync(Compiler.JAR_PATH) &&\n  Compiler.JAR_PATH.indexOf('snapshot') < 0\n) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/google-closure-compiler/google-closure-compiler@20180610.0.2.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    deployFilesFrom: ['google-closure-compiler'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/google-closure-compiler/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/google-closure-compiler-java/google-closure-compiler-java.js",
    "content": "'use strict';\n\nvar pathToCompiler = require('google-closure-compiler-java');\nif (pathToCompiler.indexOf('snapshot') < 0) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/google-closure-compiler-java/google-closure-compiler-java.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    deployFilesFrom: ['google-closure-compiler-java'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/google-closure-compiler-java/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/googleapis/googleapis.js",
    "content": "'use strict';\n\nvar google = require('googleapis');\nvar urlshortener = google.urlshortener('v1');\nif (urlshortener.url) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/googleapis/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/got/got.js",
    "content": "'use strict';\n\nvar got = require('got');\nif (typeof got === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/got/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/graceful-fs/graceful-fs.js",
    "content": "'use strict';\n\n// only pkg-ed run\nif (!process.pkg) {\n  console.log('ok');\n  return;\n}\n\nvar fs = require('graceful-fs');\nvar hack = 'dirty-hack-for-testing-purposes';\nif (fs.readFileSync(hack) === hack) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/graceful-fs/graceful-fs@3.0.8.js",
    "content": "'use strict';\n\nrequire('./graceful-fs.js');\n"
  },
  {
    "path": "test/test-79-npm/graceful-fs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/grpc/grpc.js",
    "content": "'use strict';\n\nvar grpc = require('grpc');\nif (grpc.status) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/grpc/grpc.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    note: 'seems not compatible with freebsd network headers',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/grpc/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/gulp/gulp-concat-01.txt",
    "content": "123"
  },
  {
    "path": "test/test-79-npm/gulp/gulp-concat-02.txt",
    "content": "456"
  },
  {
    "path": "test/test-79-npm/gulp/gulp.js",
    "content": "/* eslint-disable no-path-concat */\n\n'use strict';\n\nvar path = require('path');\nprocess.env.NODE_PATH = (process.env.NODE_PATH || '')\n  .split(path.delimiter)\n  .filter((p) => p)\n  .concat(__dirname + '/node_modules')\n  .join(path.delimiter);\nrequire('module')._initPaths(); // eslint-disable-line no-underscore-dangle\n\nrequire('gulp');\nrequire('gulp-concat');\nrequire('gulp/bin/gulp.js');\n"
  },
  {
    "path": "test/test-79-npm/gulp/gulp.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    packages: ['gulp-concat'],\n    deployFiles: ['gulp-concat-01.txt', 'gulp-concat-02.txt', 'gulpfile.js'],\n    take: 'last-line',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/gulp/gulpfile.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar gulp = require('gulp');\nvar concat = require('gulp-concat');\n\ngulp.task('default', function () {\n  gulp\n    .src('gulp-concat-*.txt')\n    .pipe(concat('gulp-concat-out.txt', { newLine: '' }))\n    .on('data', function (c) {\n      if (c._contents.toString() === '123456') {\n        (console._log_ || console.log)('ok');\n      }\n    });\n});\n"
  },
  {
    "path": "test/test-79-npm/gulp/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/hap-nodejs/hap-nodejs.js",
    "content": "'use strict';\n\nvar hap = require('hap-nodejs');\nif (hap.Service) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/hap-nodejs/hap-nodejs.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp, flags) {\n  if (flags.ci) {\n    return {\n      allow: false,\n      note: 'headless CI seems to fail',\n    };\n  }\n\n  return {\n    allow: home(stamp),\n    note: 'requires OpenSSL-dev and mdns installed',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/hap-nodejs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/heapdump/heapdump.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar heapdump = require('heapdump');\nvar name = './heapdump.heapsnapshot';\nheapdump.writeSnapshot(name, function (error1, filename) {\n  if (error1) throw error1;\n  fs.unlink(filename, function (error2) {\n    if (error2) throw error2;\n    console.log('ok');\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/heapdump/heapdump.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n\n// TODO windows has an error\n// 'Invalid access to memory location'\n"
  },
  {
    "path": "test/test-79-npm/heapdump/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/hoek/hoek.js",
    "content": "'use strict';\n\nvar hoek = require('hoek');\nif (typeof hoek.applyToDefaults === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/hoek/hoek.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: stamp.m >= 46,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/hoek/hoek@0.9.1.js",
    "content": "'use strict';\n\nrequire('./hoek.js');\n"
  },
  {
    "path": "test/test-79-npm/hoek/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/home.js",
    "content": "'use strict';\n\nconst o = require('./stamp.js');\n\nmodule.exports = function (stamp) {\n  return o.p === stamp.p && o.a === stamp.a && o.m === stamp.m;\n};\n"
  },
  {
    "path": "test/test-79-npm/homebridge/homebridge.js",
    "content": "'use strict';\n\nprocess.argv.push('--help');\nrequire('homebridge/lib/cli.js'); // dont run. only load\nvar Server = require('homebridge/lib/server.js').Server;\nvar server = new Server();\n\n// eslint-disable-next-line no-underscore-dangle\nif (server._api) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/homebridge/homebridge.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp, flags) {\n  if (flags.ci) {\n    return {\n      allow: false,\n      note: 'headless CI seems to fail',\n    };\n  }\n\n  return {\n    allow: home(stamp),\n    note: 'requires OpenSSL-dev and mdns installed',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/homebridge/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/http-proxy/http-proxy.js",
    "content": "'use strict';\n\nrequire('http-proxy');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/http-proxy/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/http-server/http-server.js",
    "content": "'use strict';\n\nvar http = require('http');\nprocess.argv.push('--silent');\nrequire('http-server/bin/http-server');\nsetTimeout(function () {\n  http.get('http://127.0.0.1:8080/package.json', function (res) {\n    if (res.statusCode) {\n      console.log('ok');\n      process.exit();\n    }\n  });\n}, 5000);\n"
  },
  {
    "path": "test/test-79-npm/http-server/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/image-size/image-size.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar sizeOf = require('image-size');\nvar dimensions = sizeOf(path.join(__dirname, 'viewbox.svg'));\nif (dimensions.width === 123) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/image-size/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/indexof/indexof.js",
    "content": "'use strict';\n\nvar indexof = require('indexof');\nif (indexof([3, 4, 5, 6], 4) === 1) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/indexof/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/inquirer/inquirer.js",
    "content": "'use strict';\n\nvar inquirer = require('inquirer');\nif (inquirer.prompt) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/inquirer/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/j/j.js",
    "content": "'use strict';\n\nvar j = require('j');\nvar path = require('path');\nvar xls = j.readFile(path.join(__dirname, 'registry.xls'));\nif (xls[1].Strings.length > 50) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/j/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/jade/jade.js",
    "content": "'use strict';\n\n// see also express.js\n\nvar file =\n  'html\\n' +\n  '  head\\n' +\n  '    title!= title\\n' +\n  '  body\\n' +\n  '    h1!= message\\n';\n\nvar jade = require('jade');\nvar fn = jade.compile(file, {});\nvar html = fn({ title: 'Hey', message: 'Hello there!' });\n\nif (\n  html ===\n  '<html><head><title>Hey</title></head>' +\n    '<body><h1>Hello there!</h1></body></html>'\n) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/jade/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/jsdom/jsdom.js",
    "content": "'use strict';\n\nvar JSDOM = require('jsdom').JSDOM;\nvar dom = new JSDOM(\n  '<p><a class=\"the-link\" href=\"https://github.com/tmpvar/jsdom\">jsdom!</a></p>'\n);\nvar window = dom.window;\nif (window.document.body.children[0].tagName === 'P') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/jsdom/jsdom.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: stamp.m >= 46,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/jsdom/jsdom@8.5.0.js",
    "content": "'use strict';\n\nvar jsdom = require('jsdom');\n\njsdom.env(\n  '<p><a class=\"the-link\" href=\"https://github.com/tmpvar/jsdom\">jsdom!</a></p>',\n  function (errors, window) {\n    if (window.document.body.children[0].tagName === 'P') {\n      console.log('ok');\n    }\n  }\n);\n"
  },
  {
    "path": "test/test-79-npm/jsdom/jsdom@8.5.0.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./jsdom.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/jsdom/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/json-stringify-date/json-stringify-date.js",
    "content": "'use strict';\n\nvar stringify = require('json-stringify-date');\nvar obj = { d: new Date(2014, 2, 4) };\nvar s = stringify.stringify(obj);\nif (s.indexOf('2014') >= 0) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/json-stringify-date/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/json-stringify-safe/json-stringify-safe.js",
    "content": "'use strict';\n\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [circularObj, circularObj];\nconsole.error(stringify(circularObj, null, 2));\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/json-stringify-safe/json-stringify-safe@4.0.0.js",
    "content": "'use strict';\n\nrequire('./json-stringify-safe.js');\n"
  },
  {
    "path": "test/test-79-npm/json-stringify-safe/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/jsonwebtoken/jsonwebtoken.js",
    "content": "'use strict';\n\nvar jwt = require('jsonwebtoken');\nvar token = jwt.sign({ foo: 'bar' }, 'shhhhh');\nif (token.length > 10) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/jsonwebtoken/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/kerberos/kerberos.js",
    "content": "'use strict';\n\nfunction isModuleNotFoundError(error) {\n  return (\n    error.code === 'MODULE_NOT_FOUND' &&\n    error.message.indexOf('build/Release/kerberos') >= 0\n  );\n}\n\nvar kerberos;\n\nfunction hideTryBlockFromBundleDetectorIgnoreFlag() {\n  kerberos = require('kerberos');\n}\n\ntry {\n  hideTryBlockFromBundleDetectorIgnoreFlag();\n} catch (error) {\n  if (!isModuleNotFoundError(error)) {\n    console.log('bad1', error);\n    return;\n  }\n}\n\nvar sspi;\n\nfunction hideTryBlockFromBundleDetectorIgnoreFlag2() {\n  sspi = require('kerberos/lib/sspi');\n}\n\ntry {\n  if (process.platform === 'win32') {\n    hideTryBlockFromBundleDetectorIgnoreFlag2();\n  }\n} catch (error) {\n  if (!isModuleNotFoundError(error)) {\n    console.log('bad2', error);\n    return;\n  }\n}\n\nif (kerberos) {\n  if (typeof kerberos.Kerberos !== 'function') {\n    console.log('bad');\n    return;\n  }\n}\n\nif (sspi) {\n  if (typeof sspi.SSPI !== 'function') {\n    console.log('bad');\n    return;\n  }\n}\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/kerberos/kerberos.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/kerberos/kerberos@0.0.10.js",
    "content": "'use strict';\n\nrequire('./kerberos.js');\n"
  },
  {
    "path": "test/test-79-npm/kerberos/kerberos@0.0.10.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./kerberos.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/kerberos/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/knex/knex.js",
    "content": "'use strict';\n\nvar knex = require('knex');\nif (knex) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/knex/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/later/later.js",
    "content": "'use strict';\n\nvar later = require('later');\nif (later.schedule) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/later/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/level/level.js",
    "content": "'use strict';\n\nvar level = require('level');\nvar db = level('dbname');\nvar rimraf = require('../../../node_modules/rimraf');\n\n(function (cb) {\n  db.open(function (error1) {\n    if (error1) return cb(error1);\n\n    db.put(\n      'dave@gmail.com',\n      JSON.stringify({\n        _id: 'dave@gmail.com',\n        name: 'David',\n        age: 68,\n      }),\n      function (error2) {\n        if (error2) return cb(error2);\n        db.get('dave@gmail.com', function (error3, data) {\n          if (error3) return cb(error3);\n          data = JSON.parse(data.toString());\n          if (data.age === 68) {\n            console.log('ok');\n            return cb();\n          }\n        });\n      }\n    );\n  });\n})(function (error) {\n  if (error) throw error;\n  db.close(function () {\n    rimraf.sync('dbname');\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/level/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/leveldown/leveldown.js",
    "content": "'use strict';\n\nvar Leveldown = require('leveldown');\nvar db = new Leveldown('dbname');\nvar rimraf = require('../../../node_modules/rimraf');\n\n(function (cb) {\n  db.open(function (error1) {\n    if (error1) return cb(error1);\n\n    db.put(\n      'dave@gmail.com',\n      JSON.stringify({\n        _id: 'dave@gmail.com',\n        name: 'David',\n        age: 68,\n      }),\n      function (error2) {\n        if (error2) return cb(error2);\n        db.get('dave@gmail.com', function (error3, data) {\n          if (error3) return cb(error3);\n          data = JSON.parse(data.toString());\n          if (data.age === 68) {\n            console.log('ok');\n            return cb();\n          }\n        });\n      }\n    );\n  });\n})(function (error) {\n  if (error) throw error;\n  db.close(function () {\n    rimraf.sync('dbname');\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/leveldown/leveldown.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    deployFilesFrom: ['leveldown'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/leveldown/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/levelup/levelup.js",
    "content": "'use strict';\n\nvar Levelup = require('levelup');\nvar db = new Levelup('dbname');\nvar rimraf = require('../../../node_modules/rimraf');\n\n(function (cb) {\n  db.open(function (error1) {\n    if (error1) return cb(error1);\n\n    db.put(\n      'dave@gmail.com',\n      JSON.stringify({\n        _id: 'dave@gmail.com',\n        name: 'David',\n        age: 68,\n      }),\n      function (error2) {\n        if (error2) return cb(error2);\n        db.get('dave@gmail.com', function (error3, data) {\n          if (error3) return cb(error3);\n          data = JSON.parse(data.toString());\n          if (data.age === 68) {\n            console.log('ok');\n            return cb();\n          }\n        });\n      }\n    );\n  });\n})(function (error) {\n  if (error) throw error;\n  db.close(function () {\n    rimraf.sync('dbname');\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/levelup/levelup.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    packages: ['leveldown@1'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/levelup/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/liftoff/liftoff.js",
    "content": "'use strict';\n\nvar liftoff = require('liftoff');\nif (typeof liftoff === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/liftoff/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/lodash/lodash.js",
    "content": "'use strict';\n\nvar lodash = require('lodash');\nif (typeof lodash === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/lodash/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/log4js/log4js.js",
    "content": "'use strict';\n\nvar log4js = require('log4js');\nvar logger = log4js.getLogger('cheese');\nif (logger.log) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/log4js/log4js@0.5.8.js",
    "content": "'use strict';\n\nvar log4js = require('log4js');\nlog4js.loadAppender('file');\nvar logger = log4js.getLogger('cheese');\nlogger.setLevel('ERROR');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/log4js/log4js@0.6.34.js",
    "content": "'use strict';\n\nrequire('./log4js@0.5.8.js');\n"
  },
  {
    "path": "test/test-79-npm/log4js/log4js@1.1.1.js",
    "content": "'use strict';\n\nrequire('./log4js@0.5.8.js');\n"
  },
  {
    "path": "test/test-79-npm/log4js/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/logform/logform.js",
    "content": "'use strict';\n\nvar logform = require('logform');\nvar format = logform.format;\n\nif (format.combine()) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/logform/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/machinepack-urls/machinepack-urls.js",
    "content": "'use strict';\n\nvar mu = require('machinepack-urls');\nvar b = mu.parse;\nif (typeof b === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/machinepack-urls/machinepack-urls@5.0.0.js",
    "content": "'use strict';\n\nvar mu = require('machinepack-urls');\nvar b = mu.validate;\nif (typeof b === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/machinepack-urls/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/main.js",
    "content": "#!/usr/bin/env node\n\n/* eslint-disable complexity */\n\n'use strict';\n\n// note: you can set the env variable USE_PREINSTALLED_MODULES to prevent reconstruction\n//       of the npm cache folder.\nconst UPM = process.env.USE_PREINSTALLED_MODULES || false; // USE_PREINSTALLED_MODULES\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst globby = require('globby');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst hostVersion = process.version.match(/^v(\\d+)/)[1];\nconst host = 'node' + hostVersion;\nconst target = process.argv[2] || host;\nconst windows = process.platform === 'win32';\nconst npm = {\n  8: 5,\n  10: 5,\n  12: 6,\n  14: 6,\n  16: 7,\n  18: 8,\n}[hostVersion];\n\nassert(npm !== undefined);\n\nfunction applyMetaToRight(right, meta) {\n  right = meta.take === 'stderr' ? right.stderr : right.stdout;\n  if (meta.take === 'last-line') right = right.split('\\n').slice(-2).join('\\n');\n  if (right.slice(-2) === '\\r\\n') right = right.slice(0, -2);\n  if (right.slice(-1) === '\\n') right = right.slice(0, -1);\n  return right;\n}\n\nlet stamp = {};\n\nconst checklist = fs.readFileSync('checklist.js', 'utf-8');\nlet table = checklist.split('const table = ')[1].split(';')[0];\ntable = JSON.parse(table);\nlet changes = checklist.split('const changes = ')[1].split(';')[0];\nchanges = JSON.parse(changes);\n\nfunction save() {\n  const t = utils.stringify(table, undefined, 2);\n  let c = utils.stringify(changes, undefined, 2);\n  if (c === '[]') c = '[\\n]';\n  fs.writeFileSync(\n    'checklist.js',\n    '/* eslint-disable no-unused-vars */\\n' +\n      '/* eslint-disable quotes */\\n' +\n      '\\n' +\n      \"'use strict';\\n\" +\n      '\\n' +\n      'const table = ' +\n      t +\n      ';\\n' +\n      'const changes = ' +\n      c +\n      ';\\n'\n  );\n}\n\nfunction stamp2string(s) {\n  // platform, arch, modules\n  return s.p + '/' + s.a + '/m' + s.m.toString();\n}\n\nfunction update(p, r, v, note) {\n  if (!table[p]) table[p] = {};\n  const row = table[p];\n  const ss = stamp2string(stamp);\n  const o = row[ss];\n  const rv = r + (v ? ',' + v : '');\n  const rn = r + (note ? ',' + note : '');\n  row[ss] = rv + (note ? ',' + note : '');\n  const o2 = o ? o.split(',')[0] : undefined;\n  if (!o && r !== 'ok') {\n    changes.push(p + ',' + ss + ': new ' + rn);\n  } else if (o2 !== undefined && o2 !== r) {\n    changes.push(p + ',' + ss + ': ' + o + ' -> ' + rn);\n  }\n  save();\n}\n\nif (!UPM) {\n  console.log('Cleaning cache...');\n\n  if (windows) {\n    utils.vacuum.sync(path.join(process.env.APPDATA, 'npm-cache'));\n    utils.mkdirp.sync(path.join(process.env.APPDATA, 'npm-cache'));\n  } else {\n    if (npm >= 5) {\n      utils.exec.sync('npm cache clean --force');\n    } else {\n      utils.exec.sync('npm cache clean');\n    }\n  }\n\n  utils.mkdirp.sync('_isolator');\n}\n\n(function () {\n  console.log('Getting stamp...');\n\n  const input = path.resolve('stamp.js');\n  const lucky = path.basename(input).slice(0, -3);\n  const output = path.resolve('_isolator', lucky + '.exe');\n\n  utils.pkg.sync(['--target', target, '--output', output, input]);\n\n  stamp = utils.spawn.sync(output);\n\n  stamp = JSON.parse(stamp);\n  utils.vacuum.sync(output);\n  console.log('Stamp is ' + JSON.stringify(stamp));\n  utils.pause(2);\n})();\n\n// note to developpers:\n// you can set the  env variable FILTER to something like \"better-sqlite3/*.js\"\n// to restrict this test to this single test case\nconst inputs = globby\n  .sync([\n    process.env.FILTER || './*/*.js',\n    '!./*/*.config.js',\n    '!./*/*.meta.js',\n    '!./*/gulpfile.js',\n    '!./*/*fixture*',\n  ])\n  .map(function (result) {\n    return path.resolve(result);\n  });\n\nlet times = {};\nconst ci = process.env.CI;\n\nif (ci) {\n  console.log('Getting latest times...');\n\n  const foldyNames = inputs.map(function (input) {\n    const foldy = path.dirname(input);\n    const foldyName = path.basename(foldy);\n    return foldyName;\n  });\n\n  times = JSON.parse(utils.exec.sync('node times.js ' + foldyNames.join()));\n}\n\ninputs.some(function (input) {\n  const foldy = path.dirname(input);\n  const foldyName = path.basename(foldy);\n\n  const packy = path.basename(input).slice(0, -3);\n  const packyName = packy.split('@')[0];\n  const packyWildcard = packy.split('@')[1];\n\n  let wordy = packy;\n  if (packyName !== foldyName) {\n    wordy = foldyName + '/' + wordy;\n  }\n\n  const output = path.resolve('_isolator', packy + '.exe');\n\n  console.log();\n  console.log('*********************************************************');\n  console.log('*********************************************************');\n  console.log('*********************************************************');\n\n  console.log('Testing ' + wordy + '...');\n\n  if (ci) {\n    const latestTime = times[foldyName];\n    if (latestTime) {\n      const diff = Date.now() - latestTime;\n      const days = (diff / 1000 / 60 / 60 / 24) | 0;\n      if (days >= 360) {\n        // no need to pollute changes with this\n        // update(wordy, 'nop', '', 'abandoned');\n        console.log('Last published ' + days + ' days ago!');\n        return;\n      }\n    }\n  }\n\n  const flags = { ci };\n  let metajs = path.join(foldy, packy + '.meta.js');\n  metajs = fs.existsSync(metajs) ? require(metajs) : undefined;\n\n  let meta;\n\n  if (metajs) {\n    meta = metajs(stamp, flags) || {};\n  } else {\n    meta = {};\n  }\n\n  let allow;\n\n  if (typeof meta.allow !== 'undefined') {\n    allow = meta.allow;\n  } else {\n    allow = true;\n  }\n\n  const note = meta.note;\n\n  if (!allow) {\n    update(wordy, 'nop', '', note);\n    console.log('Not allowed here!');\n    if (note) console.log('Note:', note);\n    return;\n  }\n\n  let version = '';\n\n  if (!UPM) {\n    const build = meta.build;\n    const packages = [packy].concat(meta.packages || []);\n    console.log('Installing ' + packages + '...');\n    let successful = false;\n    let counter = 10;\n    while (!successful && counter > 0) {\n      successful = true;\n      let command = 'npm install ' + packages.join(' ');\n      if (npm >= 5) command += ' --no-save';\n      if (build) command += ' --build-from-source=' + build;\n      command += ' --unsafe-perm';\n      try {\n        utils.exec.sync(command, { cwd: foldy });\n      } catch (__) {\n        assert(__);\n        utils.vacuum.sync(path.join(foldy, 'node_modules'));\n        successful = false;\n        counter -= 1;\n      }\n    }\n\n    let packyVersion;\n\n    try {\n      packyVersion = JSON.parse(\n        fs.readFileSync(\n          path.join(foldy, 'node_modules', packy.split('@')[0], 'package.json'),\n          'utf8'\n        )\n      ).version;\n    } catch (___) {\n      update(wordy, 'bad-npm-i', '', note);\n      console.log(wordy + ' failed to install here!');\n      if (note) console.log('Note:', note);\n      return;\n    }\n\n    console.log('Version of ' + packy + ' is ' + packyVersion);\n    version = packyVersion;\n\n    if (packyWildcard) {\n      assert.strictEqual(packyWildcard.split('.').length, 3);\n      assert.strictEqual(packyVersion, packyWildcard);\n    }\n  }\n\n  let right;\n\n  console.log('Running non-compiled ' + wordy + '...');\n\n  try {\n    right = utils.spawn.sync('node', [input], {\n      cwd: path.dirname(input),\n      stdio: 'pipe',\n    });\n  } catch (___) {\n    right = {\n      stdout: '',\n      stderr: ___.toString(),\n    };\n  }\n\n  right = applyMetaToRight(right, meta);\n\n  console.log(\"Result is '\" + right + \"'\");\n\n  if (right !== 'ok') {\n    update(wordy, 'bad-test', version, note);\n  } else {\n    console.log('Compiling ' + wordy + '...');\n    const config = path.join(foldy, packy + '.config.json');\n\n    if (fs.existsSync(config)) {\n      const bin = JSON.parse(fs.readFileSync(config)).bin;\n      assert.strictEqual(path.join(foldy, bin), input);\n      input = config;\n    }\n\n    utils.pkg.sync(['--target', target, '--output', output, input]);\n\n    console.log('Copying addons...');\n\n    const deployFiles = [];\n\n    if (!meta.deployFiles && !meta.deployFilesFrom) {\n      globby\n        .sync(path.join(foldy, 'node_modules', '**', '*.node'))\n        .some(function (deployFrom) {\n          deployFiles.push([\n            deployFrom,\n            path.join(path.dirname(output), path.basename(deployFrom)),\n          ]);\n        });\n    }\n\n    const deployFilesRelative = [];\n\n    if (meta.deployFiles) {\n      meta.deployFiles.some(function (deployFile) {\n        deployFilesRelative.push(deployFile);\n      });\n    }\n\n    if (meta.deployFilesFrom) {\n      meta.deployFilesFrom.some(function (dictName) {\n        const dict = require('../../dictionary/' + dictName);\n        dict.pkg.deployFiles.some(function (deployFile) {\n          const deployFrom = 'node_modules/' + dictName + '/' + deployFile[0];\n          const deployTo = deployFile[1];\n          deployFilesRelative.push([deployFrom, deployTo]);\n        });\n      });\n    }\n\n    deployFilesRelative.some(function (deployFile) {\n      let deployFrom;\n      let deployTo;\n\n      if (Array.isArray(deployFile)) {\n        deployFrom = deployFile[0];\n        deployTo = deployFile[1];\n      } else {\n        deployFrom = deployFile;\n        deployTo = deployFile;\n      }\n\n      // whole directory supported, glob not\n      assert(deployFrom.indexOf('*') < 0);\n      assert(deployTo.indexOf('*') < 0);\n\n      deployFrom = path.join(foldy, deployFrom);\n      deployTo = path.join(path.dirname(output), deployTo);\n\n      if (fs.existsSync(deployFrom)) {\n        const statFrom = fs.statSync(deployFrom);\n        if (statFrom.isFile()) {\n          deployFiles.push([deployFrom, deployTo]);\n        } else {\n          globby\n            .sync(path.join(deployFrom, '**', '*'))\n            .some(function (deployFrom2) {\n              const r = path.relative(deployFrom, deployFrom2);\n              const deployTo2 = path.join(deployTo, r);\n              if (fs.existsSync(deployFrom2)) {\n                const statFrom2 = fs.statSync(deployFrom2);\n                if (statFrom2.isFile()) {\n                  deployFiles.push([deployFrom2, deployTo2]);\n                }\n              }\n            });\n        }\n      }\n    });\n\n    deployFiles.some(function (deployFile) {\n      const deployFrom = deployFile[0];\n      const deployTo = deployFile[1];\n      const statFrom = fs.statSync(deployFrom);\n      utils.mkdirp.sync(path.dirname(deployTo));\n      fs.writeFileSync(deployTo, fs.readFileSync(deployFrom));\n      fs.chmodSync(deployTo, statFrom.mode.toString(8).slice(-3));\n    });\n\n    console.log('Running compiled ' + wordy + '...');\n\n    try {\n      right = utils.spawn.sync('./' + path.basename(output), [], {\n        cwd: path.dirname(output),\n        stdio: 'pipe',\n      });\n    } catch (___) {\n      right = {\n        stdout: '',\n        stderr: ___.toString(),\n      };\n    }\n\n    right = applyMetaToRight(right, meta);\n    console.log(\"Result is '\" + right + \"'\");\n\n    if (right !== 'ok') {\n      update(wordy, 'error', version, note);\n    } else {\n      update(wordy, 'ok', version);\n    }\n  }\n\n  const rubbishes = globby.sync(path.join(path.dirname(output), '**', '*'));\n\n  rubbishes.some(function (rubbish) {\n    utils.vacuum.sync(rubbish);\n  });\n\n  if (!UPM) {\n    console.log('Cleanup...');\n    utils.vacuum.sync(path.join(foldy, 'node_modules'));\n  }\n});\n\nconsole.log('\\nChanges:\\n' + changes.join('\\n') + '\\n');\n"
  },
  {
    "path": "test/test-79-npm/markdown/markdown.js",
    "content": "'use strict';\n\nvar markdown = require('markdown').markdown;\nvar html = markdown.toHTML('Hello *World*!');\nif (html === '<p>Hello <em>World</em>!</p>') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/markdown/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/mdns/mdns.js",
    "content": "'use strict';\n\nvar mdns = require('mdns');\nif (mdns.dns_sd) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/mdns/mdns.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    note: 'requires mdns installed',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/mdns/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/method-override/method-override.js",
    "content": "'use strict';\n\nvar override = require('method-override');\nvar req = { method: 'GET', headers: {} };\nvar res = {};\n\nvar middleware = override();\n\nmiddleware(req, res, function () {\n  if (req.originalMethod === 'GET') {\n    console.log('ok');\n  }\n});\n"
  },
  {
    "path": "test/test-79-npm/method-override/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/microjob/microjob.js",
    "content": "'use strict';\n\nvar start = require('microjob').start;\nif (typeof start === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/microjob/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/mime/mime.js",
    "content": "'use strict';\n\nvar mime = require('mime');\nif (mime.getType('html') === 'text/html') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/mime/mime@1.4.1.js",
    "content": "'use strict';\n\nvar mime = require('mime');\nif (mime.lookup('html') === 'text/html') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/mime/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/mime-types/mime-types.js",
    "content": "'use strict';\n\nvar mime = require('mime-types');\nif (mime.lookup('html') === 'text/html') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/mime-types/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/minimatch/minimatch.js",
    "content": "'use strict';\n\nvar minimatch = require('minimatch');\nif (minimatch('bar.foo', '*.foo') && !minimatch('bar.foo', '*.bar')) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/minimatch/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/minstache/minstache.js",
    "content": "'use strict';\n\nvar minstache = require('minstache');\nif (typeof minstache === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/minstache/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/module-deps/module-deps.js",
    "content": "'use strict';\n\nvar Deps = require('module-deps');\nvar deps = new Deps();\nif (deps.parseDeps) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/module-deps/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/moment/moment.js",
    "content": "'use strict';\n\nvar moment = require('moment');\nmoment.locale('ru');\nvar newyear = new Date(2014, 0, 1);\nvar s = moment(newyear).format('llll');\nif (s.indexOf('янв') >= 0) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/moment/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/moment-timezone/moment-timezone.js",
    "content": "'use strict';\n\nvar moment = require('moment-timezone');\nvar june = moment('2014-06-01T12:00:00Z');\nvar s = june.tz('America/Los_Angeles').format('ha z');\nif (s === '5am PDT') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/moment-timezone/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/mongodb/mongodb.js",
    "content": "'use strict';\n\nvar mongodb = require('mongodb');\nvar MongoClient = mongodb.MongoClient;\nif (typeof MongoClient === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/mongodb/mongodb.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/mongodb/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/mongodb-core/mongodb-core.js",
    "content": "'use strict';\n\nvar Server = require('mongodb-core').Server;\nif (typeof Server === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/mongodb-core/mongodb-core@1.0.5.js",
    "content": "'use strict';\n\nrequire('./mongodb-core.js');\n"
  },
  {
    "path": "test/test-79-npm/mongodb-core/mongodb-core@1.0.5.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    take: 'last-line',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/mongodb-core/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/mongoose/mongoose.js",
    "content": "'use strict';\n\nvar mongoose = require('mongoose');\nmongoose.connect('mongodb://localhost/pkg-test');\n\nvar Cat = mongoose.model('Cat', { name: String });\nvar name = 'Tuz' + new Date().getTime().toString();\nvar kitty = new Cat({ name: name });\n\nkitty.save(function (error1) {\n  if (error1) return;\n  Cat.find({})\n    .$where(function () {\n      return this.name.slice(0, 3) === 'Tuz';\n    })\n    .exec(function (error2, cats) {\n      if (process.pkg) {\n        if (cats) return;\n        if (error2.message.indexOf('Pkg') >= 0) {\n          console.log('ok');\n          mongoose.disconnect();\n        }\n      } else {\n        if (error2) return;\n        if (cats.length > 0) {\n          console.log('ok');\n          mongoose.disconnect();\n        }\n      }\n    });\n});\n"
  },
  {
    "path": "test/test-79-npm/mongoose/mongoose.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    allow: false, // TODO fix hanging and enable // stamp.p !== 'win32',\n    note: 'requires MongoDB installed',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/mongoose/mongoose@3.9.7.js",
    "content": "'use strict';\n\nrequire('./mongoose.js');\n"
  },
  {
    "path": "test/test-79-npm/mongoose/mongoose@3.9.7.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp) && stamp.p !== 'win32' && stamp.m <= 46,\n    note:\n      'requires MongoDB installed\\n' +\n      ' ...also require(\"mongodb/node_modules/bson\") does not work in flat npm',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/mongoose/mongoose@4.0.8.js",
    "content": "'use strict';\n\nrequire('./mongoose.js');\n"
  },
  {
    "path": "test/test-79-npm/mongoose/mongoose@4.0.8.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp) && stamp.p !== 'win32',\n    note: 'requires MongoDB installed',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/mongoose/mongoose@4.1.12.js",
    "content": "'use strict';\n\nrequire('./mongoose.js');\n"
  },
  {
    "path": "test/test-79-npm/mongoose/mongoose@4.1.12.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./mongoose@4.0.8.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/mongoose/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/mongoskin/mongoskin@2.0.3.js",
    "content": "'use strict';\n\nrequire('mongoskin');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/mongoskin/mongoskin@2.0.3.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    packages: ['mongodb@2.0'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/mongoskin/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/ms/ms.js",
    "content": "'use strict';\n\nvar ms = require('ms');\nif (ms('15m') === 900000) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/ms/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/msgpack/msgpack.js",
    "content": "'use strict';\n\nvar msgpack = require('msgpack');\nvar o = { a: 1, b: 2, c: [1, 2, 3] };\nvar b = msgpack.pack(o);\nvar oo = msgpack.unpack(b);\nif (JSON.stringify(o) === JSON.stringify(oo)) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/msgpack/msgpack.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/msgpack/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/multer/multer.js",
    "content": "'use strict';\n\nvar multer = require('multer');\nif (typeof multer === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/multer/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/muri/muri.js",
    "content": "'use strict';\n\nvar muri = require('muri');\n// console.log(muri.version);\nvar o = muri(\n  'mongodb://user:pass@local,remote:27018,japan:27019/neatdb?replicaSet=myreplset&journal=true&w=2&wtimeoutMS=50'\n);\nif (o.options.replicaSet === 'myreplset') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/muri/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/native-or-bluebird/native-or-bluebird.js",
    "content": "'use strict';\n\nvar Promise = require('native-or-bluebird');\nif (Promise && global.Promise) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/native-or-bluebird/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/natives/natives.js",
    "content": "'use strict';\n\nvar natives = require('natives');\nvar fsCopy = natives.require('fs');\nif (fsCopy !== require('fs')) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/natives/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/nconf/nconf.js",
    "content": "'use strict';\n\nvar nconf = require('nconf');\nnconf.argv();\nvar foo = nconf.get('foo');\nif (typeof foo === 'undefined') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/nconf/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/nedb/nedb.js",
    "content": "'use strict';\n\nvar Nedb = require('nedb');\nvar fs = require('fs');\nvar filename = 'database.db';\nvar db = new Nedb({ filename: filename });\n\ndb.loadDatabase(function (error) {\n  if (error) throw error;\n  db.insert([{ a: 5 }, { a: 42 }], function (error2) {\n    if (error2) throw error2;\n    fs.unlinkSync(filename);\n    console.log('ok');\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/nedb/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/negotiator/negotiator.js",
    "content": "'use strict';\n\nvar Negotiator = require('negotiator');\nvar availableMediaTypes = ['text/html', 'text/plain', 'application/json'];\nvar request = { headers: {} };\nvar negotiator = new Negotiator(request);\n\nvar mt1 = negotiator.mediaTypes();\nvar mt2 = negotiator.mediaTypes(availableMediaTypes);\nvar mt3 = negotiator.mediaType(availableMediaTypes);\n\nif (mt1.join('+') !== '*/*') return;\nif (mt2.join('+') !== 'text/html+text/plain+application/json') return;\nif (mt3 !== 'text/html') return;\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/negotiator/negotiator@0.4.9.js",
    "content": "'use strict';\n\nrequire('./negotiator.js');\n"
  },
  {
    "path": "test/test-79-npm/negotiator/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/newrelic/newrelic.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nprocess.env.NEW_RELIC_APP_NAME = 'pkg-test';\nprocess.env.NEW_RELIC_NO_CONFIG_FILE = true;\nvar Agent = require('newrelic/lib/agent.js');\nAgent.prototype.start = function () {\n  console.log('ok');\n  fs.unlinkSync('newrelic_agent.log');\n  process.exit();\n};\n\nrequire('newrelic');\n"
  },
  {
    "path": "test/test-79-npm/newrelic/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/nib/nib.js",
    "content": "'use strict';\n\nvar nib = require('nib');\nif (typeof nib.version === 'string') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/nib/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/nightmare/nightmare.config.json",
    "content": "{\n  \"bin\": \"nightmare.js\",\n  \"pkg\": {\n    \"assets\": [\"nightmare.js\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/nightmare/nightmare.js",
    "content": "'use strict';\n\nvar Nightmare = require('nightmare');\nvar nightmare = new Nightmare({ show: false });\n\nnightmare\n  .goto('http://yahoo.com')\n  .type('form[action*=\"/search\"] [name=p]', 'github nightmare')\n  .click('form[action*=\"/search\"] [type=submit]')\n  .wait('#main')\n  .evaluate(function () {\n    // nightmare takes thisFunction.toString(), so --public\n    // is needed (or placing this file to assets)\n    return document.querySelector('#main .searchCenterMiddle li a').href;\n  })\n  .end()\n  .then(function (result) {\n    if (result.indexOf('segmentio') >= 0) console.log('ok');\n  });\n"
  },
  {
    "path": "test/test-79-npm/nightmare/nightmare.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp, flags) {\n  if (flags.ci) {\n    return {\n      allow: false,\n      note: 'headless CI seems to fail headful electron',\n    };\n  }\n\n  return {\n    deployFilesFrom: ['electron', 'nightmare'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/nightmare/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-forge/node-forge.js",
    "content": "'use strict';\n\nvar forge = require('node-forge');\nif (typeof forge.tls.createConnection === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/node-forge/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-libcurl/node-libcurl.js",
    "content": "'use strict';\n\n// apt-get install libcurl4-openssl-dev\n\n// IF YOU USE 32-BIT NODEJS:\n// patch /usr/include/curl/curlbuild.h\n// #define CURL_SIZEOF_LONG 4\n// #define CURL_SIZEOF_CURL_OFF_T 4\n\nvar Curl = require('node-libcurl').Curl;\nvar curl = new Curl();\ncurl.setOpt('URL', 'www.yandex.ru');\ncurl.setOpt('FOLLOWLOCATION', true);\ncurl.on('end', function (status) {\n  if (status === 200) {\n    console.log('ok');\n  }\n  this.close(); // eslint-disable-line no-invalid-this\n});\ncurl.perform();\n"
  },
  {
    "path": "test/test-79-npm/node-libcurl/node-libcurl.meta.js",
    "content": "'use strict';\n\n// in win32 must manually\n// \"git clone curl-for-windows\"\n// in debian there is a bug\n// in /usr/include/curl/curlbuild.h\n\nmodule.exports = function () {\n  return {\n    allow: false,\n    note: 'hard to meet various requirements',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/node-libcurl/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-notifier/node-notifier.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar notifier = require('node-notifier');\nvar utils = require('node-notifier/lib/utils.js');\nvar whichArgument;\n\nutils.command =\n  utils.fileCommandJson =\n  utils.immediateFileCommand =\n    function (filename) {\n      var forLinux = filename === whichArgument; // 'notify-send' is built-in on linux\n      var forNonLinux = fs.existsSync(filename) && path.isAbsolute(filename);\n      if ((forLinux || forNonLinux) && filename.indexOf('snapshot') < 0) {\n        console.log('ok');\n      }\n      process.exit();\n    };\n\nvar which = require('which');\nwhich.sync = function (filename) {\n  whichArgument = filename;\n  return true;\n};\n\nnotifier.notify('hi!');\n"
  },
  {
    "path": "test/test-79-npm/node-notifier/node-notifier.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp, flags) {\n  if (stamp.p === 'win32' && flags.ci) {\n    return {\n      allow: false,\n      note: 'headless windows CI seems to fail to show baloon',\n    };\n  }\n\n  if (stamp.p === 'win32' && stamp.m < 48) {\n    return {\n      allow: false,\n      note: \"flat npm is needed to require('which')\",\n    };\n  }\n\n  return {\n    deployFilesFrom: ['node-notifier'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/node-notifier/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-pre-gyp/node-pre-gyp.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nif (!fs.existsSync('package.json')) {\n  fs.writeFileSync('package.json', '{}');\n}\n\nvar Run = require('node-pre-gyp').Run;\nvar r = new Run();\n\ntry {\n  r.commands.clean();\n} catch (e) {\n  if (\n    e.message.indexOf('undefined package.json is not node-pre-gyp ready') >= 0\n  ) {\n    console.log('ok');\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/node-pre-gyp/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-redis-pubsub/node-redis-pubsub.js",
    "content": "'use strict';\n\nvar NRP = require('node-redis-pubsub');\nvar config = { port: 6379, scope: 'demo' };\nnew NRP(config); // eslint-disable-line no-new\n\nprocess.on('uncaughtException', function (error) {\n  var ok = error.code === 'ECONNREFUSED';\n  if (ok) console.log('ok');\n  process.exit();\n});\n"
  },
  {
    "path": "test/test-79-npm/node-redis-pubsub/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-sass/node-sass.js",
    "content": "'use strict';\n\nvar sass = require('node-sass');\nvar data = '#hello {\\n  color: #08c; }\\n';\nconst result = sass.renderSync({ data: data }).css.toString();\nif (result === data) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/node-sass/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-uuid/node-uuid.js",
    "content": "'use strict';\n\nvar uuid = require('node-uuid');\nif (uuid.v1().length === 36) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/node-uuid/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-xlsx/node-xlsx.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar xlsx = require('node-xlsx');\n\nvar xls = xlsx.parse(path.join(__dirname, 'registry.xls'));\nvar ods = xlsx.parse(path.join(__dirname, 'ffc.ods'));\n\nvar data = [\n  [1, 2, 3],\n  [true, false, null, 'sheetjs'],\n  ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'],\n  ['baz', null, 'qux'],\n];\n\nvar buffer = xlsx.build([{ name: 'SheetName', data: data }]);\n\nif (xls[0].data.length > 50 && ods[0].data.length > 30 && buffer.length > 10) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/node-xlsx/node-xlsx.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: stamp.m >= 46,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/node-xlsx/node-xlsx@0.6.0.js",
    "content": "'use strict';\n\nrequire('./node-xlsx.js');\n"
  },
  {
    "path": "test/test-79-npm/node-xlsx/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/node-zookeeper-client/node-zookeeper-client.js",
    "content": "'use strict';\n\nvar zookeeper = require('node-zookeeper-client');\nvar client = zookeeper.createClient('localhost:2181');\nif (client.state) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/node-zookeeper-client/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/nodegit/nodegit.js",
    "content": "'use strict';\n\nvar NodeGit = require('nodegit');\nvar Diff = NodeGit.Diff;\n\nNodeGit.Repository.init('./', 0)\n  .then(function (repo) {\n    return Diff.indexToWorkdir(repo, null, {\n      flags: Diff.OPTION.INCLUDE_UNTRACKED | Diff.OPTION.RECURSE_UNTRACKED_DIRS,\n    });\n  })\n  .then(function () {\n    console.log('ok');\n  });\n"
  },
  {
    "path": "test/test-79-npm/nodegit/nodegit.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp) && stamp.m === 51, // TODO check node8 some day\n    note: 'precompiled binary is for node7 only',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/nodegit/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/nodemailer/nodemailer.js",
    "content": "'use strict';\n\nvar nodemailer = require('nodemailer');\nvar transporter = nodemailer.createTransport(\n  'smtps://user%40gmail.com:pass@smtp.gmail.com'\n);\nif (transporter.transporter) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/nodemailer/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/nodemailer-sendmail-transport/nodemailer-sendmail-transport.js",
    "content": "'use strict';\n\nrequire('nodemailer-sendmail-transport');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/nodemailer-sendmail-transport/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/npm/npm.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    allow: false,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/npm/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/npm-registry-client/npm-registry-client.js",
    "content": "'use strict';\n\nvar RegistryClient = require('npm-registry-client');\nvar client = new RegistryClient({});\nif (typeof client.whoami === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/npm-registry-client/npm-registry-client@6.0.7.js",
    "content": "'use strict';\n\nrequire('./npm-registry-client.js');\n"
  },
  {
    "path": "test/test-79-npm/npm-registry-client/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/nssocket/nssocket.js",
    "content": "'use strict';\n\nvar nssocket = require('nssocket');\nif (nssocket.createServer) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/nssocket/nssocket@0.5.3.js",
    "content": "'use strict';\n\nrequire('./nssocket.js');\n"
  },
  {
    "path": "test/test-79-npm/nssocket/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/oauth2orize/oauth2orize.js",
    "content": "'use strict';\n\nrequire('oauth2orize');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/oauth2orize/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/octobat/octobat.js",
    "content": "'use strict';\n\nvar octobat = require('octobat');\nif (octobat.DEFAULT_HOST === 'api.octobat.com') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/octobat/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/open/open.js",
    "content": "'use strict';\n\nvar open = require('open');\nopen('package.json').then(() => {\n  console.log('ok');\n});\n"
  },
  {
    "path": "test/test-79-npm/open/open.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp, flags) {\n  if (stamp.p === 'win32' && flags.ci) {\n    return {\n      allow: false,\n      note: 'headless windows CI seems to fail',\n    };\n  }\n\n  return {\n    deployFilesFrom: ['open'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/open/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/opn/opn.js",
    "content": "'use strict';\n\nvar opn = require('opn');\nopn('package.json').then(() => {\n  console.log('ok');\n});\n"
  },
  {
    "path": "test/test-79-npm/opn/opn.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp, flags) {\n  if (stamp.p === 'win32' && flags.ci) {\n    return {\n      allow: false,\n      note: 'headless windows CI seems to fail',\n    };\n  }\n\n  return {\n    deployFilesFrom: ['opn'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/opn/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/optimist/optimist.js",
    "content": "'use strict';\n\nvar optimist = require('optimist');\nvar argv = optimist.argv;\nif (argv.$0) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/optimist/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/passport/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/passport/passport.js",
    "content": "'use strict';\n\nvar passport = require('passport');\nif (passport.Strategy) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/passport/passport@0.2.2.js",
    "content": "'use strict';\n\nrequire('./passport.js');\n"
  },
  {
    "path": "test/test-79-npm/passport-local/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/passport-local/passport-local.js",
    "content": "'use strict';\n\nvar passport = require('passport-local');\nif (passport.Strategy) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/passport-local/passport-local@0.1.6.js",
    "content": "'use strict';\n\nrequire('./passport-local.js');\n"
  },
  {
    "path": "test/test-79-npm/pg/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pg/pg.js",
    "content": "'use strict';\n\nvar pg = require('pg');\nif (pg.Connection) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pg/pg@3.6.3.js",
    "content": "'use strict';\n\nvar pg = require('pg');\nif (pg.connect) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pg/pg@4.0.0.js",
    "content": "'use strict';\n\nrequire('./pg@3.6.3.js');\n"
  },
  {
    "path": "test/test-79-npm/pg/pg@6.4.1.js",
    "content": "'use strict';\n\nrequire('./pg@3.6.3.js');\n"
  },
  {
    "path": "test/test-79-npm/pg-cursor/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pg-cursor/pg-cursor.js",
    "content": "'use strict';\n\nvar Cursor = require('pg-cursor');\nvar cursor = new Cursor('SELECT * FROM some_table WHERE prop > $1', [100]);\nif (cursor.state) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pg-cursor/pg-cursor.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    packages: ['pg'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/pg-query-stream/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pg-query-stream/pg-query-stream.js",
    "content": "'use strict';\n\nrequire('./pg-query-stream@1.0.0.js');\n"
  },
  {
    "path": "test/test-79-npm/pg-query-stream/pg-query-stream.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./pg-query-stream@1.0.0.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/pg-query-stream/pg-query-stream@1.0.0.js",
    "content": "'use strict';\n\nvar QueryStream = require('pg-query-stream');\nvar query = new QueryStream('SELECT * FROM generate_series(0, $1) num', [\n  1000000,\n]);\nif (query.state || (query.cursor && query.cursor.state)) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pg-query-stream/pg-query-stream@1.0.0.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    packages: ['pg'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/pg-types/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pg-types/pg-types.js",
    "content": "'use strict';\n\nrequire('pg-types');\nvar scriptToCheck = 'pg-types/lib/textParsers.js';\nrequire(scriptToCheck, 'must-exclude');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/pg-types/pg-types@1.0.0.js",
    "content": "'use strict';\n\nrequire('./pg-types.js');\n"
  },
  {
    "path": "test/test-79-npm/pg.js/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pg.js/pg.js.js",
    "content": "'use strict';\n\nvar pg = require('pg.js');\nif (pg.connect) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pg.js/pg.js@3.6.2.js",
    "content": "'use strict';\n\nrequire('./pg.js.js');\n"
  },
  {
    "path": "test/test-79-npm/pg.js/pg.js@4.1.0.js",
    "content": "'use strict';\n\nrequire('./pg.js.js');\n"
  },
  {
    "path": "test/test-79-npm/pgpass/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pgpass/pgpass.js",
    "content": "'use strict';\n\nvar pgpass = require('pgpass');\n\nvar connection = {\n  host: 'pgserver',\n  user: 'the_user_name',\n};\n\npgpass(connection, function () {\n  console.log('ok');\n});\n"
  },
  {
    "path": "test/test-79-npm/phantom/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/phantom/phantom.js",
    "content": "'use strict';\n\nvar phantom = require('phantom');\n\nvar instance, page;\nPromise.resolve()\n  .then(function () {\n    return phantom.create();\n  })\n  .then(function (i) {\n    instance = i;\n    return instance.createPage();\n  })\n  .then(function (p) {\n    page = p;\n    return page.open('https://stackoverflow.com/');\n  })\n  .then(function () {\n    return page.property('content');\n  })\n  .then(function (content) {\n    if (content.length > 1000) console.log('ok');\n    return instance.exit();\n  });\n"
  },
  {
    "path": "test/test-79-npm/phantom/phantom.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: !/^arm/.test(stamp.a),\n    deployFilesFrom: ['phantom', 'phantomjs-prebuilt'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/phantomjs-prebuilt/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/phantomjs-prebuilt/phantomjs-prebuilt.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar phantomjs = require('phantomjs-prebuilt');\nvar filename = phantomjs.path;\nif (\n  fs.existsSync(filename) &&\n  path.isAbsolute(filename) &&\n  filename.indexOf('snapshot') < 0\n) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/phantomjs-prebuilt/phantomjs-prebuilt.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: !/^arm/.test(stamp.a),\n    deployFilesFrom: ['phantomjs-prebuilt'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/pkginfo/package.json",
    "content": "{\n  \"private\": true,\n  \"fixture\": \"fixture-text\"\n}\n"
  },
  {
    "path": "test/test-79-npm/pkginfo/pkginfo.js",
    "content": "'use strict';\n\nrequire('./package.json'); // to include\nrequire('pkginfo')(module); // changes module.exports\nif (module.exports.fixture === 'fixture-text') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pkginfo/pkginfo@0.2.1.js",
    "content": "'use strict';\n\n// to check that readdir-based\n// pkginfo version also works\n\nrequire('./pkginfo.js');\n"
  },
  {
    "path": "test/test-79-npm/pm2/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pm2/test.it.manually.meta.js",
    "content": "// pm2 оставляет следы в системе. придумай как\n// его проверить без установки демона\n"
  },
  {
    "path": "test/test-79-npm/pmx/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pmx/pmx.js",
    "content": "'use strict';\n\nvar pmx = require('pmx');\nif (pmx.http) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pmx/pmx@0.5.9.js",
    "content": "'use strict';\n\nrequire('./pmx.js');\n"
  },
  {
    "path": "test/test-79-npm/pouchdb/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pouchdb/pouchdb.js",
    "content": "'use strict';\n\nvar PouchDB = require('pouchdb');\nvar db = new PouchDB('dbname');\nvar rimraf = require('../../../node_modules/rimraf');\n\n(function (cb) {\n  db.put(\n    {\n      _id: 'dave@gmail.com',\n      name: 'David',\n      age: 68,\n    },\n    function (error1) {\n      if (error1) return cb(error1);\n      db.get('dave@gmail.com', function (error2, data) {\n        if (error2) return cb(error2);\n        if (data.age === 68) {\n          console.log('ok');\n          return cb();\n        }\n      });\n    }\n  );\n})(function (error) {\n  if (error) throw error;\n  db.close(function () {\n    rimraf.sync('dbname');\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/pouchdb/pouchdb.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    build: 'leveldown',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/primus/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/primus/primus.js",
    "content": "'use strict';\n\nvar primus = require('primus');\nif (primus.transformers) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/primus-emitter/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/primus-emitter/primus-emitter.js",
    "content": "'use strict';\n\nvar emitter = require('primus-emitter');\nif (emitter.Emitter) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/primus-spark-latency/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/primus-spark-latency/primus-spark-latency.js",
    "content": "'use strict';\n\nvar latency = require('primus-spark-latency');\nif (latency.server) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/publicsuffixlist/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/publicsuffixlist/publicsuffixlist.js",
    "content": "'use strict';\n\nif (process.pkg) {\n  let hasBadDeps = true;\n  try {\n    require('./node_modules/istanbul', 'must-exclude');\n  } catch (_) {\n    hasBadDeps = false;\n  }\n  // istanbul must be in devDeps, not in deps\n  if (hasBadDeps) return;\n}\n\nvar PublicSuffixList = require('publicsuffixlist');\nvar list = new PublicSuffixList();\nlist.initializeSync();\nvar result = list.lookup('www.domain.com');\nif (result.tld === 'com') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pug/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pug/pug.js",
    "content": "'use strict';\n\n// see also express.js\n\nvar file =\n  'html\\n' +\n  '  head\\n' +\n  '    title!= title\\n' +\n  '  body\\n' +\n  '    h1!= message\\n';\n\nvar pug = require('pug');\nvar fn = pug.compile(file, {});\nvar html = fn({ title: 'Hey', message: 'Hello there!' });\n\nif (\n  html ===\n  '<html><head><title>Hey</title></head>' +\n    '<body><h1>Hello there!</h1></body></html>'\n) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/punt/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/punt/punt.js",
    "content": "'use strict';\n\nvar punt = require('punt');\nif (punt.bind && punt.connect) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/punt/punt@1.0.1.js",
    "content": "'use strict';\n\nrequire('./punt.js');\n"
  },
  {
    "path": "test/test-79-npm/puppeteer/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/puppeteer/puppeteer.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar puppeteer = require('puppeteer');\n\npuppeteer.launch().then(function (browser) {\n  browser.newPage().then(function (page) {\n    page\n      .goto('https://zeit.co')\n      .then(function () {\n        page.screenshot({ path: 'zeit.png' }).then(function () {\n          browser.close();\n          fs.unlinkSync('zeit.png');\n          console.log('ok');\n        });\n      })\n      .catch((error) => {\n        console.error(error);\n        process.exit(1);\n      });\n  });\n});\n"
  },
  {
    "path": "test/test-79-npm/puppeteer/puppeteer.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp, flags) {\n  if (flags.ci) {\n    return {\n      allow: false,\n      note: 'headless CI seems to fail headful chromium',\n    };\n  }\n\n  return {\n    deployFilesFrom: ['puppeteer'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/pwd/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/pwd/pwd.js",
    "content": "'use strict';\n\nvar pwd = require('pwd');\nif (pwd.hash) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/pwd/pwd@0.0.4.js",
    "content": "'use strict';\n\nrequire('./pwd.js');\n"
  },
  {
    "path": "test/test-79-npm/q/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/q/q.js",
    "content": "'use strict';\n\nvar q = require('q');\nif (q.join) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/raven/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/raven/raven.js",
    "content": "'use strict';\n\nrequire('raven');\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/rc/.fixture.for.rc",
    "content": "NAME=VALUE\n"
  },
  {
    "path": "test/test-79-npm/rc/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/rc/rc.config.json",
    "content": "{\n  \"bin\": \"rc.js\",\n  \"pkg\": {\n    \"assets\": [\".fixture.for.rc\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/rc/rc.js",
    "content": "'use strict';\n\nvar conf = require('rc')('fixture.for.', {});\nif (conf.NAME === 'VALUE') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/readable-stream/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/readable-stream/readable-stream.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar fst = fs.createReadStream(path.join(__dirname, 'readable-stream.js'));\nvar Readable = require('readable-stream');\nvar rst = new Readable();\nrst.wrap(fst);\n\nsetTimeout(function () {\n  var test = \"'use strict';\";\n  var c = rst.read(test.length);\n  if (c.toString() === test) {\n    console.log('ok');\n  }\n}, 100);\n"
  },
  {
    "path": "test/test-79-npm/rechoir/fixture.coffee",
    "content": "module.exports =\n  root: Math.sqrt\n  cube: (x) -> x * square x\n"
  },
  {
    "path": "test/test-79-npm/rechoir/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/rechoir/rechoir.config.json",
    "content": "{\n  \"bin\": \"rechoir.js\",\n  \"pkg\": {\n    \"assets\": [\"fixture.coffee\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/rechoir/rechoir.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar config = require('interpret').extensions;\nvar rechoir = require('rechoir');\nrequire('coffee-script/register');\nrechoir.prepare(config, './fixture.coffee');\nvar filename = path.join(__dirname, 'fixture.coffee');\nvar coffee = require(filename);\n\nif (typeof coffee.root === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/rechoir/rechoir.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    packages: ['coffee-script', 'interpret'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/redis/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/redis/redis.js",
    "content": "'use strict';\n\nvar redis = require('redis');\nvar client = redis.createClient();\n\nclient.on('error', function (error) {\n  var ok = error.message.indexOf('ECONNREFUSED') >= 0;\n  if (ok) console.log('ok');\n  process.exit();\n});\n"
  },
  {
    "path": "test/test-79-npm/redis/redis@1.0.0.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis/redis@2.0.1.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis/redis@2.1.0.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis/redis@2.2.5.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis/redis@2.3.1.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis/redis@2.4.2.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-parser/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/redis-parser/redis-parser.js",
    "content": "'use strict';\n\nvar Parser = require('redis-parser');\nvar parser = new Parser({\n  name: 'auto',\n  returnReply: function (reply) {\n    console.log(reply);\n  },\n  returnError: function (error) {\n    console.log(error);\n  },\n  returnFatalError: function (error) {\n    console.log(error);\n  },\n});\n\nif (Array.isArray(parser.bufferCache)) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis.js",
    "content": "'use strict';\n\nvar redis = require('redis');\nvar client = redis.createClient();\n\nclient.on('error', function (error) {\n  var ok = error.message.indexOf('ECONNREFUSED') >= 0;\n  if (ok) console.log('ok');\n  process.exit();\n});\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    packages: ['hiredis'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@1.0.0.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@1.0.0.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./redis.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.0.1.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.0.1.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./redis.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.1.0.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.1.0.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./redis.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.2.5.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.2.5.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./redis.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.3.1.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.3.1.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./redis.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.4.2.js",
    "content": "'use strict';\n\nrequire('./redis.js');\n"
  },
  {
    "path": "test/test-79-npm/redis-with-hiredis/redis@2.4.2.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./redis.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/regression/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/regression/regression.js",
    "content": "'use strict';\n\nvar regression = require('regression');\nif (typeof regression.linear === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/regression/regression@1.4.0.js",
    "content": "'use strict';\n\nvar regression = require('regression');\nif (typeof regression === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/reload/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/reload/reload.js",
    "content": "'use strict';\n\nrequire('./reload@2.1.0.js');\n"
  },
  {
    "path": "test/test-79-npm/reload/reload.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./reload@2.1.0.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/reload/reload@2.1.0.js",
    "content": "'use strict';\n\nvar http = require('http');\nrequire('reload/bin/reload');\n\nsetTimeout(function () {\n  http.get('http://127.0.0.1:8080/', function (res) {\n    var chunks = '';\n    res\n      .on('data', function (chunk) {\n        chunks += chunk.toString();\n      })\n      .on('end', function () {\n        if (chunks === \"Can't find index.html\" || chunks === 'File Not Found') {\n          console.log('ok');\n        }\n        process.exit();\n      });\n  });\n}, 500);\n"
  },
  {
    "path": "test/test-79-npm/reload/reload@2.1.0.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    take: 'last-line',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/request/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/request/request.js",
    "content": "'use strict';\n\nvar request = require('request');\nif (request.get) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/require-uncached/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/require-uncached/require-uncached.js",
    "content": "'use strict';\n\nrequire('acorn'); // in order to take\nvar require2 = require('require-uncached');\nvar dep = 'acorn';\nvar result = require2(dep);\nif (typeof result !== 'undefined') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/require_optional/package.json",
    "content": "{\n  \"private\": true,\n  \"peerOptionalDependencies\": {\n    \"chalk\": \"*\"\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/require_optional/require_optional.config.json",
    "content": "{\n  \"bin\": \"require_optional.js\",\n  \"pkg\": {\n    \"assets\": [\"package.json\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/require_optional/require_optional.js",
    "content": "'use strict';\n\nvar require2 = require('require_optional');\nvar chalk = require2('chalk');\nif (typeof chalk === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/s3/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/s3/s3.js",
    "content": "'use strict';\n\nvar s3 = require('s3');\n\nvar client = s3.createClient({\n  s3Options: {\n    accessKeyId: 'ABRACADABRABRACADABR',\n    secretAccessKey: 'TdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTd',\n  },\n});\n\nvar ee = client.listObjects({\n  s3Params: {\n    Bucket: 'enclosejs',\n  },\n});\n\nee.on('error', function (error) {\n  if (error) {\n    if (error.message.indexOf('does not exist') >= 0) {\n      console.log('ok');\n    }\n  }\n});\n"
  },
  {
    "path": "test/test-79-npm/safe_datejs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/safe_datejs/safe_datejs.js",
    "content": "'use strict';\n\nrequire('safe_datejs');\nvar today = new Date(2011, 11, 12, 0, 0, 0, 0);\nvar wrap = today.AsDateJs(); // eslint-disable-line new-cap\nif (wrap.is().today() === false) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/sails/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/sails/sails.js",
    "content": "'use strict';\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/sails/sails.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    allow: false, // TODO not that simple to test. but may be try?\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/sax/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/sax/sax.js",
    "content": "'use strict';\n\nvar sax = require('sax');\nvar parser = sax.parser(true);\n\nparser.onopentag = function (node) {\n  if (node.name === 'hello') {\n    console.log('ok');\n  }\n};\n\nparser.write('<hello>World!</hello>').close();\n"
  },
  {
    "path": "test/test-79-npm/scrypt/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/scrypt/scrypt.js",
    "content": "'use strict';\n\nvar scrypt = require('scrypt');\nif (scrypt.hashSync) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/scrypt/scrypt.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/scrypt/scrypt@5.4.1.js",
    "content": "'use strict';\n\nrequire('./scrypt.js');\n"
  },
  {
    "path": "test/test-79-npm/scrypt/scrypt@5.4.1.meta.js",
    "content": "'use strict';\n\nmodule.exports = require('./scrypt.meta.js');\n"
  },
  {
    "path": "test/test-79-npm/semver/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/semver/semver.js",
    "content": "'use strict';\n\nvar semver = require('semver');\nif (semver.SEMVER_SPEC_VERSION) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/sequelize/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/sequelize/sequelize.config.json",
    "content": "{\n  \"bin\": \"sequelize.js\",\n  \"dependencies\": {\n    \"mysql2\": \"*\",\n    \"pg\": \"*\",\n    \"pg-hstore\": \"*\",\n    \"sqlite3\": \"*\",\n    \"tedious\": \"*\"\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/sequelize/sequelize.js",
    "content": "'use strict';\n\nvar sequelize = require('sequelize');\nif (typeof sequelize.and !== 'function') return;\n\nvar Dialect2 = require('sequelize/lib/dialects/mssql');\nvar db2 = new Dialect2({ config: {}, options: { dialect: 'mssql' } });\nvar cm2 = db2.connectionManager;\nif (typeof cm2.lib.Connection !== 'function') return;\n\nvar Dialect3 = require('sequelize/lib/dialects/mysql');\nvar db3 = new Dialect3({ config: {}, options: { dialect: 'mysql' } });\nvar cm3 = db3.connectionManager;\nif (typeof cm3.lib.createConnection !== 'function') return;\n\nvar Dialect4 = require('sequelize/lib/dialects/postgres');\nvar db4 = new Dialect4({ config: {}, options: { dialect: 'postgres' } });\nvar cm4 = db4.connectionManager;\nif (typeof cm4.lib.Connection !== 'function') return;\n\nvar Dialect5 = require('sequelize/lib/dialects/sqlite');\nvar db5 = new Dialect5({ config: {}, options: { dialect: 'sqlite' } });\nvar cm5 = db5.connectionManager;\nif (typeof cm5.lib.Database !== 'function') return;\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/sequelize/sequelize.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    packages: ['mysql2', 'pg', 'pg-hstore', 'sqlite3', 'tedious'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/sequelize/sequelize@3.30.4.config.json",
    "content": "{\n  \"bin\": \"sequelize@3.30.4.js\",\n  \"dependencies\": {\n    \"mysql\": \"*\",\n    \"pg\": \"*\",\n    \"pg-hstore\": \"*\",\n    \"sqlite3\": \"*\",\n    \"tedious\": \"*\"\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/sequelize/sequelize@3.30.4.js",
    "content": "'use strict';\n\nvar sequelize = require('sequelize');\nif (typeof sequelize.and !== 'function') return;\n\nvar Dialect1 = require('sequelize/lib/dialects/mariadb');\nvar db1 = new Dialect1({ config: {}, options: { dialect: 'mariadb' } });\nvar cm1 = db1.connectionManager;\nif (typeof cm1.lib.createConnection !== 'function') return;\n\nvar Dialect2 = require('sequelize/lib/dialects/mssql');\nvar db2 = new Dialect2({ config: {}, options: { dialect: 'mssql' } });\nvar cm2 = db2.connectionManager;\nif (typeof cm2.lib.Connection !== 'function') return;\n\nvar Dialect3 = require('sequelize/lib/dialects/mysql');\nvar db3 = new Dialect3({ config: {}, options: { dialect: 'mysql' } });\nvar cm3 = db3.connectionManager;\nif (typeof cm3.lib.createConnection !== 'function') return;\n\nvar Dialect4 = require('sequelize/lib/dialects/postgres');\nvar db4 = new Dialect4({ config: {}, options: { dialect: 'postgres' } });\nvar cm4 = db4.connectionManager;\nif (typeof cm4.lib.Connection !== 'function') return;\n\nvar Dialect5 = require('sequelize/lib/dialects/sqlite');\nvar db5 = new Dialect5({ config: {}, options: { dialect: 'sqlite' } });\nvar cm5 = db5.connectionManager;\nif (typeof cm5.lib.Database !== 'function') return;\n\nconsole.log('ok');\n"
  },
  {
    "path": "test/test-79-npm/sequelize/sequelize@3.30.4.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    packages: ['mysql', 'pg', 'pg-hstore', 'sqlite3', 'tedious'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/serialport/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/serialport/serialport.js",
    "content": "'use strict';\n\nvar serialport = require('serialport');\nif (typeof serialport.list === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/serialport/serialport.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/sha3/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/sha3/sha3.js",
    "content": "'use strict';\n\nvar sha3 = require('sha3');\nif (sha3.SHA3Hash) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/sha3/sha3.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/sharp/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/sharp/sharp.js",
    "content": "'use strict';\n\nvar sharp = require('sharp');\n\nvar source = Buffer.from(\n  '<svg><rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" rx=\"50\" ry=\"50\"/></svg>'\n);\n\nsharp(source)\n  .rotate()\n  .toBuffer()\n  .then(function (output) {\n    if (output.slice(1, 4).toString() === 'PNG') {\n      console.log('ok');\n      process.exit();\n    }\n  })\n  .catch((error) => {\n    console.error(error);\n    process.exit(1);\n  });\n\nsetTimeout(() => {\n  // if test does not pass, it blocks\n  // any other way to exit\n  process.kill(process.pid);\n}, 3000);\n"
  },
  {
    "path": "test/test-79-npm/sharp/sharp.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    deployFilesFrom: ['sharp'],\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/shelljs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/shelljs/shelljs.js",
    "content": "'use strict';\n\nvar shell = require('shelljs');\nvar windows = process.platform === 'win32';\nvar result = shell.exec(windows ? 'dir' : 'ls', { silent: true });\nvar data = result.stdout || result.output;\nif (data.length >= 2) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/shelljs/shelljs@0.1.4.js",
    "content": "'use strict';\n\nrequire('./shelljs.js');\n"
  },
  {
    "path": "test/test-79-npm/shelljs/shelljs@0.6.0.js",
    "content": "'use strict';\n\nrequire('./shelljs.js');\n"
  },
  {
    "path": "test/test-79-npm/shelljs/shelljs@0.7.6.js",
    "content": "'use strict';\n\nrequire('./shelljs.js');\n"
  },
  {
    "path": "test/test-79-npm/sinon/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/sinon/sinon.js",
    "content": "'use strict';\n\nvar sinon = require('sinon');\nvar callback = sinon.spy();\ncallback();\nif (callback.called) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/sinon/sinon@1.1.0.js",
    "content": "'use strict';\n\nrequire('./sinon.js');\n"
  },
  {
    "path": "test/test-79-npm/socket.io/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/socket.io/socket.io.js",
    "content": "'use strict';\n\nvar http = require('http');\nvar io = require('socket.io')();\nio.on('connection', function () {});\nio.listen(3000);\n\nsetTimeout(function () {\n  http.get('http://127.0.0.1:3000/socket.io/socket.io.js', function (res) {\n    var chunks = '';\n    res\n      .on('data', function (chunk) {\n        chunks += chunk.toString();\n      })\n      .on('end', function () {\n        if (chunks.indexOf('BINARY_ACK') >= 0) {\n          console.log('ok');\n        }\n        io.close();\n      });\n  });\n}, 100);\n"
  },
  {
    "path": "test/test-79-npm/socket.io/socket.io@1.4.8.js",
    "content": "'use strict';\n\nvar http = require('http');\nvar io = require('socket.io')();\nio.on('connection', function () {});\nio.listen(3000);\n\nsetTimeout(function () {\n  http.get('http://127.0.0.1:3000/socket.io/socket.io.js', function (res) {\n    var chunks = '';\n    res\n      .on('data', function (chunk) {\n        chunks += chunk.toString();\n      })\n      .on('end', function () {\n        if (chunks.indexOf('_dereq_') >= 0) {\n          console.log('ok');\n        }\n        io.close();\n      });\n  });\n}, 100);\n"
  },
  {
    "path": "test/test-79-npm/socket.io/socket.io@1.6.0.js",
    "content": "'use strict';\n\nvar http = require('http');\nvar io = require('socket.io')();\nio.on('connection', function () {});\nio.listen(3000);\n\nsetTimeout(function () {\n  http.get('http://127.0.0.1:3000/socket.io/socket.io.js', function (res) {\n    var chunks = '';\n    res\n      .on('data', function (chunk) {\n        chunks += chunk.toString();\n      })\n      .on('end', function () {\n        if (chunks.indexOf('__webpack_require__') >= 0) {\n          console.log('ok');\n        }\n        io.close();\n      });\n  });\n}, 100);\n"
  },
  {
    "path": "test/test-79-npm/socket.io/socket.io@1.7.0.js",
    "content": "'use strict';\n\nrequire('./socket.io.js');\n"
  },
  {
    "path": "test/test-79-npm/socket.io-client/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/socket.io-client/socket.io-client.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar client = require('socket.io-client');\nif (typeof client.protocol === 'number') {\n  var literal = 'socket.io-client/dist/socket.io.js';\n  var p = require.resolve(literal, 'may-exclude');\n  var asset = fs.readFileSync(p, 'utf8');\n  if (asset.length > 100) {\n    console.log('ok');\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/socket.io-client/socket.io-client@0.9.17.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar client = require('socket.io-client');\nif (typeof client.protocol === 'number') {\n  var literal = 'socket.io-client/dist/socket.io.js';\n  var path = require.resolve(literal, 'may-exclude');\n  var asset = fs.readFileSync(path, 'utf8');\n  var literalMin = 'socket.io-client/dist/socket.io.min.js';\n  var pathMin = require.resolve(literalMin, 'may-exclude');\n  var assetMin = fs.readFileSync(pathMin, 'utf8');\n  if (asset.length > 100 && assetMin.length > 100) {\n    console.log('ok');\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/socket.io-client/socket.io-client@1.0.6.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar client = require('socket.io-client');\nif (typeof client.protocol === 'number') {\n  var literal = 'socket.io-client/socket.io.js';\n  var p = require.resolve(literal, 'may-exclude');\n  var asset = fs.readFileSync(p, 'utf8');\n  if (asset.length > 100) {\n    console.log('ok');\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/socket.io-client/socket.io-client@1.7.0.js",
    "content": "'use strict';\n\nrequire('./socket.io-client.js');\n"
  },
  {
    "path": "test/test-79-npm/sqip/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/sqip/sqip.js",
    "content": "'use strict';\n\nvar sqip = require('sqip');\nif (sqip !== undefined) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/sqlite3/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/sqlite3/sqlite3.js",
    "content": "'use strict';\n\nvar sqlite3 = require('sqlite3');\nif (typeof sqlite3.verbose === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/sqlite3/sqlite3.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/stamp.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nvar o = {\n  p: process.platform,\n  a: process.arch,\n  m: parseInt(process.versions.modules, 10),\n};\n\nif (module.parent) {\n  module.exports = o;\n} else {\n  process.stdout.write(JSON.stringify(o));\n}\n"
  },
  {
    "path": "test/test-79-npm/steam/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/steam/steam.js",
    "content": "'use strict';\n\nvar Steam = require('steam');\nvar steamClient = new Steam.SteamClient();\nif (typeof steamClient.connect === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/steam/steam.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp) && stamp.m >= 46,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/steam-crypto/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/steam-crypto/steam-crypto.js",
    "content": "'use strict';\n\nvar sc = require('steam-crypto');\nif (sc.generateSessionKey) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/stripe/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/stripe/stripe.js",
    "content": "'use strict';\n\nvar stripe = require('stripe');\nif (stripe.DEFAULT_HOST === 'api.stripe.com') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/stripe/stripe@3.9.0.js",
    "content": "'use strict';\n\nrequire('./stripe.js');\n"
  },
  {
    "path": "test/test-79-npm/stripe-webhook-middleware/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/stripe-webhook-middleware/stripe-webhook-middleware.js",
    "content": "'use strict';\n\nvar StripeWebhook = require('stripe-webhook-middleware');\nvar req = { headers: {}, body: { id: 'hello' } };\nvar res = {\n  status: function () {\n    return this;\n  },\n  end: function () {\n    console.log('ok');\n  },\n};\n\nvar middleware = new StripeWebhook().middleware;\nmiddleware(req, res, function () {});\n"
  },
  {
    "path": "test/test-79-npm/strong-globalize/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/strong-globalize/strong-globalize.js",
    "content": "'use strict';\n\nvar SG = require('strong-globalize');\nif (typeof SG.SetRootDir === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/stylus/external.css",
    "content": ".foo .bar {\n  width: 10px;\n}\n"
  },
  {
    "path": "test/test-79-npm/stylus/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/stylus/stylus.config.json",
    "content": "{\n  \"bin\": \"stylus.js\",\n  \"pkg\": {\n    \"assets\": [\"external.css\"]\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/stylus/stylus.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar stylus = require('stylus');\nvar s = '@require \"external.css\"';\nvar opts = { filename: 'index.css', paths: [__dirname] };\nvar dep = stylus(s, opts).deps()[0];\nif (path.basename(dep) === 'external.css') {\n  stylus.render(s, opts, function (error, css) {\n    if (error) return;\n    if (css === '@import \"external.css\";\\n') {\n      console.log('ok');\n    }\n  });\n}\n"
  },
  {
    "path": "test/test-79-npm/supervisor/fixture.js",
    "content": "'use strict';\n\nconsole.error('ok');\n"
  },
  {
    "path": "test/test-79-npm/supervisor/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/supervisor/supervisor.js",
    "content": "'use strict';\n\nvar supervisor = require('supervisor');\nvar program = require.resolve('./fixture.js');\nvar args = ['-n', 'success', program];\nsupervisor.run(args);\nsetTimeout(function () {\n  process.exit();\n}, 500);\n"
  },
  {
    "path": "test/test-79-npm/supervisor/supervisor.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    take: 'stderr',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/svgo/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/svgo/svgo.js",
    "content": "'use strict';\n\nvar svgo = require('svgo');\nif (svgo !== undefined) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/tabtab/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/tabtab/tabtab.js",
    "content": "'use strict';\n\nvar tabtab = require('tabtab');\nif (typeof tabtab === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/tesseract.js/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/tesseract.js/tesseract.js.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar Tesseract = require('tesseract.js');\nvar image = path.join(__dirname, 'hello.jpg');\n\nTesseract.recognize(image)\n  .then(function ({ data }) {\n    if (data && data.text && typeof data.text === 'string') {\n      if (data.text.toLowerCase().indexOf('hello') >= 0) {\n        console.log('ok');\n      } else {\n        console.log(data.text.replace(/\\n/g, '\\\\n'));\n      }\n    } else {\n      console.log(data);\n    }\n  })\n  .catch(function (error) {\n    console.log(error);\n  })\n  .finally(function () {\n    fs.unlinkSync('eng.traineddata');\n    process.exit();\n  });\n"
  },
  {
    "path": "test/test-79-npm/tesseract.js/tesseract.js.meta.js",
    "content": "'use strict';\n\nmodule.exports = function () {\n  return {\n    take: 'last-line',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/throng/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/throng/throng.js",
    "content": "'use strict';\n\nvar throng = require('throng');\n\nthrong(8, function (id) {\n  if (id === 7) {\n    console.log('ok');\n  }\n});\n\nsetTimeout(function () {\n  process.exit();\n}, 5000);\n"
  },
  {
    "path": "test/test-79-npm/throng/throng.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp) {\n  return {\n    allow: stamp.m >= 46,\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/time/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/time/time.js",
    "content": "'use strict';\n\nvar time = require('time');\nvar now = new time.Date();\nnow.setTimezone('America/Los_Angeles');\nvar s = now.toString();\nif (s.length > 5) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/time/time.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/times.js",
    "content": "'use strict';\n\nconst https = require('https');\nconst foldyNames = process.argv[2].split(',');\n\nconst results = {};\nprocess.on('exit', function () {\n  console.log(JSON.stringify(results));\n});\n\nfor (let i = 0; i < 10; i += 1) {\n  nextJob();\n}\n\nfunction nextJob() {\n  if (foldyNames.length === 0) return;\n  queueJob(foldyNames.shift());\n}\n\nfunction queueJob(foldyName) {\n  getLatestTime(foldyName, function (error, latestTime) {\n    if (error) console.error(error);\n    results[foldyName] = new Date(latestTime).getTime();\n    setTimeout(nextJob, 0);\n  });\n}\n\nfunction getLatestTime(foldyName, cb) {\n  https\n    .get('https://registry.npmjs.org/' + foldyName, function (response) {\n      let s = '';\n      response.on('data', function (chunk) {\n        s += chunk;\n      });\n      response.on('end', function () {\n        const json = JSON.parse(s);\n        const distTags = json['dist-tags'];\n        if (!distTags) return cb(undefined, Date.now()); // express-with-jade\n        const latest = distTags.latest;\n        cb(undefined, json.time[latest]);\n      });\n      response.on('error', function (error) {\n        cb(error);\n      });\n    })\n    .on('error', function (error) {\n      cb(error);\n    });\n}\n"
  },
  {
    "path": "test/test-79-npm/tinify/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/tinify/tinify.js",
    "content": "'use strict';\n\nvar tinify = require('tinify');\nif (tinify !== undefined) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/tiny-worker/fixture.js",
    "content": "/* eslint-disable no-undef */\n\n'use strict';\n\nonmessage = function (ev) {\n  postMessage(ev.data.slice(0, 2));\n};\n"
  },
  {
    "path": "test/test-79-npm/tiny-worker/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/tiny-worker/tiny-worker.js",
    "content": "'use strict';\n\nvar Worker = require('tiny-worker');\nvar worker = new Worker('fixture.js');\n\nworker.onmessage = function (ev) {\n  console.log(ev.data);\n  worker.terminate();\n};\n\nworker.postMessage('ok?');\n"
  },
  {
    "path": "test/test-79-npm/tmp/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/tmp/tmp.js",
    "content": "'use strict';\n\nvar tmp = require('tmp');\nif (tmp.fileSync) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/transformers/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/transformers/transformers.js",
    "content": "'use strict';\n\nvar transformers = require('transformers');\n\ntry {\n  transformers.ejs.loadModule();\n} catch (e) {\n  if (e.code === 'MODULE_NOT_FOUND') {\n    console.log('ok');\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/uglify-js/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/uglify-js/uglify-js.js",
    "content": "'use strict';\n\nvar ujs = require('uglify-js');\nvar code = 'var b = function () {};';\nvar result = ujs.minify(code);\nif (result.code === 'var b=function(){};') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/uglify-js/uglify-js@2.7.5.js",
    "content": "'use strict';\n\nvar ujs = require('uglify-js');\nvar code = '40 + 2';\nvar ast = ujs.parse(code, {});\nif (ast.body[0].body.operator === '+') {\n  var code2 = 'var b = function () {};';\n  var result = ujs.minify(code2, { fromString: true });\n  if (result.code === 'var b=function(){};') {\n    console.log('ok');\n  }\n}\n"
  },
  {
    "path": "test/test-79-npm/umd/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/umd/umd.js",
    "content": "'use strict';\n\nvar umd = require('umd');\nif (umd.prelude) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/umd/umd@2.1.0.js",
    "content": "'use strict';\n\nrequire('./umd.js');\n"
  },
  {
    "path": "test/test-79-npm/underscore/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/underscore/underscore.js",
    "content": "'use strict';\n\nvar underscore = require('underscore');\nif (typeof underscore === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/union/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/union/union.js",
    "content": "'use strict';\n\nvar union = require('union');\nif (typeof union.createServer === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/update-notifier/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/update-notifier/update-notifier.js",
    "content": "'use strict';\n\n// anyway testing in ci\nrequire('ci-info').isCI = false;\n\nvar spawnWasCalled;\nvar save = require('child_process').spawn;\nrequire('child_process').spawn = function () {\n  spawnWasCalled = true;\n  return save.apply(this, arguments); // eslint-disable-line prefer-rest-params\n};\n\nvar updateNotifier = require('update-notifier');\nvar pjson = { name: 'pkg', version: '3.0.0' };\nvar notifier;\n\nfunction runNotifier() {\n  notifier = updateNotifier({\n    pkg: pjson,\n    updateCheckInterval: 0,\n  });\n  setTimeout(function () {\n    if (\n      spawnWasCalled &&\n      notifier.update &&\n      notifier.update.current === '3.0.0'\n    ) {\n      console.log('ok');\n      process.exit(0);\n    } else {\n      runNotifier();\n    }\n  }, 1984);\n}\n\nrunNotifier();\n"
  },
  {
    "path": "test/test-79-npm/update-notifier/update-notifier.meta.js",
    "content": "'use strict';\n\nmodule.exports = function (stamp, flags) {\n  if (flags.ci) {\n    return {\n      allow: false,\n    };\n  }\n};\n"
  },
  {
    "path": "test/test-79-npm/usage/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/usage/usage.js",
    "content": "'use strict';\n\nvar usage = require('usage');\nvar pid = process.pid;\nusage.lookup(pid, function (error, result) {\n  if (error) throw error;\n  if (result.memory) console.log('ok');\n});\n"
  },
  {
    "path": "test/test-79-npm/usage/usage.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp) && stamp.p !== 'win32',\n    note: 'windows is not supported',\n  };\n};\n"
  },
  {
    "path": "test/test-79-npm/v8flags/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/v8flags/v8flags.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar cp = require('child_process');\n\nrequire('module')._extensions['.json'] = function () {\n  throw new Error('prevent loading json cache');\n};\n\nvar execFileCalled = false;\nvar execFileSave = cp.execFile;\n\ncp.execFile = function () {\n  execFileCalled = true;\n  execFileSave.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n};\n\nsetTimeout(function () {\n  var v8flags = require('v8flags');\n  v8flags(function (error, results) {\n    if (error) return;\n    if (!Array.isArray(results)) return;\n    if (results.length < 6) return;\n    if (!execFileCalled) return;\n    console.log('ok');\n  });\n}, 500);\n"
  },
  {
    "path": "test/test-79-npm/v8flags/v8flags@2.1.1.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nvar cp = require('child_process');\n\nrequire('module')._extensions['.json'] = function () {\n  throw new Error('prevent loading json cache');\n};\n\nvar execFileCalled = false;\nvar execFileSave = cp.execFile;\n\ncp.execFile = function () {\n  execFileCalled = true;\n  execFileSave.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n};\n\nsetTimeout(function () {\n  var v8flags = require('v8flags');\n  v8flags(function (error, results) {\n    if (error) return;\n    if (!Array.isArray(results)) return;\n    if (results.length < 6) return;\n    if (!execFileCalled) return;\n    console.log('ok');\n  });\n}, 500);\n"
  },
  {
    "path": "test/test-79-npm/verror/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/verror/verror.js",
    "content": "'use strict';\n\nvar verror = require('verror');\nif (typeof verror === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/voc/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/voc/voc.js",
    "content": "'use strict';\n\nvar voc = require('voc');\nif (typeof voc.run === 'function') {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/webdriverio/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/webdriverio/webdriverio.js",
    "content": "'use strict';\n\nvar webdriverio = require('webdriverio');\nvar client = webdriverio.remote().init();\nclient.url('http://google.com').catch((e) => {\n  if (e.message.includes('ECONNREFUSED')) {\n    console.log('ok');\n  }\n});\n"
  },
  {
    "path": "test/test-79-npm/winston/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/winston/winston.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nprocess.stdout._write_ = process.stdout.write;\nprocess.stdout.write = function (m) {\n  process.stdout._write_(m.slice(m.indexOf(': ') + 2));\n};\n\nvar winston = require('winston');\nvar Logger = winston.Logger;\nvar Console = winston.transports.Console;\nnew Logger({ transports: [new Console()] }); // eslint-disable-line no-new\nwinston.log('info', 'ok');\n"
  },
  {
    "path": "test/test-79-npm/winston-uber/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/winston-uber/winston-uber.js",
    "content": "/* eslint-disable no-underscore-dangle */\n\n'use strict';\n\nprocess.stdout._write_ = process.stdout.write;\nprocess.stdout.write = function (m) {\n  process.stdout._write_(m.slice(m.indexOf(': ') + 2));\n};\n\nvar winston = require('winston-uber');\nvar Logger = winston.Logger;\nvar Console = winston.transports.Console;\nnew Logger({ transports: [new Console()] }); // eslint-disable-line no-new\nwinston.log('info', 'ok');\n"
  },
  {
    "path": "test/test-79-npm/ws/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/ws/ws.js",
    "content": "'use strict';\n\nvar WebSocket = require('ws');\nvar ws = new WebSocket('ws://127.0.0.1/');\nws.on('error', function () {\n  console.log('ok');\n});\n"
  },
  {
    "path": "test/test-79-npm/ws/ws@0.5.0.js",
    "content": "'use strict';\n\nrequire('./ws.js');\n"
  },
  {
    "path": "test/test-79-npm/xlsx/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/xlsx/xlsx.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar xlsx = require('xlsx');\n\nvar xls = xlsx.readFileSync(path.join(__dirname, 'registry.xls'));\nvar ods = xlsx.readFileSync(path.join(__dirname, 'ffc.ods'));\n\nif (xls.Strings.length > 50 && ods.SheetNames.length > 0) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/xml2js/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/xml2js/xml2js.js",
    "content": "'use strict';\n\nvar parse = require('xml2js').parseString;\nvar xml = '<root>Hello xml2js!</root>';\nparse(xml, function (error, result) {\n  if (error) throw error;\n  if (result.root === 'Hello xml2js!') {\n    console.log('ok');\n  }\n});\n"
  },
  {
    "path": "test/test-79-npm/yargs/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/yargs/yargs.js",
    "content": "'use strict';\n\nvar yargs = require('yargs');\nvar argv = yargs.argv;\nif (argv.$0) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/zeromq/package.json",
    "content": "{\n  \"private\": true\n}\n"
  },
  {
    "path": "test/test-79-npm/zeromq/zeromq.js",
    "content": "'use strict';\n\nvar zeromq = require('zeromq');\nif (zeromq.version) {\n  console.log('ok');\n}\n"
  },
  {
    "path": "test/test-79-npm/zeromq/zeromq.meta.js",
    "content": "'use strict';\n\nconst home = require('../home.js');\n\nmodule.exports = function (stamp) {\n  return {\n    allow: home(stamp),\n    deployFilesFrom: ['zeromq'],\n  };\n};\n"
  },
  {
    "path": "test/test-80-compression/.gitignore",
    "content": "output-*\n"
  },
  {
    "path": "test/test-80-compression/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\n/* eslint-disable no-unused-vars */\nconst input = 'test-x.js';\nconst target = 'host';\nconst ext = process.platform === 'win32' ? '.exe' : '';\nconst outputRef = 'output-empty' + ext;\nconst outputNone = 'output-None' + ext;\nconst outputGZip = 'output-Brotli' + ext;\nconst outputBrotli = 'output-GZip' + ext;\nconst outputBrotliDebug = 'output-debug' + ext;\n\nconst inspect = ['ignore', 'ignore', 'pipe'];\n\nconsole.log(' compiling empty ');\nconst logPkg0 = utils.pkg.sync(\n  [\n    '--target',\n    target,\n    '--compress',\n    'None',\n    '--output',\n    outputRef,\n    './test-empty.js',\n  ],\n  { expect: 0 }\n);\nconst sizeReference = fs.statSync(outputRef).size;\n\nfunction pkgCompress(compressMode, output) {\n  console.log(` compiling compression ${compressMode} `);\n  const logPkg1 = utils.pkg.sync(\n    ['--target', target, '--compress', compressMode, '--output', output, input],\n    { stdio: inspect, expect: 0 }\n  );\n  // check that produced executable is running and produce the expected output.\n  const log = utils.spawn.sync(path.join(__dirname, output), [], {\n    cwd: __dirname,\n    expect: 0,\n  });\n  assert(log === '42\\n');\n  return fs.statSync(output).size;\n}\n\nconst sizeNoneFull = pkgCompress('None', outputNone);\nconst sizeGZipFull = pkgCompress('GZip', outputGZip);\nconst sizeBrotliFull = pkgCompress('Brotli', outputBrotli);\n\nconst sizeNone = sizeNoneFull - sizeReference;\nconst sizeBrotli = sizeBrotliFull - sizeReference;\nconst sizeGZip = sizeGZipFull - sizeReference;\n\nconsole.log(' compiling compression Brotli + debug');\nconst logPkg4 = utils.pkg.sync(\n  [\n    '--target',\n    target,\n    '--debug',\n    '--compress',\n    'Brotli',\n    '--output',\n    outputBrotliDebug,\n    input,\n  ],\n  { expect: 0 }\n);\n\nconsole.log('node.exe size  =', sizeReference);\nconsole.log('virtual file system');\nconsole.log('No compression =  ', sizeNone - sizeReference);\nconsole.log(\n  '        Δ GZip = ',\n  sizeGZip - sizeNone,\n  '(',\n  (((sizeGZip - sizeNone) / sizeNone) * 100).toFixed(0),\n  '%)'\n);\nconsole.log(\n  '      Δ Brotli = ',\n  sizeBrotli - sizeNone,\n  '(',\n  (((sizeBrotli - sizeNone) / sizeNone) * 100).toFixed(0),\n  '%)'\n);\n\nassert(sizeNone > sizeGZip);\nassert(sizeGZip > sizeBrotli);\n\nconst logPkg5 = utils.pkg.sync(\n  ['--target', target, '--compress', 'Crap', '--output', outputBrotli, input],\n  { expect: 2 }\n);\n\n// xx console.log(logPkg4);\nassert(logPkg5.match(/Invalid compression algorithm/g));\n\nutils.vacuum.sync(outputRef);\nutils.vacuum.sync(outputNone);\nutils.vacuum.sync(outputBrotli);\nutils.vacuum.sync(outputGZip);\nutils.vacuum.sync(outputBrotliDebug);\n"
  },
  {
    "path": "test/test-80-compression/test-empty.js",
    "content": "/** empty */\n"
  },
  {
    "path": "test/test-80-compression/test-x.js",
    "content": "'use strict';\n\n/* eslint-disable no-unused-vars */\n\nconst m = require('minimist');\nconst c = require('chalk');\n\nconst loremIpsum =\n  'Unus audio pluribus sibi quibusdam amicitias habere qua satis molestum sapientes molestum est vel frui non pluribus nimias possit quam esse sollicitum adducas persequantur esse audio nihil sollicitum laxissimas enim rerum vel non ad tamquam habitos implicari placuisse quibusdam nihil.';\nconst loremIpsum2 =\n  'Semper praetorio satisfaceret semper sit militem ut ipse ordinarias ad atque sit ire in ad sit ut more trusus dignitates more compellebatur ultimum praefectus discrimen et in ut tempestate et dignitates impedita convectio in est inopia ad alioqui et ob.';\n\nconsole.log(42 || loremIpsum2 || loremIpsum2);\n"
  },
  {
    "path": "test/test-80-compression-node-opcua/.gitignore",
    "content": "node_modules\n\n"
  },
  {
    "path": "test/test-80-compression-node-opcua/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\n/*\n * A test with a large number of modules with symlinks\n * (installed with npm) and compress\n *\n */\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nif (utils.shouldSkipPnpm()) {\n  return;\n}\n\n// remove any possible left-over\nutils.vacuum.sync('./node_modules');\nutils.vacuum.sync('./pnpm-lock.yaml');\n\n// launch `pnpm install`\nconst pnpmlog = utils.spawn.sync(\n  path.join(\n    path.dirname(process.argv[0]),\n    'npx' + (process.platform === 'win32' ? '.cmd' : '')\n  ),\n  ['pnpm', 'install'],\n  { cwd: path.dirname(__filename), expect: 0 }\n);\nconsole.log('pnpm log :', pnpmlog);\n\n// verify that we have the .pnpm folder and a symlinks module in node_modules\nassert(fs.lstatSync(path.join(__dirname, 'node_modules/.pnpm')).isDirectory());\nassert(\n  fs\n    .lstatSync(path.join(__dirname, 'node_modules/node-opcua-address-space'))\n    .isSymbolicLink()\n);\n\n/* eslint-disable no-unused-vars */\nconst input = 'package.json';\nconst target = process.argv[2] || 'host';\nconst ext = process.platform === 'win32' ? '.exe' : '';\nconst outputRef = 'test-output-empty' + ext;\nconst outputNone = 'test-output-None' + ext;\nconst outputGZip = 'test-output-GZip' + ext;\nconst outputBrotli = 'test-output-Brotli' + ext;\nconst outputBrotliDebug = 'test-output-Brotli-debug' + ext;\n\nconst inspect = ['ignore', 'ignore', 'pipe'];\n\nconsole.log(' compiling  empty ');\nconst logPkg0 = utils.pkg.sync(\n  [\n    '--target',\n    target,\n    '--compress',\n    'None',\n    '--output',\n    outputRef,\n    './test-empty.js',\n  ],\n  { stdio: inspect, expect: 0 }\n);\nconst sizeReference = fs.statSync(outputRef).size;\n\nfunction pkgCompress(compressMode, output) {\n  console.log(` compiling compression ${compressMode} `);\n  const logPkg1 = utils.pkg.sync(\n    ['--target', target, '--compress', compressMode, '--output', output, input],\n    { stdio: inspect, expect: 0 }\n  );\n  // check that produced executable is running and produce the expected output.\n  const log = utils.spawn.sync(path.join(__dirname, output), [], {\n    cwd: __dirname,\n    expect: 0,\n  });\n  assert(log === '42\\n');\n  return fs.statSync(output).size;\n}\n\nconst sizeNoneFull = pkgCompress('None', outputNone);\nconst sizeGZipFull = pkgCompress('GZip', outputGZip);\nconst sizeBrotliFull = pkgCompress('Brotli', outputBrotli);\n\nconst sizeNone = sizeNoneFull - sizeReference;\nconst sizeBrotli = sizeBrotliFull - sizeReference;\nconst sizeGZip = sizeGZipFull - sizeReference;\n\nconsole.log('empty           = ', sizeReference);\nconsole.log('no compression  = ', sizeNoneFull, sizeNone);\nconsole.log('Brotli          = ', sizeBrotliFull, sizeBrotli);\nconsole.log('GZip            = ', sizeGZipFull, sizeGZip);\n\nconsole.log(\n  '        Δ GZip = ',\n  sizeGZip - sizeNone,\n  '(',\n  (((sizeGZip - sizeNone) / sizeNone) * 100).toFixed(0),\n  '%)'\n);\nconsole.log(\n  '      Δ Brotli = ',\n  sizeBrotli - sizeNone,\n  '(',\n  (((sizeBrotli - sizeNone) / sizeNone) * 100).toFixed(0),\n  '%)'\n);\n\nassert(sizeNone > sizeGZip);\nassert(sizeGZip > sizeBrotli);\n\nconst logPkg5 = utils.pkg.sync(\n  ['--target', target, '--compress', 'Crap', '--output', outputBrotli, input],\n  { expect: 2 }\n);\n\n// xx console.log(logPkg4);\nassert(logPkg5.match(/Invalid compression algorithm/g));\n\nutils.vacuum.sync(outputRef);\nutils.vacuum.sync(outputNone);\nutils.vacuum.sync(outputBrotli);\nutils.vacuum.sync(outputGZip);\nutils.vacuum.sync(outputBrotliDebug);\nutils.vacuum.sync('node_modules');\nutils.vacuum.sync('./pnpm-lock.yaml');\n\nconsole.log('OK');\n"
  },
  {
    "path": "test/test-80-compression-node-opcua/package.json",
    "content": "{\n  \"name\": \"test-12-compression\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"test-x.js\",\n  \"scripts\": {\n    \"preinstall\": \"npx only-allow pnpm\",\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"node-opcua-address-space\": \"^2.36.0\",\n    \"node-opcua-crypto\": \"^1.7.1\",\n    \"node-opcua-nodesets\": \"^2.36.0\"\n  },\n  \"bin\": \"test-x.js\",\n  \"pkg\": {\n    \"assets\": [\n      \"./node_modules/node-opcua-nodesets/nodesets/*.xml\"\n    ]\n  }\n}\n"
  },
  {
    "path": "test/test-80-compression-node-opcua/test-empty.js",
    "content": "/***/\n"
  },
  {
    "path": "test/test-80-compression-node-opcua/test-x.js",
    "content": "'use strict';\n\nconst { AddressSpace } = require('node-opcua-address-space');\n\nconst { generateAddressSpace } = require('node-opcua-address-space/nodeJS');\nconst { nodesets } = require('node-opcua-nodesets');\n\n(async () => {\n  const addressSpace = AddressSpace.create({});\n  await generateAddressSpace(addressSpace, [nodesets.standard]);\n  console.log('42');\n})();\n"
  },
  {
    "path": "test/test-80-compression-node-opcua/test-y.js",
    "content": "'use strict';\n\nconst fs = require('fs');\nconst { nodesets } = require('node-opcua-nodesets');\nconst a = fs.readFileSync(nodesets.adi);\nconsole.log(a.length);\n"
  },
  {
    "path": "test/test-80-compression-various-file-access/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\n/* eslint-disable no-unused-vars */\nconst target = process.argv[2] || 'host';\nconst ext = process.platform === 'win32' ? '.exe' : '';\nconst output = 'output' + ext;\n\nasync function runTest(input) {\n  const output_none = output + '_' + path.parse(input).name;\n  const output_gzip = 'gzip_' + output_none;\n\n  const logPkgNone = utils.pkg.sync(\n    ['--target', target, '--compress', 'None', '--output', output_none, input],\n    { expect: 0 }\n  );\n  const logPkgGZip = utils.pkg.sync(\n    ['--target', target, '--compress', 'GZIP', '--output', output_gzip, input],\n    { expect: 0 }\n  );\n\n  // -----------------------------------------------------------------------\n  // Execute program outside pjg\n  const logRef = utils.spawn.sync('node', [path.join(__dirname, input)], {\n    cwd: __dirname,\n    expect: 0,\n  });\n\n  const logNone = utils.spawn.sync(path.join(__dirname, output_none), [], {\n    cwd: __dirname,\n    expect: 0,\n  });\n\n  const logGZip = utils.spawn.sync(path.join(__dirname, output_gzip), [], {\n    cwd: __dirname,\n    expect: 0,\n  });\n\n  if (logRef !== logNone) {\n    console.log(\n      \" uncompress pkg doesn't produce same result as running with node\"\n    );\n  }\n  if (logRef !== logGZip) {\n    console.log(\n      \" GZIP compress pkg doesn't produce same result as running with node\"\n    );\n  }\n\n  if (logRef !== logNone || logRef !== logGZip) {\n    console.log(' Reference:');\n    console.log(logRef);\n    console.log(' Uncompress:');\n    console.log(logNone);\n    console.log(' GZIPed:');\n    console.log(logGZip);\n\n    console.log('------------ ERROR');\n    process.exit(1000);\n  }\n  utils.vacuum.sync(output);\n  utils.vacuum.sync('gzip_' + output);\n}\n\nconst input1 = 'test.js';\n\nconsole.log('  now testing with fs callback');\nrunTest(input1);\n\nconsole.log('  now testing with fs.promises');\nconst input2 = 'test_with_new_fs_promises.js';\nrunTest(input2);\n\nconsole.log('Done');\nprocess.exit(0);\n"
  },
  {
    "path": "test/test-80-compression-various-file-access/myfile.txt",
    "content": "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  },
  {
    "path": "test/test-80-compression-various-file-access/package.json",
    "content": "{\n  \"name\": \"test-12-compression-with-asset\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\"\n}\n"
  },
  {
    "path": "test/test-80-compression-various-file-access/test.js",
    "content": "'use strict';\n\nconst path = require('path');\nconst fs = require('fs');\n\nconst file = path.join(__dirname, 'myfile.txt');\nconst binaryFile = path.join(__dirname, 'myfile.bin');\n\nfunction withReadFileSync() {\n  const wholeFile = fs.readFileSync(file, 'ascii');\n  console.log(wholeFile);\n  console.log('withReadFileSync done !');\n}\n\nasync function withDirectAccess() {\n  try {\n    const buffer = Buffer.alloc(1000);\n    const fd = fs.openSync(file);\n    fs.readSync(fd, buffer, 0, buffer.length, 10);\n    fs.closeSync(fd);\n    console.log(buffer.toString('ascii'));\n  } catch (err) {\n    console.log(err.message);\n    console.log(err);\n  }\n  console.log('withDirectAccess ! done!');\n}\n\nasync function withReadStream() {\n  const stream = fs.createReadStream(\n    file /* { start: 10, encoding: \"ascii\" } */\n  );\n  stream.on('data', (data) => {\n    console.log(data.toString());\n  });\n  await new Promise((resolve) => {\n    stream.on('end', resolve);\n  });\n  console.log('withReadStream done !');\n}\nasync function withReadStream2() {\n  const stream = fs.createReadStream(file, { start: 10, encoding: 'ascii' });\n  stream.on('data', (data) => {\n    console.log(data.toString());\n  });\n  await new Promise((resolve) => {\n    stream.on('end', resolve);\n  });\n  console.log('withReadStream done !');\n}\n\nasync function readbinaryFile() {\n  const fd = fs.openSync(binaryFile, 'r');\n\n  const buf = Buffer.alloc(25);\n  fs.readSync(fd, buf, 0, buf.length, 10);\n  fs.closeSync(fd);\n\n  console.log(buf.toString('hex'));\n  console.log('readbinaryFile done !');\n}\n\nasync function readbinaryFileWithStream() {\n  const stream = fs.createReadStream(binaryFile, {\n    encoding: 'hex',\n    start: 10,\n    end: 34,\n  });\n  stream.on('data', (data) => {\n    console.log(data.toString());\n  });\n  await new Promise((resolve) => {\n    stream.on('end', resolve);\n  });\n  console.log('readbinaryFileWithStream done !');\n}\n(async () => {\n  console.log('--------------- withReadFileSync');\n  await withReadFileSync();\n  console.log('--------------- withReadStream');\n  await withReadStream();\n  console.log('--------------- withDirectAccess');\n  await withDirectAccess();\n  console.log('--------------- withReadStream2');\n  await withReadStream2();\n  console.log('--------------- readbinaryFile');\n  await readbinaryFile();\n  console.log('--------------- readbinaryFileWithStream');\n  await readbinaryFileWithStream();\n})();\n"
  },
  {
    "path": "test/test-80-compression-various-file-access/test_with_new_fs_promises.js",
    "content": "'use strict';\n\nconst path = require('path');\n\nlet fs_promises;\nconst MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10);\n\nif (MAJOR_VERSION >= 14) {\n  // only work with nodeJs >= 14.0\n  fs_promises = require('fs/promises');\n} else {\n  fs_promises = require('fs').promises;\n}\n\n// note: this file will be packed in the virtual file system by PKG\nconst file = path.join(__dirname, 'myfile.txt');\n\nasync function withPromises() {\n  // note : the fs.promise API is quite changing between node12/node14 etc...\n  let fd;\n  try {\n    fd = await fs_promises.open(file, 'r');\n    // Do something with the file\n    const buffer = Buffer.alloc(1000);\n\n    if (MAJOR_VERSION >= 14) {\n      const { bytesRead } = await fd.read(buffer, 0, buffer.length, 10);\n      if (process.env.DEBUG) {\n        console.log('bytesRead = ', bytesRead);\n      }\n    } else {\n      await fd.read(buffer, 0, buffer.length, 10);\n    }\n    console.log(buffer.toString());\n  } catch (err) {\n    console.log('ERRR =', err.message);\n    console.log(err);\n  } finally {\n    if (fd) {\n      await fd.close();\n    }\n  }\n  console.log('withPromises ! done!');\n}\n\nasync function withPromisesReadFile() {\n  try {\n    const content = await fs_promises.readFile(file, { encoding: 'ascii' });\n    console.log(content);\n  } catch (err) {\n    console.log('ERRR =', err.message);\n    console.log(err);\n  }\n  console.log('withPromisesReadFile ! done!');\n}\n\nasync function withPromiseReadDir() {\n  const thisFile = path.basename(__filename);\n  try {\n    const folder = path.join(__dirname, '/');\n    const files = await fs_promises.readdir(folder);\n    console.log(\n      files.findIndex((x) => x === thisFile) >= 0 ? 'Success' : 'Failure'\n    );\n  } catch (err) {\n    console.log(err.message);\n  }\n  console.log('withPromiseReadDir ! done!');\n}\n(async () => {\n  await withPromises();\n  await withPromisesReadFile();\n  await withPromiseReadDir();\n  console.log(42);\n})();\n"
  },
  {
    "path": "test/test-99-#1120-mkdir-mountpoints/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet right;\nutils.mkdirp.sync(path.dirname(output));\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, 'hello.txt\\n');\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-99-#1120-mkdir-mountpoints/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nvar myDirectory = path.dirname(process.execPath);\n\nprocess.pkg.mount(\n  path.join(__dirname, 'plugins-D-ext'),\n  path.join(myDirectory, 'plugins-D-ext')\n);\n\nfs.mkdirSync('./plugins-D-ext/');\nfs.writeFileSync('./plugins-D-ext/hello.txt', 'hello world!');\n\nconsole.log(\n  fs.readdirSync(path.join(__dirname, './plugins-D-ext/')).join('\\n')\n);\n"
  },
  {
    "path": "test/test-99-#1121-regexp-mountpoints/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './test-x-index.js';\nconst output = './run-time/test-output.exe';\n\nlet right;\nutils.mkdirp.sync(path.dirname(output));\nutils.mkdirp.sync(path.join(path.dirname(output), 'plugins-D-ext'));\n\nfs.writeFileSync(\n  path.join(path.dirname(output), 'plugins-D-ext/test-y-require-D.js'),\n  fs.readFileSync('./plugins-D-ext/test-y-require-D.js')\n);\n\nutils.pkg.sync(['--target', target, '--output', output, input]);\n\nright = utils.spawn.sync('./' + path.basename(output), [], {\n  cwd: path.dirname(output),\n});\n\nassert.strictEqual(right, 'I am D\\ntest-x-index.js\\n');\n\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-99-#1121-regexp-mountpoints/plugins-D-ext/test-y-require-D.js",
    "content": "'use strict';\n\nvar assert = require('assert');\n\nif (__dirname.indexOf('snapshot') < 0) {\n  console.log(__dirname);\n  assert(false);\n}\n\nconsole.log('I am D');\n"
  },
  {
    "path": "test/test-99-#1121-regexp-mountpoints/test-x-index.js",
    "content": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\n\nvar myDirectory = path.dirname(process.execPath);\n\nprocess.pkg.mount(\n  /^(.*)regexp_mountpoint_test(.*)$/,\n  function (match, group1, group2) {\n    return path.join(myDirectory, 'plugins-D-ext', group2);\n  }\n);\n\nrequire('./regexp_mountpoint_test/test-y-require-D.js'.slice());\n\nconsole.log(fs.readdirSync(__dirname).join('\\n'));\n"
  },
  {
    "path": "test/test-99-#1130/.gitignore",
    "content": "run-time"
  },
  {
    "path": "test/test-99-#1130/files/a.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "test/test-99-#1130/files/b.js",
    "content": "'use strict';\n\nmodule.exports = {};\n"
  },
  {
    "path": "test/test-99-#1130/main.js",
    "content": "#!/usr/bin/env node\n\n// Thanks to @roberttod\n// https://github.com/vercel/pkg/blob/59b1afdb39613777150c17f77b45595864ba072e/test/test-1103-readdirsync-withfiletypes/main.js\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './read.js';\nconst output = './run-time/test-output.exe';\n\nutils.mkdirp.sync(path.dirname(output));\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nlet left, right;\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nright = utils.spawn.sync(output, [], {\n  cwd: path.dirname(input),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-99-#1130/package.json",
    "content": "{\n  \"bin\": \"read.js\",\n  \"pkg\": {\n    \"scripts\": \"files/*.js\"\n  }\n}\n"
  },
  {
    "path": "test/test-99-#1130/read.js",
    "content": "'use strict';\n\n// Thanks to @roberttod\n// https://github.com/vercel/pkg/blob/59b1afdb39613777150c17f77b45595864ba072e/test/test-1103-readdirsync-withfiletypes/read.js\n\nconst fs = require('fs');\nconst path = require('path');\n\nconsole.log('Starting sync read');\n\nconsole.log(\n  serializeFiles(\n    fs.readdirSync(path.join(__dirname, 'files'), { withFileTypes: true })\n  )\n);\n\nconsole.log('Finishing sync read');\n\nconsole.log('Starting async read');\n\nfs.readdir(\n  path.join(__dirname, 'files'),\n  { withFileTypes: true },\n  (_err, files) => {\n    console.log(serializeFiles(files));\n    console.log('Finishing async read');\n  }\n);\n\nfunction serializeFiles(files) {\n  return files.map((file) => `name: ${file.name}, isFile: ${file.isFile()}`);\n}\n"
  },
  {
    "path": "test/test-99-#1135/.gitignore",
    "content": "package-lock.json\nnode_modules\n"
  },
  {
    "path": "test/test-99-#1135/index.js",
    "content": "'use strict';\n\n/* eslint-disable no-unused-vars */\nvar canvas = require('canvas');\nconsole.log('42');\n"
  },
  {
    "path": "test/test-99-#1135/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(__dirname === process.cwd());\n\n/* only run on host */\nif (process.argv[2] && process.argv[2] !== 'host') {\n  console.log('skipped test');\n  return;\n}\nconst target = /* process.argv[2] || */ 'host';\nconst input = './package.json';\nconst output = path.join(\n  __dirname,\n  './test-output' + (process.platform === 'win32' ? '.exe' : '')\n);\n\nconsole.log('target = ', target);\n\n// remove any possible left-over\nutils.vacuum.sync('./node_modules');\n\nconst version = utils.exec.sync('node --version');\nconsole.log('node version = ', version);\n\n// launch `npm install`\nconst npmlog = utils.exec.sync('npm install');\nconsole.log('npm log :', npmlog);\n\nassert(fs.lstatSync(path.join(__dirname, 'node_modules/canvas')).isDirectory());\nassert(\n  fs.lstatSync(path.join(__dirname, 'node_modules/canvas/build')).isDirectory()\n);\nassert(\n  fs\n    .lstatSync(path.join(__dirname, 'node_modules/canvas/build/Release'))\n    .isDirectory()\n);\nassert(\n  fs\n    .lstatSync(\n      path.join(__dirname, 'node_modules/canvas/build/Release/canvas.node')\n    )\n    .isFile()\n);\n\nutils.pkg.sync(['--target', target, '--debug', '--output', output, input]);\n\n// check that produced executable is running and produce the expected output.\nconst log = utils.spawn.sync(output, [], {\n  cwd: path.dirname(output),\n  expect: 0,\n});\nconsole.log(log);\n// assert(log === '42\\n');\n\n// clean up\nutils.vacuum.sync(output);\nutils.vacuum.sync('./node_modules');\nutils.vacuum.sync('./package-lock.json');\n\nconsole.log('OK');\n"
  },
  {
    "path": "test/test-99-#1135/package.json",
    "content": "{\n  \"name\": \"pkg_issue_1135\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"bin\": \"./index.js\",\n  \"scripts\": {\n    \"pkg\": \"npx pkg -t host package.json\"\n  },\n  \"pkg\": {\n    \"scripts\": \"index.js\",\n    \"outputPath\": \"dist\",\n    \"assets\": \"./node_modules/canvas/build/Release/*\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"canvas\": \"^2.7.0\"\n  }\n}\n"
  },
  {
    "path": "test/test-99-#1191/.gitignore",
    "content": "output*\ntest.sqlite\npackage-lock*\n"
  },
  {
    "path": "test/test-99-#1191/index.js",
    "content": "'use strict';\n\nrequire('better-sqlite3')('test.sqlite');\nconsole.log('42');\n"
  },
  {
    "path": "test/test-99-#1191/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\n/* eslint-disable no-unused-vars */\nconst target = process.argv[2] || 'host';\n\nif (target !== 'host') {\n  console.log('skipping test, as target=', target);\n  // skipping test, this test would require recompiling for a different node version\n  return;\n}\n\nconst ext = process.platform === 'win32' ? '.exe' : '';\nconst output1 = './output1' + ext;\nconst output2 = './output2' + ext;\nconst input = './index.js';\n\n// remove any possible left-over\nutils.vacuum.sync('./node_modules');\n\nconst version = utils.exec.sync('node --version');\nconsole.log('node version = ', version);\n\n// launch `yarn`\nconst yarnlog = utils.exec.sync('yarn');\nconsole.log('yarn log :', yarnlog);\n\n// -----------------------------------------------------------------------\n// Execute programm outside pjg\nconst logRef = utils.spawn.sync('node', [path.join(__dirname, input)], {\n  cwd: __dirname,\n  expect: 0,\n});\n\nif (logRef.replace(/\\r|\\n/g, '') !== '42') {\n  console.log(`expecting 42 but got ${logRef}`);\n  process.exit(1);\n}\n\nfunction doTestWithCompression() {\n  console.log('doTestWithCompression');\n  utils.pkg.sync(\n    ['--compress', 'Brotli', '--target', target, '--output', output1, input],\n    {\n      //   expect: 0,\n    }\n  );\n  const log = utils.spawn.sync(path.join(__dirname, output1), [], {\n    cwd: __dirname,\n    // expect: 0,\n    stdio: ['inherit', 'pipe', 'pipe'],\n  });\n  return log;\n}\nfunction doTestNoCompression() {\n  console.log('doTestNoCompression');\n  utils.pkg.sync(['--target', target, '--output', output2, input], {\n    //  expect: 0,\n  });\n  const log = utils.spawn.sync(path.join(__dirname, output2), [], {\n    cwd: __dirname,\n    expect: 0,\n    stdio: ['inherit', 'pipe', 'pipe'],\n  });\n  return log;\n}\nconst logNoCompression = doTestNoCompression();\nif (logNoCompression.stderr !== '') {\n  console.log('NO COMPRESSION: expecting no error');\n  console.log('but got =', logNoCompression.stderr);\n  process.exit(1);\n}\n\nconst logWithCompression = doTestWithCompression();\nif (logWithCompression.stderr !== '') {\n  console.log('NO COMPRESSION: expecting no error');\n  console.log('but got =', logWithCompression.stderr);\n  process.exit(1);\n}\n\n// now with compress\n\nutils.vacuum.sync(output1);\nutils.vacuum.sync(output2);\nutils.vacuum.sync('node_modules');\nutils.vacuum.sync('package-lock.json');\nutils.vacuum.sync('test.sqlite');\nconsole.log('Done');\n"
  },
  {
    "path": "test/test-99-#1191/package.json",
    "content": "{\n  \"name\": \"test-1191\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"better-sqlite3\": \"^7.4.0\"\n  }\n}\n"
  },
  {
    "path": "test/test-99-#1192/.gitignore",
    "content": "dist/\n"
  },
  {
    "path": "test/test-99-#1192/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\n/* eslint-disable no-unused-vars */\nconst target = process.argv[2] || 'host';\n\nif (target !== 'host') {\n  console.log('skipping test, as target=', target);\n  // skipping test, this test would require recompiling for a different node version\n  return;\n}\n\nconst doDebug = false;\n\nconst ext = process.platform === 'win32' ? '.exe' : '';\nconst output = './output' + ext;\nconst input = './package.json';\n\n// remove any possible left-over\n// utils.vacuum.sync('./node_modules');\n\nconst version = utils.exec.sync('node --version');\nif (doDebug) {\n  console.log('node version = ', version);\n}\n\n// launch `yarn`\nconst yarnlog = utils.exec.sync('yarn');\nif (doDebug) {\n  console.log('yarn log :', yarnlog);\n}\n\n// -----------------------------------------------------------------------\n// Execute program outside pjg\nconst logRef = utils.spawn.sync(\n  'node',\n  [path.join(__dirname, 'src/index.js')],\n  {\n    cwd: __dirname,\n    expect: 0,\n    stdio: ['inherit', 'pipe', 'pipe'],\n  }\n);\n\nfunction runTest(doCompress) {\n  const options = [\n    '--target',\n    target,\n    '--output',\n    output,\n    input,\n    ...doCompress,\n  ];\n\n  utils.pkg.sync(options, {\n    expect: 0,\n  });\n\n  const log = utils.spawn.sync(path.join(__dirname, output), [], {\n    cwd: __dirname,\n    expect: 0,\n    stdio: ['inherit', 'pipe', 'pipe'],\n  });\n\n  if (doDebug) {\n    console.log(logRef.stdout);\n  }\n\n  if (logRef.stdout !== log.stdout) {\n    console.log('expecting', logRef.stdout);\n    console.log('but got =', log.stdout);\n    process.exit(1);\n  }\n  if (logRef.stderr !== log.stderr) {\n    console.log('expecting', logRef.stderr);\n    console.log('but got =', log.stderr);\n    process.exit(1);\n  }\n}\n\nrunTest([]);\nrunTest(['--compress', 'GZip']);\nrunTest(['--compress', 'Brotli']);\n\nutils.vacuum.sync(output);\n// utils.vacuum.sync('node_modules');\nutils.vacuum.sync('package-lock.json');\nconsole.log('Done');\n"
  },
  {
    "path": "test/test-99-#1192/package.json",
    "content": "{\n  \"name\": \"pkg-express\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Illustrates issue between pkg 5.2.X and express (works with with pkg pre 5.2.X).\",\n  \"repository\": \"\",\n  \"main\": \"src/index.js\",\n  \"bin\": \"src/index.js\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"postinstall\": \"npm run make\",\n    \"start\": \"node .\",\n    \"make\": \"pkg . -o ./dist/pkg-express.exe\"\n  },\n  \"dependencies\": {\n    \"express\": \"^4.17.1\",\n    \"pug\": \"^3.0.2\"\n  },\n  \"devDependencies\": {\n    \"pkg\": \"5.2.1\"\n  },\n  \"pkg\": {\n    \"assets\": \"./public/views/*.pug\"\n  }\n}\n"
  },
  {
    "path": "test/test-99-#1192/public/views/index.pug",
    "content": "  \nhtml\n  head\n    title Hello World!\n  body\n    p Hello World!\n    p äöüß m² and ☺\n    p 🤡🤩🦄\n\n    "
  },
  {
    "path": "test/test-99-#1192/src/index.js",
    "content": "'use strict';\n\nconst http = require('http');\nconst path = require('path');\nconst express = require('express');\n\n// Express app\nconst app = express();\n// Express views\napp.set('views', path.join(__dirname, '../public/views'));\n// Use pug as Express view engine\napp.set('view engine', 'pug');\n// Match all routes\napp.use('*', (_req, res) => {\n  res.render('index.pug');\n});\n\n// Start HTTP server\nconst listener = http.createServer(app).listen(8080, () => {\n  console.info('Server started, listening on %d', listener.address().port);\n});\n\n// ------------------ now query he server\n(async () => {\n  const options = {\n    hostname: '127.0.0.1',\n    path: '/',\n    method: 'GET',\n    port: 8080,\n  };\n\n  const req = http.request(options, (res) => {\n    console.log(`statusCode: ${res.statusCode}`);\n    res.on('data', (d) => {\n      process.stdout.write(d);\n    });\n  });\n\n  req.on('error', (error) => {\n    console.error(error);\n    process.exit(1);\n  });\n  req.on('close', () => {\n    process.exit(0);\n  });\n  req.end();\n})();\n"
  },
  {
    "path": "test/test-99-#1207/.gitignore",
    "content": "*.exe\n"
  },
  {
    "path": "test/test-99-#1207/index.js",
    "content": "'use strict';\n\nconsole.log(process.env.DEBUG_PKG || 42);\n"
  },
  {
    "path": "test/test-99-#1207/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\nconst path = require('path');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nif (process.platform !== 'win32') {\n  console.log('Skipping this test on non windows platform');\n  return 0;\n}\n\nconst input = 'H:\\\\index.js';\nconst output = 'H:\\\\index.exe';\n\n// mount a H drive\nconst thisFolder = __dirname;\ntry {\n  utils.exec.sync(`subst H: /D`);\n} catch (err) {\n  /* */\n}\nutils.exec.sync(`subst H: ${thisFolder}`);\n\n// build from the alternate drive\nutils.pkg.sync(['--debug', '--target', 'host', '--output', output, input], {\n  cwd: 'H:\\\\',\n  // stdio: 'inherit'\n});\n\n// check that produced executable is running and produce the expected output.\n// when run tom the same file it has been built on.\nconst log = utils.spawn.sync(output, [], {\n  cwd: path.dirname(output),\n  expect: 0,\n});\nassert(log === '42\\n');\n\n// check that produced executable is running and produce the expected output.\nconst logRef = utils.spawn.sync(output, [], {\n  cwd: path.dirname(output),\n  env: { DEBUG_PKG: 42 },\n  expect: 0,\n});\nif (!logRef.match(/42\\n$/m)) {\n  console.log(logRef);\n  process.exit(1);\n}\n// running on C while H: drive is here\nconst alternateOutput = path.resolve('.\\\\index.exe');\nconsole.log('alternateOutput', alternateOutput);\n\nconst log1 = utils.spawn.sync(alternateOutput, [], {\n  cwd: path.dirname(alternateOutput),\n  env: { DEBUG_PKG: 42 },\n  expect: 0,\n});\nassert(log1 === logRef);\n\n// running on C while H: drive is not here anymore\nutils.exec.sync(`subst H: /D`);\nconst log2 = utils.spawn.sync(alternateOutput, [], {\n  cwd: path.dirname(alternateOutput),\n  env: { DEBUG_PKG: 42 },\n  expect: 0,\n});\nassert(log2 === logRef);\n\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-99-#1505/.gitignore",
    "content": "run-time\n"
  },
  {
    "path": "test/test-99-#1505/files/test.txt",
    "content": ""
  },
  {
    "path": "test/test-99-#1505/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './stat.js';\nconst output = './run-time/test-output.exe';\n\nutils.mkdirp.sync(path.dirname(output));\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nlet left, right;\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nright = utils.spawn.sync(output, [], {\n  cwd: path.dirname(input),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-99-#1505/package.json",
    "content": "{\n  \"bin\": \"stat.js\",\n  \"pkg\": {\n    \"scripts\": \"files/*\"\n  }\n}\n"
  },
  {
    "path": "test/test-99-#1505/stat.js",
    "content": "'use strict';\n\nconst path = require('path');\nconst util = require('util');\nconst fs = require('fs');\nlet fsp;\n\ntry {\n  fsp = require('fs/promises');\n} catch (_) {\n  fsp = require('fs').promises;\n}\n\nconst filePath = path.join(__dirname, 'files/test.txt');\n\nasync function test() {\n  for (const key of ['stat', 'lstat']) {\n    console.log(key, 'callback');\n    const promisified = util.promisify(fs[key]);\n    console.log(serialize(await promisified(filePath)));\n\n    console.log(key, 'promise');\n    console.log(serialize(await fsp[key](filePath)));\n  }\n}\n\nfunction serialize(result) {\n  if (!result) return null;\n  return `${result.size} ${result.mode}`;\n}\n\ntest();\n"
  },
  {
    "path": "test/test-99-#1861/index.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst { spawn } = require('child_process');\n\nconst { argv } = process;\n\nif (argv.length <= 2) {\n  console.log('stop');\n  process.exit();\n}\n\nconsole.log('launch');\n\nconst cp = spawn('cmd.exe', ['/C', 'launch.bat'], { shell: true });\ncp.stdout.on('data', (output) => console.log(output.toString()));\ncp.on('close', process.exit);\n"
  },
  {
    "path": "test/test-99-#1861/launch.bat",
    "content": "@echo off\nindex.exe\nexit"
  },
  {
    "path": "test/test-99-#1861/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst assert = require('assert');\nconst utils = require('../utils.js');\nconst path = require('path');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nif (process.platform !== 'win32') {\n  console.log('Skipping this test on non-windows platform.');\n  return 0;\n}\n\nconst input = path.join(__dirname, '/index.js');\nconst output = path.join(__dirname, '/index.exe');\n\n// build executable\nutils.pkg.sync(['--debug', '--target', 'host', '--output', output, input]);\n\nconst log = utils.spawn.sync(output, ['launch'], { expect: 0 });\n\nassert(log.includes('launch'));\nassert(log.includes('stop'));\n\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-99-#420-copy-from-snapshot/.gitignore",
    "content": "output\nsync.json\nasync.json\n"
  },
  {
    "path": "test/test-99-#420-copy-from-snapshot/copy.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\nconst testPath = path.resolve(__dirname, 'input/test.json');\nconsole.log(fs.readFileSync(testPath, 'utf8'));\n\nconst syncPath = path.resolve(process.cwd(), 'output/sync.json');\nfs.copyFileSync(testPath, syncPath);\nconsole.log(fs.readFileSync(syncPath, 'utf8'));\n\nconst asyncPath = path.resolve(process.cwd(), 'output/async.json');\nfs.copyFile(testPath, asyncPath, (err) => {\n  if (err) throw err;\n  console.log(fs.readFileSync(asyncPath, 'utf8'));\n});\n"
  },
  {
    "path": "test/test-99-#420-copy-from-snapshot/input/test.json",
    "content": "{\n  \"key\": \"value\"\n}\n"
  },
  {
    "path": "test/test-99-#420-copy-from-snapshot/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './copy.js';\nconst output = './output/test-output.exe';\n\nutils.mkdirp.sync(path.dirname(output));\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nlet left, right;\nleft = utils.spawn.sync('node', [path.basename(input)], {\n  cwd: path.dirname(input),\n});\n\nright = utils.spawn.sync(output, [], {\n  cwd: path.dirname(input),\n});\n\nassert.strictEqual(left, right);\nutils.vacuum.sync(path.dirname(output));\nutils.vacuum.sync(path.join(__dirname, '/*sync.json'));\n"
  },
  {
    "path": "test/test-99-#420-copy-from-snapshot/package.json",
    "content": "{\n  \"bin\": \"copy.js\",\n  \"pkg\": {\n    \"assets\": [\n      \"input/**/*\"\n    ]\n  }\n}\n"
  },
  {
    "path": "test/test-99-#775/a.js",
    "content": "'use strict';\n\nconsole.log('Starting a');\n\n// note : worker_threads in only valid for nodejs >= 12.0\nconst MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10);\nif (MAJOR_VERSION < 12) {\n  return;\n}\n\nconst { Worker } = require('worker_threads');\n// eslint-disable-next-line no-new\nnew Worker('./b.js');\nconsole.log('Finishing a');\n"
  },
  {
    "path": "test/test-99-#775/b.js",
    "content": "'use strict';\n\nconsole.log('Starting b');\nconsole.log('Finishing b');\n"
  },
  {
    "path": "test/test-99-#775/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\n// note : worker_threads in only valid for nodejs >=12.0\nconst MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10);\nif (MAJOR_VERSION < 12) {\n  console.log('Ignoring test ');\n  return;\n}\n\n/* eslint-disable no-unused-vars */\nconst input = 'package.json';\nconst target = 'host';\nconst ext = process.platform === 'win32' ? '.exe' : '';\nconst output = 'output' + ext;\n\nconst inspect = ['ignore', 'ignore', 'pipe'];\n\nconst logPkg1 = utils.pkg.sync(\n  ['--target', target, '--debug', '--output', output, input],\n  { expect: 0 }\n);\n\nconst log1 = utils.spawn.sync(path.join(__dirname, output), [], {\n  cwd: __dirname,\n  expect: 0,\n});\n\nassert.strictEqual(\n  log1,\n  `Starting a\nFinishing a\nStarting b\nFinishing b\n`\n);\n\nconst logPkg2 = utils.pkg.sync(\n  ['--target', target, '--debug', '--output', output, 'a.js'],\n  { expect: 0 }\n);\n\nconst log2 = utils.spawn.sync(path.join(__dirname, output), [], {\n  cwd: __dirname,\n  expect: 0,\n});\nassert.strictEqual(\n  log2,\n  `Starting a\nFinishing a\nStarting b\nFinishing b\n`\n);\nutils.vacuum.sync(output);\n"
  },
  {
    "path": "test/test-99-#775/package.json",
    "content": "{\n  \"name\": \"a\",\n  \"version\": \"0.1.0\",\n  \"description\": \"proof\",\n  \"bin\": \"a.js\",\n  \"license\": \"UNLICENSED\",\n  \"devDependencies\": {\n    \"pkg\": \"^4.4.0\"\n  },\n  \"pkg\": {\n    \"scripts\": [\n      \"a.js\",\n      \"b.js\"\n    ]\n  }\n}\n"
  },
  {
    "path": "test/test-99-#938-withfiletypes/.gitignore",
    "content": "run-time"
  },
  {
    "path": "test/test-99-#938-withfiletypes/main.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst path = require('path');\nconst assert = require('assert');\nconst utils = require('../utils.js');\n\nassert(!module.parent);\nassert(__dirname === process.cwd());\n\nconst target = process.argv[2] || 'host';\nconst input = './read.js';\nconst output = './run-time/test-output.exe';\n\nutils.mkdirp.sync(path.dirname(output));\nutils.pkg.sync(['--target', target, '--output', output, '.']);\n\nlet right;\nright = utils.spawn.sync(output, [], {\n  cwd: path.dirname(input),\n});\n\nassert.strictEqual('ok\\n', right);\nutils.vacuum.sync(path.dirname(output));\n"
  },
  {
    "path": "test/test-99-#938-withfiletypes/package.json",
    "content": "{\n  \"bin\": \"read.js\"\n}\n"
  },
  {
    "path": "test/test-99-#938-withfiletypes/read.js",
    "content": "'use strict';\n\nconst fs = require('fs');\n\nfunction isLastEntryString(files) {\n  const last = files[files.length - 1];\n  return typeof last === 'string';\n}\n\nfunction isLastEntryDirent(files) {\n  const last = files[files.length - 1];\n  return (\n    typeof last === 'object' &&\n    typeof last.name === 'string' &&\n    typeof last.type === 'number'\n  );\n}\n\n// readdir root and verify that last pushed entry (snapshot in the binary) has the expected type\n\n// expect Dirent array\nconst a = fs.readdirSync('/', { encoding: 'utf8', withFileTypes: true });\nfs.readdir('/', { encoding: 'utf8', withFileTypes: true }, (err, b) => {\n  if (err) throw err;\n  if (isLastEntryDirent(a) && isLastEntryDirent(b)) {\n    // expect string array\n    const c = fs.readdirSync('/', { encoding: 'utf8', withFileTypes: false });\n    fs.readdir('/', { encoding: 'utf8', withFileTypes: false }, (err_, d) => {\n      if (err_) throw err_;\n      if (isLastEntryString(c) && isLastEntryString(d)) {\n        console.log('ok');\n      }\n    });\n  }\n});\n"
  },
  {
    "path": "test/test.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst chalk = require('chalk');\nconst globby = require('globby');\nconst path = require('path');\nconst utils = require('./utils.js');\nconst host = 'node' + process.version.match(/^v(\\d+)/)[1];\nlet target = process.argv[2] || 'host';\nif (target === 'host') target = host;\n\n// note to developer , you can use\n//    FLAVOR=test-1191 npm test\n// if you only want to run all combination of this specific test case\n// ( the env variable FLAVOR takes precedence over the second argument passed to this main.js file)\n\nconst flavor = process.env.FLAVOR || process.argv[3] || 'all';\n\nconsole.log('');\nconsole.log('*************************************');\nconsole.log(target + ' ' + flavor);\nconsole.log('*************************************');\nconsole.log('');\n\nif (process.env.CI) {\n  if (\n    target === 'node0' ||\n    target === 'node4' ||\n    target === 'node6' ||\n    target === 'node7' ||\n    target === 'node9' ||\n    target === 'node11' ||\n    target === 'node13' ||\n    target === 'node15'\n  ) {\n    console.log(target + ' is skipped in CI!');\n    console.log('');\n    process.exit();\n  }\n}\n\nfunction joinAndForward(d) {\n  let r = path.join(__dirname, d);\n  if (process.platform === 'win32') r = r.replace(/\\\\/g, '/');\n  return r;\n}\n\nconst list = [];\n\nif (flavor.match(/^test/)) {\n  list.push(joinAndForward(`${flavor}/main.js`));\n} else if (flavor === 'only-npm') {\n  list.push(joinAndForward('test-79-npm/main.js'));\n} else {\n  list.push(joinAndForward('**/main.js'));\n  if (flavor === 'no-npm') {\n    list.push('!' + joinAndForward('test-42-fetch-all'));\n    list.push('!' + joinAndForward('test-46-multi-arch'));\n    list.push('!' + joinAndForward('test-46-multi-arch-2'));\n    list.push('!' + joinAndForward('test-79-npm'));\n  }\n}\n\nconst files = globby.sync(list);\n\nfiles.sort().some(function (file) {\n  file = path.resolve(file);\n  try {\n    utils.spawn.sync('node', [path.basename(file), target], {\n      cwd: path.dirname(file),\n      stdio: 'inherit',\n    });\n  } catch (error) {\n    console.log();\n    console.log(`> ${chalk.red('Error!')} ${error.message}`);\n    console.log(`> ${chalk.red('Error!')} ${file} FAILED (in ${target})`);\n    process.exit(2);\n  }\n  console.log(file, 'ok');\n});\n"
  },
  {
    "path": "test/utils.js",
    "content": "'use strict';\n\nconst assert = require('assert');\nconst path = require('path');\nconst mkdirp = require('mkdirp');\nconst rimraf = require('rimraf');\nconst globby = require('globby');\nconst { execSync } = require('child_process');\nconst { spawnSync } = require('child_process');\nconst { existsSync } = require('fs');\nconst stableStringify = require('json-stable-stringify');\n\nmodule.exports.mkdirp = mkdirp;\n\nmodule.exports.pause = function (seconds) {\n  spawnSync('ping', [\n    '127.0.0.1',\n    process.platform === 'win32' ? '-n' : '-c',\n    (seconds + 1).toString(),\n  ]);\n};\n\nmodule.exports.vacuum = function () {\n  throw new Error('Async vacuum not implemented');\n};\n\nmodule.exports.vacuum.sync = function (p) {\n  const limit = 5;\n  let hasError;\n  for (let i = 0; i < limit; i += 1) {\n    hasError = null;\n    try {\n      rimraf.sync(p);\n    } catch (error) {\n      hasError = error;\n    }\n    if (!hasError) break;\n    if (i < limit - 1) {\n      module.exports.pause(5);\n    }\n  }\n  if (hasError) {\n    throw hasError;\n  }\n};\n\nmodule.exports.exec = function () {\n  throw new Error('Async exec not implemented');\n};\n\nmodule.exports.exec.sync = function (command, opts) {\n  const child = execSync(command, opts);\n  return (child || '').toString();\n};\n\nmodule.exports.spawn = function () {\n  throw new Error('Async spawn not implemented');\n};\n\nmodule.exports.spawn.sync = function (command, args, opts) {\n  if (!opts) opts = {};\n  opts = Object.assign({}, opts); // change own copy\n\n  const d = opts.stdio;\n  if (!d) {\n    opts.stdio = ['pipe', 'pipe', 'inherit'];\n  } else if (typeof d === 'string') {\n    opts.stdio = [d, d, d];\n  }\n\n  let expect = opts.expect === undefined ? 0 : opts.expect;\n  delete opts.expect; // to avoid passing to spawnSync\n  const opts2 = Object.assign({}, opts); // 0.12.x mutates\n  const child = spawnSync(command, args, opts2);\n  let s = child.status;\n  // conform old node vers to https://github.com/nodejs/node/pull/11288\n  if (child.signal) s = null;\n\n  if (child.error || s !== expect) {\n    if (opts.stdio[1] === 'pipe' && child.stdout) {\n      process.stdout.write(child.stdout);\n    } else if (opts.stdio[2] === 'pipe' && child.stderr) {\n      process.stdout.write(child.stderr);\n    }\n    console.log('> ' + command + ' ' + args.join(' '));\n  }\n\n  if (child.error) {\n    throw child.error;\n  }\n  if (s !== expect) {\n    if (s === null) s = 'null';\n    if (expect === null) expect = 'null';\n    throw new Error(\n      'Status ' + s.toString() + ', expected ' + expect.toString()\n    );\n  }\n\n  if (opts.stdio[1] === 'pipe' && opts.stdio[2] === 'pipe') {\n    return {\n      stdout: child.stdout.toString(),\n      stderr: child.stderr.toString(),\n    };\n  } else if (opts.stdio[1] === 'pipe') {\n    return child.stdout.toString();\n  } else if (opts.stdio[2] === 'pipe') {\n    return child.stderr.toString();\n  } else {\n    return '';\n  }\n};\n\nmodule.exports.pkg = function () {\n  throw new Error('Async pkg not implemented');\n};\n\nconst es5path = path.resolve(__dirname, '../lib-es5/bin.js');\nconst es7path = path.resolve(__dirname, '../lib/bin.js');\n\nmodule.exports.pkg.sync = function (args, opts) {\n  args = args.slice();\n  const es5 = existsSync(es5path);\n  const binPath = es5 ? es5path : es7path;\n  args.unshift(binPath);\n  assert(es5, 'RUN BABEL FIRST!'); // args.unshift('-r', 'babel-register');\n  if (Array.isArray(opts)) opts = { stdio: opts };\n  try {\n    const ss = module.exports.spawn.sync;\n    return ss('node', args, opts);\n  } catch (error) {\n    console.log(`> ${error.message}`);\n    process.exit(2);\n  }\n};\n\nmodule.exports.stringify = function (obj, replacer, space) {\n  return stableStringify(obj, { replacer, space });\n};\n\nmodule.exports.filesBefore = function (n) {\n  for (const ni of n) {\n    module.exports.vacuum.sync(ni);\n  }\n  return globby.sync('**/*', { nodir: true }).sort();\n};\n\nmodule.exports.filesAfter = function (b, n) {\n  const a = globby.sync('**/*', { nodir: true }).sort();\n  for (const bi of b) {\n    if (a.indexOf(bi) < 0) {\n      assert(false, `${bi} disappeared!?`);\n    }\n  }\n  const d = [];\n  for (const ai of a) {\n    if (b.indexOf(ai) < 0) {\n      d.push(ai);\n    }\n  }\n  assert(d.length === n.length, JSON.stringify([d, n]));\n  for (const ni of n) {\n    assert(d.indexOf(ni) >= 0, JSON.stringify([d, n]));\n  }\n  for (const ni of n) {\n    module.exports.vacuum.sync(ni);\n  }\n};\n\nmodule.exports.shouldSkipPnpm = function () {\n  // pnpm 8 requires at least Node.js v16.14\n  const REQUIRED_MAJOR_VERSION = 16;\n  const REQUIRED_MINOR_VERSION = 14;\n\n  const MAJOR_VERSION = parseInt(process.version.match(/v([0-9]+)/)[1], 10);\n  const MINOR_VERSION = parseInt(\n    process.version.match(/v[0-9]+\\.([0-9]+)/)[1],\n    10\n  );\n\n  const isDisallowedMajor = MAJOR_VERSION < REQUIRED_MAJOR_VERSION;\n  const isDisallowedMinor =\n    MAJOR_VERSION === REQUIRED_MAJOR_VERSION &&\n    MINOR_VERSION < REQUIRED_MINOR_VERSION;\n  if (isDisallowedMajor || isDisallowedMinor) {\n    const need = `${REQUIRED_MAJOR_VERSION}.${REQUIRED_MINOR_VERSION}`;\n    const got = `${MAJOR_VERSION}.${MINOR_VERSION}`;\n    console.log(`skiping test as it requires nodejs >= ${need} and got ${got}`);\n    return true;\n  }\n\n  return false;\n};\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es2017\",\n    \"module\": \"commonjs\",\n    \"allowJs\": true,\n    \"declaration\": true,\n    \"declarationMap\": true,\n    \"sourceMap\": true,\n    \"outDir\": \"lib-es5\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"incremental\": true,\n    \"downlevelIteration\": true,\n    \"resolveJsonModule\": true\n  },\n  \"include\": [\"lib/**/*\", \"typings/**/*\"]\n}\n"
  }
]