{"name":"precinct","version":"5.0.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":">=6.0.0"},"homepage":"https://github.com/mrjoelkemp/node-precinct","dependencies":{"commander":"^2.17.0","debug":"^3.1.0","detective-amd":"^2.4.0","detective-cjs":"^3.0.0","detective-es6":"^2.0.0","detective-less":"^1.0.1","detective-postcss":"^2.1.0","detective-sass":"^2.0.1","detective-scss":"^2.0.0","detective-stylus":"^1.0.0","detective-typescript":"^3.0.0","module-definition":"^3.0.0","node-source-walk":"^4.0.0"},"devDependencies":{"jscs":"~3.0.7","jscs-preset-mrjoelkemp":"~2.0.0","mocha":"^5.2.0","rewire":"^4.0.1","sinon":"^6.1.5"},"gitHead":"5a51c9f56bfa733f59702556e320d29e425f9169","_id":"precinct@5.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"},"dist":{"integrity":"sha512-BKFnABCL4ye6pe+eb+9iBATLUjPgn9wQKmfnaApFeINWY8niTfVDS+Mo11WfIywTzFW31xASthnyXDsI3XfWPQ==","shasum":"02155903492f17c8f1adbc350f088847cf7e940c","tarball":"http://registry-npm.ywwl.com/precinct/download/precinct-5.0.0.tgz","fileCount":4,"unpackedSize":8130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjWvcCRA9TVsSAnZWagAAnJoP/iW/wD6sd7IA1HwR85Uk\nHE85rovuhsaahkf4om3Jb9do4EJTmazPcBVqw1Bb37KuHSANtNJtDcawD1Bp\n46FX15/HF/beyzpsm1C3CiTT8VBR4NIczbme0ZxPTs27y1dyAy8/K38EdKvh\nKt8m83dJvCSKzS/6ZLdIl48Xf4xWamjUS4ZrM/LIJaXoRy68MQdF2JP9fb2i\nhfUexavD+8rCk3EVqJShRrb79q6LsscvF8JETE4GeBJJyRS4KV66sXKlLL2m\n3qqNYgGT0AmDmHJ5E8bHFWoXmLuOqbeRVL8974FdEL9VpeRJE5FHldcFIeQn\nXMgW0y5FQYStc6PO8qSkL60Ji06bBriG2XmtK1VN2dAlany8fvML8qr9y+AP\nt93hGgxvB0EYAo83ZefVZn4+tb6CjwaD1boLtHNRRGCPFzSrFCSKJ00t3eTk\nsRubm3CELGSjSEAB5le7xA8m6/qBWRb1xiAV1eU4w/NyEoKsAHlWz8kl09Rj\nAAgc7vllJvO0TBZ/MLgIeqCfdLLPsC3dc46KD3QjRLQC2ECV7lueV6IaWnZs\nyAZolBYldvEBUpJ2R8swZrT+80mym0WY6lvpi9E3a4qlGehKDpfFMq8UAeiN\nbWhaB3OEJ+22unlPfe5I59j5Q5AsNymj45q5SdnxHJKvvBTjRlTuX5DU4zRW\n4TBG\r\n=lolf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDUpzCeNnhw6u3ITZWq5ZObqNwFWQ7pT2iMi3vBz+uBmAiBluG7Vw1ssyBqFuJ8nEeTFqGbBeU0u2sZjIurG50oxqQ=="}],"size":3083,"noattachment":false,"key":"/precinct/-/precinct-5.0.0.tgz"},"maintainers":[{"name":"mrjoelkemp","email":"joel@mrjoelkemp.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/precinct_5.0.0_1535994843400_0.28857058301379124"},"_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":1535994843504,"_cnpm_publish_time":1535994843504,"dist-tags":{"latest":"13.0.1"}}