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

@spinframework/build-tools

v1.0.6

Published

This pacakge provides tooling for building wasm components from JavaScript source code.

Readme

@spinframework/build-tools

This pacakge provides tooling for building wasm components from JavaScript source code.

Contents of the package

Build Tool CLI

The package also provides a node executable j2w that enables compiling JS source code to wasm components.

$ npx j2w --help
Options:
      --help     Show help                                             [boolean]
      --version  Show version number                                   [boolean]
  -i, --input    Path to the input file                               [required]
  -o, --output   Path to the output file             [default: "component.wasm"]
      --aot      Enable Ahead of Time compilation                      [boolean]
  -d, --debug    Enable JavaScript debugging                           [boolean]

Note: The input source must be JavaScript. Use tsc or a bundler to first translate source code in TypeScript or other languages.

wit-tools crate

This crate provides tools for interacting with wit files. It is compiled into a wasm component and then consumed from the CLI.

Webpack Plugin

The webpack plugin can be found at ./plugins/webpack/index.js. It can be used to add externals (modules that will be available at runtime) to the config automatically based on the wit imports of the packages being bundled. The plugin needs to be initialized before it can be used. The initialization is async, so it has to be awaited. A example usage:

import SpinSdkPlugin from "@spinframework/build-tools/plugins/webpack/index.js";
const config = async () => {
    return {
        ...
        plugins: [
            await SpinSdkPlugin.init()
        ]
    }
}

export default config

How the Build System Works

The build system works by parsing through the dependencies of a package as defined in the package.json. It recursively parses the dependencies to parse out all the package that have a wit dependency. The list of wit dependencies is then used to create a merged target world which is the union of all the dependencies.

Configuring package.json for wit Dependencies

For packages that leverage wit dependencies, they need to configure the package.json to include information about the location of the wit, the target world and the package name. The configuration needs nested under a witDependencies field be under the config field of the package.json. An example configuration:

...
"config": {
    "witDependencies": [
      {
        "witPath": "./wit",
        "package": "spinframework:[email protected]",
        "world": "wasi-cli"
      }
    ]
  }
...

Testing the package

The package has some tests for the wit dependency parser and can be run using

npm run test

Note: Make sure to have a new enough version of node.jsthat can run typescript natively.