bare-module-lexer
Heuristic lexer for detecting imports and exports in JavaScript modules. It trades off correctness for performance, aiming to reliably support the most common import and export patterns with as little overhead as possible.
Usage
const lex = require('bare-module-lexer')
lex(`
const foo = require('./foo.js')
exports.bar = 42
`)
API
See the bare-module-lexer reference.
Threat model
bare-module-lexer is one of the addons Bare compiles into its binary, so it inherits Bare's threat model. See docs/threat-model.md for where this addon sits in it.
License
Apache-2.0