High-performance CommonJS module lexer for detecting named exports and reexports from JavaScript source code
93
Quality
Pending
Does it follow best practices?
Impact
93%
0.98xAverage score across 10 eval scenarios
Token parsing (strings, comments, templates, regex)
Package import
100%
100%
parse() invocation
100%
100%
Exports array usage
100%
100%
Reexports array usage
100%
100%
Proper initialization
0%
40%
Basic export detection (exports.name, module.exports)
Import package
100%
100%
Call parse function
100%
100%
Handle initialization
100%
46%
Extract exports array
100%
100%
Extract reexports array
100%
100%
Return correct format
100%
100%
Object.defineProperty getter and value detection
Import parse function
100%
100%
Call parse function
100%
100%
Extract exports array
100%
100%
Value property detection
100%
100%
Getter property detection
100%
100%
Multiple exports handling
100%
100%
Performance optimizations (memory management, endian handling)
Imports cjs-module-lexer
100%
100%
Calls init()
100%
100%
Uses parse() function
100%
100%
Extracts exports array
100%
100%
Extracts reexports array
100%
100%
Handles parse errors
100%
100%
Grammar validation (ECMA-262 identifiers, surrogate pairs)
Uses parse function
80%
100%
Extracts exports correctly
100%
100%
Handles Unicode identifiers
50%
50%
Validates surrogate pairs
50%
50%
Filters reserved words
33%
53%
Module reexport detection (module.exports = require())
Imports parse function
100%
100%
Calls parse correctly
100%
100%
Extracts reexports field
100%
100%
Returns reexports array
100%
100%
Star re-export pattern detection (__export, __exportStar)
Uses parse function
100%
100%
Extracts reexports data
100%
60%
Returns module list
75%
50%
Detects presence flag
100%
50%
Handles empty case
100%
100%
Parse function with exports and reexports extraction
Import package
100%
100%
Call init()
100%
100%
Use parse() function
100%
100%
Extract exports array
100%
100%
Extract reexports array
100%
100%
Handle errors
100%
100%
Transpiler-specific Object.keys().forEach() patterns
Imports parse function
100%
100%
Calls parse function
100%
100%
Accesses exports array
100%
100%
Handles reexports array
100%
100%
Detects Babel pattern
33%
100%
Identifies source module
33%
100%
Handles arrow functions
100%
100%
Negative case handling
100%
100%
TypeScript transpiler pattern recognition
Uses parse function
100%
100%
Analyzes source code
100%
100%
Detects Babel patterns
100%
100%
Detects TypeScript patterns
100%
100%
Returns correct format
100%
100%
Install with Tessl CLI
npx tessl i tessl/npm-cjs-module-lexer