CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-cjs-module-lexer

High-performance CommonJS module lexer for detecting named exports and reexports from JavaScript source code

93

0.98x

Quality

Pending

Does it follow best practices?

Impact

93%

0.98x

Average score across 10 eval scenarios

Overview
Eval results
Files

rubric.jsonevals/scenario-8/

{
  "context": "This criteria evaluates how effectively the engineer uses the cjs-module-lexer package to analyze CommonJS modules. The focus is on proper usage of the package's parse() function and correct handling of its initialization API and output format.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import package",
      "description": "Uses require() to import the cjs-module-lexer package (e.g., const { parse, init } = require('cjs-module-lexer'))",
      "max_score": 10
    },
    {
      "name": "Call init()",
      "description": "Calls the init() or initSync() function before using parse(), since the API requires initialization",
      "max_score": 15
    },
    {
      "name": "Use parse() function",
      "description": "Uses the parse() function to analyze the source code, passing the source code string as the first argument",
      "max_score": 25
    },
    {
      "name": "Extract exports array",
      "description": "Correctly extracts the exports array from the parse() function's return value (e.g., const { exports } = parse(sourceCode))",
      "max_score": 20
    },
    {
      "name": "Extract reexports array",
      "description": "Correctly extracts the reexports array from the parse() function's return value (e.g., const { reexports } = parse(sourceCode))",
      "max_score": 20
    },
    {
      "name": "Handle errors",
      "description": "Properly handles potential errors from parse() using try-catch or similar error handling mechanisms",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-cjs-module-lexer

tile.json