{"name":"precinct","version":"8.3.0","description":"Unleash the detectives","main":"index.js","scripts":{"test":"jscs index.js test/index.js && mocha test/index.js"},"bin":{"precinct":"bin/cli.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/mrjoelkemp/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/mrjoelkemp/node-precinct/issues"},"engines":{"node":"^10.13 || ^12 || >=14"},"homepage":"https://github.com/mrjoelkemp/node-precinct","dependencies":{"commander":"^2.20.3","debug":"^4.3.1","detective-amd":"^3.0.1","detective-cjs":"^3.1.1","detective-es6":"^2.2.0","detective-less":"^1.0.2","detective-postcss":"^4.0.0","detective-sass":"^3.0.1","detective-scss":"^2.0.1","detective-stylus":"^1.0.0","detective-typescript":"^7.0.0","module-definition":"^3.3.1","node-source-walk":"^4.2.0"},"devDependencies":{"jscs":"~3.0.7","jscs-preset-mrjoelkemp":"~2.0.0","mocha":"^8.2.1","rewire":"^5.0.0","sinon":"^9.2.1"},"gitHead":"0f3fec4da76276066e72423ecf64444884609011","_id":"precinct@8.3.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-+NPlVGgm+SVfQeClQQt9q4L7Aq7Lym2EhoLU8Ocs1T131hLJ0LAOMigHILSf5kVH2/rym5c80bUdBPkZ1HPKFA==","shasum":"7b1a4c90d8e6fb202f56dc60225dd4d40ad94333","tarball":"http://registry-npm.ywwl.com/precinct/download/precinct-8.3.0.tgz","fileCount":4,"unpackedSize":9312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvJTkCRA9TVsSAnZWagAA4wUP+wbJ0sULLEM7QhYUfpMK\nJHhElqkJ9D+/veq3AFrMR7adYw1OJHQG9GUOYZva0XD3wojNNG8EdbQY1co2\ntbD52NOnI2/UV+AVma5f7LbyEi5T/7P/819h7QrxBZw/z1y81I9GMTJAcOko\nqKnHmR89jR1Gs8LU3a7nmEu5m1b6iNV07KDLUtifgyAVhW49QTF6e7JI4s0l\nlHhcGU0rKnLV7upCdgXLW9mIdIqgTWCLFLmL9ODSF7IW3irdxZc+6M/WFfCr\nk+V0s1bLfQpZ8NWnLVUlky5/h5yOn+xO+Xirvu2NW+M8a9e/NYjxm2rovkC0\nyVTu8RXMW44YsUzyL0zyGya3iLNNIRKbZ7VqbWLNpqlzp4I31yRkBDEjrB6a\nNXu5jevqr4m4E7Tyypie7zoWYp661lkjDPBI26hxG9/EXKN6sXf+UzeQur/g\ngAZRiwUBy51NicG1AL6tSYWqw/8CdsSf++lAFd+51ln8RVZJrOtBMzGi3TrL\nSA/y4uEC+f42298VrcNd4tAOC7XVsbGKMSObo1dEuhH1VG6PginXyRy2yu3N\nY0ym45QqATebkVDystyt3QRqMYoM6M5Qz0/1RsN0uD3eII5EzsAFuS+WK5XE\nxW06NcJkUt70+bXyPkrk9q2hp/Ouf6pIlPNeDKS+OoRBgeLx86Z+uZYAyEPT\nZLof\r\n=/o2S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHowb1qQJsiFclmYnzEXqsTE+ScCPFUqGlzYsk8y7NFGAiBHD0GiF7+icgte7ja3MCPEqa19ztMcksS8nqoW6Brenw=="}],"size":3449,"noattachment":false,"key":"/precinct/-/precinct-8.3.0.tgz"},"_npmUser":{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},"directories":{},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/precinct_8.3.0_1639748836446_0.7906773299938255"},"_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":1639748836562,"_cnpm_publish_time":1639748836562,"dist-tags":{"latest":"13.0.1"}}