Expand description
AST-based config file parser utilities.
Provides helpers to extract configuration values from JS/TS config files without evaluating them. Uses Oxc’s parser for fast, safe AST walking.
Common patterns handled:
export default { key: "value" }(default export object)export default defineConfig({ key: "value" })(factory function)module.exports = { key: "value" }(CJS)- Import specifiers (
import x from 'pkg') - Array literals (
["a", "b"]) - Object properties (
{ key: "value" })
Functions§
- extract_
config_ object_ keys - Extract keys of an object property at a nested path.
- extract_
config_ property_ strings - Extract string values from top-level properties of the default export/module.exports object. Returns all string literal values found for the given property key, recursively.
- extract_
config_ require_ strings - Extract
require('...')call argument strings from a property’s value. - extract_
config_ shallow_ strings - Extract only top-level string values from a property’s array.
- extract_
config_ string - Extract a single string from a property at a nested path.
- extract_
config_ string_ array - Extract string array from a property at a nested path in a config’s default export.
- extract_
config_ string_ or_ array - Extract a value that may be a single string, a string array, or an object with string values.
- extract_
imports - Extract all import source specifiers from JS/TS source code.
- find_
config_ object_ pub - Public wrapper for
find_config_objectfor plugins that need manual AST walking.