{"name":"precinct","version":"6.1.1","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":">=6.0.0"},"homepage":"https://github.com/mrjoelkemp/node-precinct","dependencies":{"commander":"^2.19.0","debug":"^4.1.1","detective-amd":"^3.0.0","detective-cjs":"^3.1.1","detective-es6":"^2.0.0","detective-less":"^1.0.2","detective-postcss":"^3.0.0","detective-sass":"^3.0.0","detective-scss":"^2.0.0","detective-stylus":"^1.0.0","detective-typescript":"^5.1.0","module-definition":"^3.1.0","node-source-walk":"^4.2.0"},"devDependencies":{"jscs":"~3.0.7","jscs-preset-mrjoelkemp":"~2.0.0","mocha":"^5.2.0","rewire":"^4.0.1","sinon":"^6.2.0"},"gitHead":"2d880d760e5f2486459e76d5935785fad23b9965","_id":"precinct@6.1.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},"dist":{"integrity":"sha512-RkpLTDVV6CHEesdmXircnld3BlWzxmcnotj0XJEQluvGP17OHGAgpy/DiYRVHCJc/84ui3bK1p0KBpjlHzd4aQ==","shasum":"b643542dc81e302b4e030a1e9bf57bc65051fa3d","tarball":"http://registry-npm.ywwl.com/precinct/download/precinct-6.1.1.tgz","fileCount":4,"unpackedSize":9356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcP9qgCRA9TVsSAnZWagAA2tYP/0F3sY1g2J4mZcPym+Yh\nf3r7TzmoXKFCO2Tf2GDFSHC1eWZjOwhz5HmA4VlqluS0Cpl9UY3/matYb5r/\n3i7hNeGyIeMr6BfcJH1k4TXXr21K1klq1hse6N6QX+I/Fh0ju+RwshgLI6Im\ndDKQq4VJ/RBKlsz157AtqR7WeQ40Wz4ou4UDcUjQDbDsa2kEuaAV8qC5OUOJ\nF+UKfd0xPGPTbSORUKafzzz1eaa9l0D+bWw5d2TyoSKQKR/oeGBjGqIVINU3\nzSsFgXPHnA3a71sag1ZpujdVqrHN6KztImHsTzlN/Pf7wWdoTVdZP9STtwEI\ndISykCQkSUQHNhV7oPzTklj6ipz8ERsFu0taLTijSz605BDzTUut0Nrwr55x\nBWHLTNn1moFqodt2SXsu7ti5j5Idh+cbOdzFmbK0Hd15RLF0653Q4IHfH6Zc\nm1FOlk2RtFf5ez+ExDoBBAVcs3mnHbt++B0UqGb7DVQcedoYiJVTeApTqlI8\ncN1YWbagiyPiedpMREc0W2WvuSrtGcQb84Va9jwOwoshAR2KZYy4YA+418Ew\n5aqG+JP0AKDgHZzjP5pLNgbaFaN0q5wqzyu6qldaY5oAXFg4O/Q+vK7lk9JV\nlBALE2ZLfOv4x1uzFNZ66Wqz8Jri/iRTxZ7vOk/XoEhtwu1y9kquL6kJ+fPq\nxQ5N\r\n=cE82\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIUY0EL8CzJSKWgFWRWtdReHNyo5qkZtbwYY4VofeJBQIhAL0RHM6e9e6w0vYIhZxbRXpEiiHCWC31weN2i8zq0AFd"}],"size":3463,"noattachment":false,"key":"/precinct/-/precinct-6.1.1.tgz"},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/precinct_6.1.1_1547688607995_0.6665923035498884"},"_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":1547688608113,"_cnpm_publish_time":1547688608113,"dist-tags":{"latest":"13.0.1"}}