npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sylphx/synth-wasm-js

v0.1.2

Published

High-performance JavaScript/TypeScript parser compiled to WebAssembly (ES2024)

Downloads

387

Readme

@sylphx/synth-wasm-js

High-performance JavaScript/TypeScript parser compiled to WebAssembly.

Features

  • ES2024 syntax - Full support for modern JavaScript
  • Fast - 175 MB/s throughput, ~7μs per KB
  • Compact - 48KB WASM binary
  • Zero dependencies - Just the WASM module

Installation

bun add @sylphx/synth-wasm-js

Usage

import { parse, parseCount, parseBinary, NodeKind } from '@sylphx/synth-wasm-js'

// Parse to structured AST
const result = await parse('const x = 1;')
console.log(result.nodes) // Array of ASTNode

// Quick node count (for validation)
const count = await parseCount('function foo() {}')
console.log(count) // 5

// Maximum performance (raw binary)
const binary = await parseBinary('class Foo {}')

API

parse(source: string): Promise<ParseResult>

Parse JavaScript and return a structured AST.

const result = await parse('const x = 1 + 2;')

// result.nodes is an array of ASTNode:
// - kind: NodeKind (Program, VariableDeclaration, etc.)
// - flags: node flags (const, let, async, etc.)
// - start: source start offset
// - end: source end offset
// - extra: additional data (e.g., child count)

parseBinary(source: string): Promise<Uint8Array>

Parse to compact binary format for maximum performance.

Binary format:

  • Header: [node_count: u32]
  • Nodes: 16 bytes each (kind: u8, flags: u8, pad: u16, start: u32, end: u32, extra: u32)

parseCount(source: string): Promise<number>

Returns only the node count. Useful for benchmarking.

tokenize(source: string): Promise<number>

Returns token count. Useful for benchmarking the lexer.

Supported Syntax

  • Declarations: const, let, var, function, class, import, export
  • Statements: if, for, for-in, for-of, while, do-while, switch, try/catch/finally, return, throw, break, continue
  • Expressions: Binary, unary, call, member, new, arrow functions, async/await, yield, template literals, object/array literals, spread, optional chaining, nullish coalescing
  • Patterns: Array destructuring, object destructuring, rest elements

Performance

| Metric | Value | |--------|-------| | Throughput | 175 MB/s | | Per 1KB parse | ~7μs | | WASM size | 48KB |

Credits

Built with Rust and wasm-bindgen.

License

MIT