{"name":"precinct","version":"9.0.0","description":"Unleash the detectives","main":"index.js","scripts":{"lint":"eslint index.js test/index.js","mocha":"mocha test/index.js","test":"npm run lint && npm run mocha","test:ci":"c8 npm run mocha"},"bin":{"precinct":"bin/cli.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/dependents/node-precinct.git"},"keywords":["modules","amd","commonjs","es6","sass","less","detective","dependencies"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-precinct/issues"},"engines":{"node":"^12.20.0 || ^14.14.0 || >=16.0.0"},"homepage":"https://github.com/dependents/node-precinct","dependencies":{"commander":"^9.1.0","detective-amd":"^4.0.1","detective-cjs":"^4.0.0","detective-es6":"^3.0.0","detective-less":"^1.0.2","detective-postcss":"^6.0.1","detective-sass":"^4.0.1","detective-scss":"^3.0.0","detective-stylus":"^2.0.0","detective-typescript":"^9.0.0","module-definition":"^4.0.0","node-source-walk":"^5.0.0"},"devDependencies":{"c8":"^7.11.0","eslint":"^8.11.0","mocha":"^9.2.2","rewire":"^6.0.0","sinon":"^13.0.1"},"gitHead":"ce7813e79a4bfcd4ebc5bd1ee7e2b2e8f61ed5bb","_id":"precinct@9.0.0","_nodeVersion":"16.14.1","_npmVersion":"8.5.0","dist":{"integrity":"sha512-Fe1llBR4G+T/rc2vS3nGSv8IP17Y71CienBTLW8wEW0YlrtyPyIKZyVhUB/75/2ITIKfs9SEthxqjOH+cGDjEw==","shasum":"26f91f93716f28155cf4ae52bda6a5e6a51ff388","tarball":"http://registry-npm.ywwl.com/precinct/download/precinct-9.0.0.tgz","fileCount":4,"unpackedSize":9765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNXlCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkPg//feqpmQPJ+R7yhcCNa1tNkwGPhgTfxcqv73GWZh+dnDSmjxg0\r\n1B75xUiN0ZrXfOR3HJH1fY+SQOl9R4Bwi/ie9/IiCjQArN2n5euuKayTzbyQ\r\nJ4ezLdnmpDf7j4S3WFx+Jj5+XmLGP+9jKUuFGPi3ULEf3GIoVX5EY2C0/q7s\r\n0DslIQAtOWBvNFubNNEze+sDuwe6uq1YDVc8KB0owgZcVqVqoW1jtLQ22EAC\r\n9ZDXK1OBse9E1yDx8fjiMWf4udideHNLjKjINLZxBJJ3mQwKcbFS8LSLu+pb\r\n4Xu5Yzro7Qbc7DLBPEWhR3DdVSlQB5WggbsrcMu4oKf1pnxyLtFfJ6g5ngVi\r\nuiaxR1SJwg5XlCSTVlGJzQKkGnGuq/7pXTWBUNOPzzUcI9YZ8P1vYV5AZNdb\r\nsnPIu6OwdZhWwaPVX2ZdgZLV1/v0o7yqWOLlcS6PelBDCgAIWIZlvE0Xn1QW\r\nBuva82yyZSn32rBc5FIU0nbeOS4XPYcXti3ViJQdGvcSW7emLEYFprRRxD7q\r\ngg7uKI4CqZGynL/oD84OEEzN62ALoZ7y2RqulPfCgUgW7mEEv8CUy2vEElXB\r\nENtymgxVWqaNFKg2SnWzLVaNuz/+Rgl5mDEXulDAiHv3dKzsxR0R4ayHP2Mx\r\n08j5LAyXmzPT2TwTGh/EvXTLX0Ae4hsAV7c=\r\n=/Q09\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMW7jlNIPPUtmooylc9HVmG8oOd8P7pyk3ey3gTAkpaAIgatAJRCCH7GESSJz5nYVYFG6mwOAY70+lXCnLiRJnXro="}],"size":3541,"noattachment":false,"key":"/precinct/-/precinct-9.0.0.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"},{"name":"mrjoelkemp","email":"mrjoelkemp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/precinct_9.0.0_1647671617871_0.9049393888394603"},"_hasShrinkwrap":false,"readme":"# precinct\n\n[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-precinct/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-precinct/actions/workflows/ci.yml?query=branch%3Amain)\n[![npm version](https://img.shields.io/npm/v/precinct?logo=npm&logoColor=fff)](https://www.npmjs.com/package/precinct)\n[![npm downloads](http://img.shields.io/npm/dm/precinct)](https://www.npmjs.com/package/precinct)\n\n> Unleash the detectives\n\n```sh\nnpm install precinct\n```\n\nUses the appropriate detective to find the dependencies of a file or its AST.\n\nSupports:\n\n* JavaScript modules: AMD, CommonJS, and ES6\n* TypeScript\n* CSS Preprocessors: Sass, Scss, Stylus, and Less\n* CSS (PostCSS)\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst precinct = require('precinct');\n\nconst content = fs.readFileSync('myFile.js', 'utf8');\n\n// Pass in a file's content or an AST\nconst deps = precinct(content);\n```\n\nYou may pass options (to individual detectives) based on the module type via an optional second object argument `detective(content, options)`, for example:\n\nExample call:\n\n```js\nprecinct(content, {\n  amd: {\n    skipLazyLoaded: true\n  },\n  type: 'amd'\n});\n```\n\n* The supported module type prefixes are: `amd`, `commonjs`, `css`, `es6`, `less`, `sass`, `scss`, `stylus`, `ts`, `tsx`, `vue`.\n\nCurrent options:\n\n* `amd.skipLazyLoaded`: tells the AMD detective to omit lazy-loaded dependencies (i.e., inner requires).\n* `es6.mixedImports`: allows for all dependencies to be fetched from a file that contains both CJS and ES6 imports.\n  * Note: This will work for any file format that contains an ES6 import.\n* `css.url`: tells the CSS detective to include `url()` references to images, fonts, etc.\n\nFinding non-JavaScript (ex: Sass and Stylus) dependencies:\n\n```js\nconst fs = require('fs');\nconst content = fs.readFileSync('styles.scss', 'utf8');\n\nconst sassDeps = precinct(content, { type: 'sass' });\nconst stylusDeps = precinct(content, { type: 'stylus' });\n```\n\nOr, if you just want to pass in a filepath and get the dependencies:\n\n```js\nconst { paperwork } = require('precinct');\n\nconst deps = paperwork('myFile.js');\nconst deps2 = paperwork('styles.scss');\n```\n\n### `precinct.paperwork(filename, options)`\n\nSupported options:\n\n* `includeCore`: (default: `true`) set to `false` to exclude core Node.js dependencies from the list of dependencies.\n* `fileSystem`: (default: `undefined`) set to an alternative `fs` implementation that will be used to read the file path.\n* You may also pass detective-specific configuration like you would to `precinct(content, options)`.\n\n### CLI\n\nAssumes a global install precinct with `npm install -g precinct`.\n\n```sh\nprecinct [options] path/to/file\n```\n\nRun `precinct --help` to see all options.\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1647671618037,"_cnpm_publish_time":1647671618037,"dist-tags":{"latest":"13.0.1"}}