{
  "manifest": {
    "name": "pirates",
    "description": "Properly hijack require, i.e., properly define require hooks and customizations",
    "main": "lib/index.js",
    "types": "index.d.ts",
    "scripts": {
      "clean": "rimraf lib",
      "build": "babel src -d lib",
      "test": "cross-env BABEL_ENV=test yarn run build && nyc ava",
      "lint": "eslint --report-unused-disable-directives .",
      "prepublishOnly": "yarn run build"
    },
    "files": [
      "lib",
      "index.d.ts"
    ],
    "repository": {
      "type": "git",
      "url": "https://github.com/danez/pirates.git"
    },
    "engines": {
      "node": ">= 6"
    },
    "author": {
      "name": "Ari Porad",
      "email": "ari@ariporad.com",
      "url": "http://ariporad.com"
    },
    "devDependencies": {
      "@babel/cli": "7.21.0",
      "@babel/core": "7.21.4",
      "@babel/preset-env": "7.21.4",
      "ava": "1.4.1",
      "babel-core": "7.0.0-bridge.0",
      "babel-eslint": "10.1.0",
      "babel-plugin-istanbul": "5.2.0",
      "cross-env": "5.2.1",
      "decache": "4.6.1",
      "eslint": "5.16.0",
      "eslint-config-prettier": "4.3.0",
      "eslint-plugin-import": "2.27.5",
      "eslint-plugin-prettier": "3.4.1",
      "mock-require": "3.0.3",
      "nyc": "13.3.0",
      "prettier": "1.19.1",
      "rewire": "4.0.1",
      "rimraf": "3.0.2"
    },
    "license": "MIT",
    "bugs": {
      "url": "https://github.com/danez/pirates/issues"
    },
    "homepage": "https://github.com/danez/pirates#readme",
    "ava": {
      "files": [
        "test/*.js"
      ],
      "sources": [
        "lib/**/*.js"
      ]
    },
    "nyc": {
      "include": [
        "src/*.js"
      ],
      "reporter": [
        "json",
        "text"
      ],
      "sourceMap": false,
      "instrument": false
    },
    "version": "4.0.6",
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-pirates-4.0.6-3018ae32ecfcff6c29ba2267cbf21166ac1f36b9-integrity/node_modules/pirates/package.json",
    "readmeFilename": "README.md",
    "readme": "# Pirates [![Coverage][codecov-badge]][codecov-link]\n\n### Properly hijack require\n\n[codecov-badge]: https://img.shields.io/codecov/c/github/danez/pirates/master.svg?style=flat \"codecov\"\n[codecov-link]: https://codecov.io/gh/danez/pirates \"codecov\"\n\n## Why?\n\nTwo reasons:\n1. Babel and istanbul were breaking each other.\n2. Everyone seemed to re-invent the wheel on this, and everyone wanted a solution that was DRY, simple, easy to use,\nand made everything Just Work™, while allowing multiple require hooks, in a fashion similar to calling `super`.\n\nFor some context, see [the Babel issue thread][] which started this all, then [the nyc issue thread][], where\ndiscussion was moved (as we began to discuss just using the code nyc had developed), and finally to [#1][issue-1]\nwhere discussion was finally moved.\n\n[the Babel issue thread]: https://github.com/babel/babel/pull/3062 \"Babel Issue Thread\"\n[the nyc issue thread]: https://github.com/bcoe/nyc/issues/70 \"NYC Issue Thread\"\n[issue-1]: https://github.com/danez/pirates/issues/1 \"Issue #1\"\n\n## Installation\n\n    npm install --save pirates\n\n## Usage\n\nUsing pirates is really easy:\n```javascript\n// my-module/register.js\nconst addHook = require('pirates').addHook;\n// Or if you use ES modules\n// import { addHook } from 'pirates';\n\nfunction matcher(filename) {\n  // Here, you can inspect the filename to determine if it should be hooked or\n  // not. Just return a truthy/falsey. Files in node_modules are automatically ignored,\n  // unless otherwise specified in options (see below).\n\n  // TODO: Implement your logic here\n  return true;\n}\n\nconst revert = addHook(\n  (code, filename) => code.replace('@@foo', 'console.log(\\'foo\\');'),\n  { exts: ['.js'], matcher }\n);\n\n// And later, if you want to un-hook require, you can just do:\nrevert();\n```\n\n## API\n\n### pirates.addHook(hook, [opts={ [matcher: true], [exts: ['.js']], [ignoreNodeModules: true] }]);\nAdd a require hook. `hook` must be a function that takes `(code, filename)`, and returns the modified code. `opts` is\nan optional options object. Available options are: `matcher`, which is a function that accepts a filename, and\nreturns a truthy value if the file should be hooked (defaults to a function that always returns true), falsey if\notherwise; `exts`, which is an array of extensions to hook, they should begin with `.` (defaults to `['.js']`);\n`ignoreNodeModules`, if true, any file in a `node_modules` folder wont be hooked (the matcher also wont be called),\nif false, then the matcher will be called for any files in `node_modules` (defaults to true).\n\n\n## Projects that use Pirates\n\nSee the [wiki page](https://github.com/danez/pirates/wiki/Projects-using-Pirates). If you add Pirates to your project,\n(And you should! It works best if everyone uses it. Then we can have a happy world full of happy require hooks!), please\nadd yourself to the wiki.\n",
    "licenseText": "MIT License\n\nCopyright (c) 2016-2018 Ari Porad\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"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz",
    "hash": "3018ae32ecfcff6c29ba2267cbf21166ac1f36b9",
    "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==",
    "registry": "npm",
    "packageName": "pirates",
    "cacheIntegrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== sha1-MBiuMuz8/2wpuiJny/IRZqwfNrk="
  },
  "registry": "npm",
  "hash": "3018ae32ecfcff6c29ba2267cbf21166ac1f36b9"
}