{"name":"precinct","version":"11.0.0","description":"Unleash the detectives","main":"index.js","scripts":{"lint":"xo","fix":"xo --fix","mocha":"mocha","test":"npm run lint && npm run mocha","test:ci":"c8 npm run mocha"},"bin":{"precinct":"bin/cli.js"},"repository":{"type":"git","url":"git+https://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":"^14.14.0 || >=16.0.0"},"homepage":"https://github.com/dependents/node-precinct","dependencies":{"@dependents/detective-less":"^4.0.0","commander":"^10.0.1","detective-amd":"^5.0.0","detective-cjs":"^5.0.1","detective-es6":"^4.0.0","detective-postcss":"^6.1.3","detective-sass":"^5.0.0","detective-scss":"^4.0.0","detective-stylus":"^4.0.0","detective-typescript":"^11.0.0","module-definition":"^5.0.0","node-source-walk":"^6.0.0"},"devDependencies":{"c8":"^7.13.0","eslint":"^8.39.0","mocha":"^10.2.0","rewire":"^6.0.0","sinon":"^15.0.4","xo":"^0.54.2"},"xo":{"space":true,"ignores":["test/fixtures/*"],"rules":{"arrow-body-style":"off","capitalized-comments":"off","comma-dangle":["error","never"],"complexity":["error",25],"curly":["error","multi-line"],"max-nested-callbacks":["error",5],"operator-linebreak":["error","after"],"object-curly-spacing":["error","always"],"space-before-function-paren":["error","never"],"unicorn/prefer-module":"off","unicorn/prefer-node-protocol":"off","unicorn/prefer-top-level-await":"off","unicorn/prevent-abbreviations":"off"},"overrides":[{"files":"test/**","envs":["mocha"]}]},"gitHead":"1fc6b490af4c29c40f3b0570964f630faec200d1","_id":"precinct@11.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-uQAwDt7EtDHKnbjJlZdlArc/kkdst/aqS83pmG5WpBsKul1zF1t67FQgCfIdJgZwTcoWtH0ZBa9Xc+lYks/QXA==","shasum":"bcccbf936fa0868cbc204d9e734a90aae3dd7ea5","tarball":"http://registry-npm.ywwl.com/precinct/download/precinct-11.0.0.tgz","fileCount":5,"unpackedSize":12589,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE92smPzRx7ecqYJkj+2Zmzfs0oAnsRQG9ABZ0ERxiZwAiEA9DLC1VGUDi/ahT54CgQL6uvwA3Cktb9n6i1d/EJy9Uc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkVKvWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3ig//aYLhzVnm0t1qArOzMZY1oh5eltk9jkUNdeAf1n/g+Vdvuq3F\r\nr/rvzVA+GsjDomSF4aRWXc4UANgYSe+qfNz9eL8GPdjCtFq1S0BGNYU7tFpB\r\n3IPF9hiKye7w9ttn3SVUnjFHJGd9v4IqXM2AMc8YnIIPhMYq8etqp9cypi4a\r\nFAom53Ulsjho0i4+XGx9n1p8T4pFcnZxZNl3fqeX5MpfWE1pqX9EGL4R0vz3\r\niqYSkfZq0JQeZJpemPmtOaRDkj8GCU9EoTtfL6qv5R+cz+byx/njkcu9TBiX\r\nFHBgz6baL3/WUJ4GWpDSFj5WHIAW3saH3dFEYvZc3D4hF0wMvlH7THxbequc\r\nTmyjBGZZMgKZlvZA8QiEb1UJvloy0MAkTMDqjLH492vaNgIpVqeAnWum9RrB\r\n9RURqlmM8FAXyruhK38ayKWNyJNkTp9QG3Q+vypCeJU6p3c3IhPAPd17Tf67\r\nzm3G6e3dAvOrCC4cFjMuHsx8Tu9OsPHkvB6vpp+S0L33hlrghuUvVCY6j9Ce\r\nkqltwtSX8c0sK+NJMqPIAOac8xCVqREnoSL66aNssc/xQD/CJzapQXti3P1Y\r\nGPocWcdrp8ggdyfmDMLWa1mhnvgzHeHY1zUic7WO4fLnvni+vYxeUixvMJX8\r\nwo5LAIbs3k/EWpqhGToGwlaVipN2B+86yaY=\r\n=CV6e\r\n-----END PGP SIGNATURE-----\r\n","size":4787,"noattachment":false,"key":"/precinct/-/precinct-11.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_11.0.0_1683270614512_0.7183370557837947"},"_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":1683270614678,"_cnpm_publish_time":1683270614678,"dist-tags":{"latest":"13.0.1"}}