🔍💻🔎
find-code
Find code snippets in your project
Usage
Installation
$ npm install find-code
const findCode =
How it works
const foundCode = await console// [{// file: 'my-module.js',// path: '/Users/Jason/dev/secret-project/lib/my-module.js',// line: 'if (user.featureEnabled('my-feature')) {',// lineNumber: 2// block: '// This checks if the feature is enabled\nif (user.featureEnabled('my-feature')) {\nconsole.log('Yay!')// }]
API
query
:
The first argument can be a string or a regular expression:
const foundCode = await const foundCode = await
options
:
Property | Default | Description |
---|---|---|
directory |
process.cwd() |
Directory to scan |
exclude |
['node_modules'] |
Directories to exclude from the scan |