{"_id":"@artdeco/pirates","_rev":"1-f1b3b2ea301fde88365887b32e661f08","name":"@artdeco/pirates","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@artdeco/pirates","version":"1.0.0","description":"[fork] Properly Hijack Require In ES6 For Google Closure Compiler.","main":"build/index.js","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec test/mask","spec":"yarn t test/spec","mask":"yarn t test/mask","test-build":"ALAMODE_ENV=test-build yarn test","lint":"eslint .","doc":"NODE_DEBUG=doc doc -o README.md","b":"alamode src -o build -s","d":"yarn-s d1 externs","d1":"typal src -c","externs":"typal externs.js -e","build":"yarn-s d b doc","e":"alanode"},"externs":"externs.js","repository":{"type":"git","url":"git://github.com/artdecocode/pirates.git"},"keywords":["pirates","artdeco"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/pirates/issues"},"homepage":"https://github.com/artdecocode/pirates#readme","devDependencies":{"alamode":"^1.9.3","documentary":"^1.25.0","eslint-config-artdeco":"1.0.1","yarn-s":"1.1.0","zoroaster":"^3.12.0"},"licenseText":"MIT License\n\nModifications\n\nCopyright (c) 2019 Art Deco Code Limited\n + rewrite in ES6 modules\n + make types compatible with Google Closure Compiler\n\nOriginal Work\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","_id":"@artdeco/pirates@1.0.0","dist":{"shasum":"3403fa0d05b8c5fe168ed814d7ac8cb95d4b18ca","integrity":"sha512-8dooTG4aHnwgfPKF1a8u3tElculvA3tHzuWnVJa+YceZb26s+0IsNJhmcRpIgQpnEoc2FwkaRWKuO4P1cHuK3Q==","tarball":"https://registry.npmjs.org/@artdeco/pirates/-/pirates-1.0.0.tgz","fileCount":12,"unpackedSize":16965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcwBOWCRA9TVsSAnZWagAAhhcP/is5cXKb9OsxZmbU3HTq\naXHUXbUFevmcl9fvla1uirz1BoWZaSZPP8IVN8iWxI04OzDs2HCIhbutQ0Xy\nmwFqaYbEz4tiujOg+rgWsrDawr1u2NWQsNk2A1RwFJ7685XvFbGIbbzA/gXT\nur2bkeMiHYiew0+jA2w44TccFyHcew98YFRKUBOwMSU2L6/mUm4rVge7ebha\nLMo134gXT+y0Brx6bomVVRtPosd8ny1yLo7D1SyGzKlxblp/Ou8dEmT/4A+i\nvy05Q/MLVgFRyBE/E8pKzWKOVZHWd4cKh56Vf1RxxYxL1uL2+7tydTELxEjW\nCIPVEoaCCi9botOuwglWgKTjhzI4ie1nhDoKTJZ1Lse6d5SdgBEi3tIlNwuy\n6/6gyaCKIJh1PCoit2k55tsKyosb8OiM4fFO7KtmJ+oz4m0CoDUGIFuPGpv+\nbjSyx1PPrahpVRPA3bDuvpbNcfgfbdcNVfvU5V/Cy262KpILYILn/rgh7ZMH\nmaTcBE1z6yFrC3t/gQcvcfpa3s8uxx/4fn2gSugTjPRP51V4hBeSAswjfL0V\nR4h+8pdSaVA/XNkV4XQypYRHSrZ31BhUmKhPLVpmjkXIo/xESmASx+dG1FSu\njku77ZH6X0DgXmbkUrxOas4KYynRF9a6nyEw66ep4CmTHlODl/MDT8fjeP0N\nkYG+\r\n=spSf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrpO1M6OnvcvnyUaKrMR3NPPXbYLNgYmyv/3wTpa/35AIhAIOS4fV3h+wM+YEmTjNr37ZJTLcZeF28NGYy6uUFatJh"}]},"maintainers":[{"name":"zvr","email":"anton@adc.sh"}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pirates_1.0.0_1556091797699_0.37558600897266925"},"_hasShrinkwrap":false}},"time":{"created":"2019-04-24T07:43:17.612Z","1.0.0":"2019-04-24T07:43:17.798Z","modified":"2022-04-04T15:36:13.173Z"},"maintainers":[{"name":"zvr","email":"anton@adc.sh"}],"description":"[fork] Properly Hijack Require In ES6 For Google Closure Compiler.","homepage":"https://github.com/artdecocode/pirates#readme","keywords":["pirates","artdeco"],"repository":{"type":"git","url":"git://github.com/artdecocode/pirates.git"},"author":{"name":"Anton","email":"anton@adc.sh"},"bugs":{"url":"https://github.com/artdecocode/pirates/issues"},"license":"MIT","readme":"# @artdeco/pirates\n\n[![npm version](https://badge.fury.io/js/%40artdeco%2Fpirates.svg)](https://npmjs.org/package/@artdeco/pirates)\n\n`@artdeco/pirates` is a [fork](https://github.com/ariporad/pirates) of Properly Hijack Require In ES6 For Google Closure Compiler.\n\n```sh\nyarn add @artdeco/pirates\n```\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [API](#api)\n- [`addHook(hook: function, conf?: Config): function`](#addhookhook-functionconf-config-function)\n  * [`_pirates.Config`](#type-_piratesconfig)\n- [Copyright](#copyright)\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/0.svg?sanitize=true\"></a></p>\n\n## API\n\nThe package is available by importing its default function:\n\n```js\nimport addHook from '@artdeco/pirates'\n```\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/1.svg?sanitize=true\"></a></p>\n\n## `addHook(`<br/>&nbsp;&nbsp;`hook: function,`<br/>&nbsp;&nbsp;`conf?: Config,`<br/>`): function`\n\nAdd a require hook. Returns a function that allows to revert the hook.\n\n__<a name=\"type-_piratesconfig\">`_pirates.Config`</a>__: Options for the program.\n\n|       Name        |                   Type                    |                                                         Description                                                         | Default |\n| ----------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------- |\n| exts              | <em>(string \\| !Array&lt;string&gt;)</em> | The extension or extensions to hook. Should start with `.`.                                                                 | `.js`   |\n| matcher           | <em>(path: string) =&gt; boolean</em>     | A matcher function, will be called with path to a file. Should return truthy if the file should be hooked, falsy otherwise. | -       |\n| ignoreNodeModules | <em>boolean</em>                          | Auto-ignore `node_modules`. Independent of any matcher.                                                                     | `false` |\n\n```js\nimport addHook from '@artdeco/pirates'\nimport { relative } from 'path'\n\naddHook((code, filename) => {\n  const rel = relative('', filename)\n  return `console.log('hooked source code from %s:', '${rel}')\n  ${code}`\n})\n\nrequire('./source')\n```\n```\nhooked source code from example/source.js:\nhello world\n```\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/2.svg?sanitize=true\"></a></p>\n\n## Copyright\n\nOriginal Author: [Ari Porad](https://github.com/ariporad/pirates/)\n\n---\n\n<table>\n  <tr>\n    <th>\n      <a href=\"https://artd.eco\">\n        <img src=\"https://raw.githubusercontent.com/wrote/wrote/master/images/artdeco.png\" alt=\"Art Deco\" />\n      </a>\n    </th>\n    <th>© <a href=\"https://artd.eco\">Art Deco</a>   2019</th>\n    <th>\n      <a href=\"https://www.technation.sucks\" title=\"Tech Nation Visa\">\n        <img src=\"https://raw.githubusercontent.com/artdecoweb/www.technation.sucks/master/anim.gif\"\n          alt=\"Tech Nation Visa\" />\n      </a>\n    </th>\n    <th><a href=\"https://www.technation.sucks\">Tech Nation Visa Sucks</a></th>\n  </tr>\n</table>\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/-1.svg?sanitize=true\"></a></p>","readmeFilename":"README.md"}