{"id":25548,"library":"esprima-six-jpike","title":"Esprima (harmony fork)","description":"Esprima (version 1.1.1-dev-harmony) is a high-performance, standard-compliant ECMAScript parser written in JavaScript. It supports full ES5.1 and experimental ES6/Harmony features (modules, classes, destructuring). Runs in browsers (IE6+) and Node.js (>=0.4.0). Known for being up to 3x faster than UglifyJS v1. This is an unofficial fork with the '-harmony' suffix, indicating pre-release support for ES6. Note: this package may be considered obsolete compared to mainline esprima releases.","status":"deprecated","version":"1.1.1-dev-harmony","language":"javascript","source_language":"en","source_url":"http://github.com/ariya/esprima","tags":["javascript"],"install":[{"cmd":"npm install esprima-six-jpike","lang":"bash","label":"npm"},{"cmd":"yarn add esprima-six-jpike","lang":"bash","label":"yarn"},{"cmd":"pnpm add esprima-six-jpike","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-style import works in supported Node versions; CommonJS require is also possible but the package uses global scope.","wrong":"const parse = require('esprima-six-jpike').parse","symbol":"parse","correct":"import { parse } from 'esprima-six-jpike'"},{"note":"tokenize is available as a named export from the main module.","wrong":"import tokenize from 'esprima-six-jpike/tokenize'","symbol":"tokenize","correct":"import { tokenize } from 'esprima-six-jpike'"},{"note":"Syntax is a named export containing node type constants. ESM is preferred in modern Node.","wrong":"const Syntax = require('esprima-six-jpike').Syntax","symbol":"Syntax (type object)","correct":"import { Syntax } from 'esprima-six-jpike'"}],"quickstart":{"code":"import { parse, tokenize } from 'esprima-six-jpike';\n\nconst code = 'const answer = 42;';\n\n// Parse to AST (supports ES5.1, experimental harmony)\nconst ast = parse(code, { tolerant: true, loc: true });\nconsole.log(JSON.stringify(ast, null, 2));\n\n// Tokenize\nconst tokens = tokenize(code, { range: true });\nconsole.log(tokens);\n\n// Example with harmony syntax\nconst harmonyCode = 'class Person { constructor(name) { this.name = name; } }';\nconst harmonyAst = parse(harmonyCode, { jsx: false, type: 'module' });\nconsole.log(harmonyAst);","lang":"typescript","description":"Shows parsing and tokenizing JavaScript code, including experimental ES6/Harmony syntax using the fork."},"warnings":[{"fix":"Switch to 'esprima' latest stable version (e.g., 4.0.1).","message":"This package is an unofficial fork (esprima-six-jpike) and may not be maintained. Use official 'esprima' package instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"For production ES6 parsing, use a dedicated ES6 parser like 'acorn' with the 'ecmaVersion' option.","message":"The '-harmony' suffix indicates pre-release ES6 support; features may be incomplete or unstable.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a recent Node LTS version (e.g., 14.x or later) and test thoroughly, or migrate to a maintained parser.","message":"Node engine requirement '>=0.4.0' is extremely old; newer Node versions may have compatibility issues or missing globals.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run in a browser or use a shim like 'global.window = global;' in Node.js.","cause":"The package assumes a browser environment with 'window' global.","error":"ReferenceError: window is not defined"},{"fix":"Use named import: import { parse } from 'esprima-six-jpike'.","cause":"Incorrect import syntax (e.g., using default import instead of named import).","error":"TypeError: esprima is not a function"},{"fix":"Use the 'ecmaVersion' option in a modern parser like 'acorn', or rewrite to ES5.1.","cause":"The code contains ES6+ syntax that the harmony fork does not support fully.","error":"SyntaxError: Unexpected token ILLEGAL"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}