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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yowasp/clang

v22.0.0-git20542-10

Published

LLVM/Clang/LLD toolchain targeting WebAssembly

Readme

YoWASP Clang/LLD package

This package provides a complete Clang/LLD toolchain built for WebAssembly and targeting WebAssembly as well. See the overview of the YoWASP project for details.

At the moment, this package only offers an API allowing to run Clang and LLD in a virtual filesystem; no executables are provided. Note that if you are importing .../gen/bundle.js directly, you must use it as a module.

Examples

All examples below are written for Node.js; to run them, install @yowasp/clang first. The C/C++ code can be compiled equally well in the browser and other runtimes, but WASI is unevenly supported.

Hosted C++ executable

import { runClang } from '@yowasp/clang';
const { meow } = await runClang(['clang++', 'test.cc', '-o', 'meow'],
    {"test.cc": `#include <iostream>\nint main() { std::cout << "meow++" << std::endl; }`});

import { WASI } from 'node:wasi';
const wasi = new WASI({ version: 'preview1' });
const module = await WebAssembly.compile(meow);
const instance = await WebAssembly.instantiate(module,
    {wasi_snapshot_preview1: wasi.wasiImport});
wasi.start(instance);
// prints "meow++"

Freestanding C library

import { runClang } from '@yowasp/clang';
const { 'a.out': wasm } = await runClang(['clang', '-nostdlib', '-Wl,--no-entry', 'test.c'], {
    'test.c': 'int add(int a, int b) __attribute__((export_name("add"))) { return a + b; }'});

const module = await WebAssembly.compile(wasm);
const instance = await WebAssembly.instantiate(module);
console.log('add(1, 2) =', instance.exports.add(1, 2));
// prints "add(1, 2) = 3"

API reference

This package provides two functions:

  • runLLVM
    • The first argument is the utility to run: one of addr2line, ar, c++filt, dwarfdump, nm, objcopy, objdump, readobj, ranlib, size, strip, symbolizer, wasm-ld.
  • runClang
    • The first argument is either clang or clang++.
    • Due to WASI limitations (an inability to spawn subprocesses), this function is a wrapper that parses the output of clang -### or clang++ -### to determine the sequence of processes to run. The parser was written with great care and handles many common exceptional conditions (e.g. the -help option), but the resulting function still deviates from how a standard Clang compiler driver would behave. Please report any deviations that impact your workflow as issues.

For more detail, see the documentation for the JavaScript YoWASP runtime.

Versioning

The version of this package is derived from the upstream LLVM package version in the X.Y.Z-S-M or X.Y.Z-M format, where the symbols are:

  1. X: LLVM major version
  2. Y: LLVM minor version
  3. Z: LLVM patch version
  4. S: gitK for unreleased LLVM snapshots, rcN for LLVM release candidates, not present for LLVM releases
  5. M: package build version; disambiguates different builds produced from the same LLVM source tree

With this scheme, there is a direct correspondence between upstream versions and SemVer NPM package versions.

License

This package is covered by the Apache 2 license, which is the same as the (base) LLVM license.