Skip to content

JSLike, a CSP-Safe Interpreter for JS, TS, JSX, TSX in JS

Build & Package

A production‑ready JavaScript interpreter that executes ES6+ code, JSX, and TypeScript/TSX with React integration without using eval() or new Function().

JavaScript Latest v1.8.5 · 27d ago Security brief →

Features

  • Full ES6+ JavaScript support (classes, destructuring, arrow functions, etc.)
  • Native JSX parsing and execution without pre‑transformation
  • TypeScript and TSX module support with bundled @sveltejs/acorn-typescript parser
  • React integration via custom module resolver for hooks and components
  • CSP‑safe tree‑walking interpreter (no eval or new Function)
  • REPL, CLI, and programmatic API for interactive and file execution

Recent releases

View all 10 releases →
v1.8.5 Bug fix

Fixed support for super.method() calls in arrow-function class fields on derived classes.

Full changelog

Fixed

  • Support super.method() inside arrow-function class fields on derived classes.
  • Bind super for prototype methods and class field initializers to parent prototype members with the derived instance as receiver.
  • Cover computed super[...]() calls, async parent methods, multi-level inheritance chains, and constructor super(...) compatibility.

Verification

  • npm run build passed. Existing wang-prism CommonJS warning remains unchanged.
  • npm test: 54 passed, 1359 passed | 4 skipped.
  • Issue #13 repro returns base.
  • npm pack --dry-run produced jslike-1.8.5.tgz.
  • Published to npm as [email protected] with latest dist-tag.

Fixes #13.

v1.8.4 Bug fix

Fixed binding of identifiers from defaulted object and array destructuring parameters.

Full changelog

Fixed

  • Bind identifiers from defaulted object and array destructuring parameters in functions, async callbacks, methods, and constructors.
  • Preserve nested destructuring defaults and rest parameter behavior through shared parameter binding logic.

Verification

  • npm run build passed. Existing wang-prism CommonJS warning remains unchanged.
  • npm test: 54 passed, 1351 passed | 4 skipped.
  • Issue #12 repro shape returns HiHi!.
  • npm pack --dry-run produced jslike-1.8.4.tgz.
  • Published to npm as [email protected] with latest dist-tag.

Fixes #12.

v1.8.3 Bug fix

Fixed JavaScript class instance field initialization across inheritance hierarchies.

Full changelog

Fixed

  • Initialize JavaScript class instance fields, including arrow function fields that capture this.
  • Apply inherited base class field initializers during super(...) and implicit subclass construction.
  • Preserve native class-field initialization order across base constructors, derived fields, computed fields, and multi-level inheritance.

Verification

  • npm run build passed. Existing wang-prism CommonJS warning remains unchanged.
  • npm test: 53 passed, 1344 passed | 4 skipped.
  • Issue #11 repro returns {"type":"function","value":42,"keys":["visit","v"]}.
  • npm pack --dry-run produced jslike-1.8.3.tgz.
  • Published to npm as [email protected] with latest dist-tag.

Fixes #11.

v1.8.2 Bug fix

Fixed missing-method errors when reflection traps throw during method suggestion collection.

Full changelog

Fixed

  • Prevent enhanced method suggestions from invoking strict function caller / arguments accessors or other throwing accessor properties while constructing missing-method errors.
  • Keep missing-method errors best-effort when reflection traps throw during method suggestion collection.

Verification

  • npm run build passed. Existing wang-prism CommonJS warning remains unchanged.
  • npm test: 52 passed, 1336 passed | 4 skipped.
  • npm pack --dry-run produced jslike-1.8.2.tgz.
  • Published to npm as [email protected] with latest dist-tag.

Fixes #10.

v1.8.1 Bug fix

Fixed handling of mixed import bindings preserving runtime values.

Full changelog

Fixed

  • Elide regular TypeScript imports whose local bindings are used only in type positions, matching TypeScript transpilation behavior.
  • Preserve runtime binding for mixed imports, default imports, namespace imports, and TSX component imports when they are referenced in value positions.

Verification

  • npm run build passed. Existing wang-prism CommonJS warning remains unchanged.
  • npm test: 52 passed, 1332 passed | 4 skipped.
  • Corrected issue #9 repro against dist/index.cjs returns 7.
  • Published to npm as [email protected] with latest dist-tag.

Fixes #9.

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

About

Stars
12
Forks
1
Languages
JavaScript TypeScript

Install & Platforms

Install via
npm

Beta — feedback welcome: [email protected]