{"name":"precinct","version":"9.2.1","description":"Unleash the detectives","main":"index.js","scripts":{"lint":"eslint index.js \"test/*.js\"","fix":"npm run lint -- --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":"^12.20.0 || ^14.14.0 || >=16.0.0"},"homepage":"https://github.com/dependents/node-precinct","dependencies":{"@dependents/detective-less":"^3.0.1","commander":"^9.5.0","detective-amd":"^4.1.0","detective-cjs":"^4.1.0","detective-es6":"^3.0.1","detective-postcss":"^6.1.1","detective-sass":"^4.1.1","detective-scss":"^3.0.1","detective-stylus":"^3.0.0","detective-typescript":"^9.1.1","module-definition":"^4.1.0","node-source-walk":"^5.0.1"},"devDependencies":{"c8":"^7.13.0","eslint":"^8.36.0","mocha":"^9.2.2","rewire":"^6.0.0","sinon":"^13.0.2"},"gitHead":"efbf295976c34eb1c59fc0ac5d725ada8bb3cfe1","_id":"precinct@9.2.1","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-uzKHaTyiVejWW7VJtHInb9KBUq9yl9ojxXGujhjhDmPon2wgZPBKQIKR+6csGqSlUeGXAA4MEFnU6DesxZib+A==","shasum":"db0a67abff7b0a9a3b2b1ac33d170e8a5fcac7b2","tarball":"http://registry-npm.ywwl.com/precinct/download/precinct-9.2.1.tgz","fileCount":5,"unpackedSize":11383,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiICXvuV72K0t0QlcyxV+V8ENC8Iao27Ib+O9vQB+RTAIgSd2EfpF17KAuunh05N1UA/h3xJWGNtiYqvzg0V2X5oM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFtpyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcOw/8DIvfckBjGUXfv8SR97b1ojGlMTFKz4F6X5Osl6J+fbS+BXwj\r\nwZD6erVhTh5m/nUtgsrxgL9qGCCCre+NFYGZlOVB8eC8+8MPTq+FI99g4Pzw\r\n3o3WYkH/2ryXvM4eCsz9/AtQhPdh84VpnE7KW+Jx4lff20QWyoJL/ND34mtY\r\nj7Wbtzs+ig0uA66wZzFr8/+iE3kopxQ2BZIf+X7nnPNhVZCGfaSZMTkco5MC\r\n0wzfSUDZrgtReM8nR0J6a68XiFbdbAvh/Z9IvZ/BObYnF5PJ0zLKXYh0mr67\r\no+HDeeNo1HEs58rPY/Z95oekiRSVFxCR7O4sUJSB2ASaH6r/D3X6MXwtKbA5\r\nwqMi6Bf0F7DS8HB37Ly657gUeNYN8QokGaRNYI6tAm00I1nCG6HifuKI7xdw\r\nJKOioTcubu719lTJI+xk+M6epeb68GwhkitbPuM7Btx5WVJ6paOgXVNj2I0D\r\nuC5Vb62yzuJcGzViVJsTEq9sZcCVuPf1b5vNDbKKH+eK3Nt/9wwU84rcP8bO\r\nJsPyqu6CiS7HMtT67Kc8DXwPcGAWQMpi1f1Vz378kxGE1BOTNlEd/maqUOOJ\r\nMEjBRGPGM6pxCBMTdFMDKCJ1j9otgJ3RJH58JT7/AFs9VV3fyU1+eSNUSC3X\r\nddcsvKPJuyr62suw5O3n0AJJ5+1om7KEWU8=\r\n=qhp/\r\n-----END PGP SIGNATURE-----\r\n","size":4393,"noattachment":false,"key":"/precinct/-/precinct-9.2.1.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.2.1_1679219314534_0.04087138570704063"},"_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":1679219314690,"_cnpm_publish_time":1679219314690,"dist-tags":{"latest":"13.0.1"}}