🔍💻🔎
find-code
Find code snippets in your project
Usage
Installation
$ npm install find-code
const findCode = require('find-code')
How it works
const foundCode = await findCode(/featuredEnabled\('.*'\)/, { directory: './lib' })
console.log(foundCode)
API
findCode(query, options)
query
:
The first argument can be a string or a regular expression:
const foundCode = await findCode(/featuredEnabled\('.*'\)/)
const foundCode = await findCode('const')
options
:
Property | Default | Description |
---|
directory | process.cwd() | Directory to scan |
exclude | ['node_modules'] | Directories to exclude from the scan |