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-2/

{
  "context": "This criteria evaluates how effectively the engineer uses the cjs-module-lexer package to detect basic CommonJS export patterns, including the parse() function and proper handling of its return values.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import package",
      "description": "The solution correctly imports or requires the cjs-module-lexer package (e.g., const { parse } = require('cjs-module-lexer') or const parser = require('cjs-module-lexer'))",
      "max_score": 10
    },
    {
      "name": "Call parse function",
      "description": "The solution calls the parse() function from cjs-module-lexer with the source code string as the first argument",
      "max_score": 25
    },
    {
      "name": "Handle initialization",
      "description": "The solution properly handles cjs-module-lexer initialization if needed (calls init() or initSync() before parse(), or wraps in async function if using init())",
      "max_score": 15
    },
    {
      "name": "Extract exports array",
      "description": "The solution correctly extracts the exports array from the parse() return value and uses it for the namedExports property",
      "max_score": 20
    },
    {
      "name": "Extract reexports array",
      "description": "The solution correctly extracts the reexports array from the parse() return value and uses it to determine hasReexport (checking if reexports array length > 0 or similar logic)",
      "max_score": 20
    },
    {
      "name": "Return correct format",
      "description": "The solution returns an object with the correct structure: { namedExports: array, hasReexport: boolean }",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

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

tile.json