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

{
  "context": "This criteria evaluates how well the engineer uses the cjs-module-lexer package to detect exports defined via Object.defineProperty. The focus is on correct usage of the parse() function and proper interpretation of its output to identify defineProperty-based exports.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import parse function",
      "description": "Correctly imports the parse() function from the cjs-module-lexer package using require('cjs-module-lexer').parse or destructuring syntax",
      "max_score": 10
    },
    {
      "name": "Call parse function",
      "description": "Calls parse() with the source code string as the first argument to analyze the CommonJS module",
      "max_score": 20
    },
    {
      "name": "Extract exports array",
      "description": "Accesses the exports property from the parse() function's return value to get the array of detected export names",
      "max_score": 25
    },
    {
      "name": "Value property detection",
      "description": "The implementation correctly detects exports defined using Object.defineProperty with a value property (as verified by the test case with { value: 42, enumerable: true })",
      "max_score": 15
    },
    {
      "name": "Getter property detection",
      "description": "The implementation correctly detects exports defined using Object.defineProperty with a get function (as verified by the test case with get: function() { return bar; })",
      "max_score": 15
    },
    {
      "name": "Multiple exports handling",
      "description": "The implementation correctly handles source code with multiple Object.defineProperty calls and returns all detected export names",
      "max_score": 15
    }
  ]
}

Install with Tessl CLI

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

tile.json