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

pinocchio-js

v1.2.2

Published

High-performance WebAssembly bindings for the Pinocchio rigid body dynamics library

Readme

Pinocchio-js

Pinocchio-js WASM is a port of the Pinocchio rigid body dynamics library to WebAssembly, enabling high-performance robot dynamics in the browser and Node.js.

Examples

A project based on Pinocchio-js Robot-analyzer.io

Features

  • Core Algorithms: RNEA (Inverse Dynamics), Forward Kinematics, Center of Mass, Jacobian.
  • URDF Parsing: Custom JavaScript parser ensuring compatibility with Pinocchio's model structure.
  • Cross-Platform: Runs in Browsers (Chrome, Firefox, Safari) and Node.js.
  • Lightweight: ~600KB (gzipped) WASM binary.
  • Zero-Dependency Runtime: No external logical dependencies for the basic WASM module (excluding the optional URDF parser).

Installation

1. NPM (Recommended)

The easiest way to use the library in your Node.js or browser projects is to install the pre-compiled NPM package:

npm install pinocchio-js

2. GitHub Releases

You can download the pre-compiled WebAssembly binaries (pinocchio.js and pinocchio.wasm) directly from the Releases page.

3. Building from Source

Prerequisites

  1. Emscripten SDK (emsdk): Required for compiling C++ to WASM.
    git clone https://github.com/emscripten-core/emsdk.git
    cd emsdk
    ./emsdk install latest
    ./emsdk activate latest
    source ./emsdk_env.sh
  2. CMake: Version 3.10 or higher.
  3. Python 3: For build scripts.

Building from Source

We provide a one-step build script build.sh.

./build.sh

This will:

  1. Download dependencies (Pinocchio, Eigen3, Boost headers) automatically.
  2. Configure the project with emcmake.
  3. Compile to build/pinocchio.js and build/pinocchio.wasm.

Usage

1. Browser

Serve the project root:

python3 -m http.server 8080

Open http://localhost:8080/tests/browser/index.html.

2. Node.js

Install the XML DOM polyfill (required for URDF parsing in Node):

npm install

Run the smoke test:

npm run test:smoke

API Reference

pin.Model

  • nq, nv, njoints: System dimensions.
  • addJoint(...): Adds a joint (Internal use).

pin.Data

  • Constructed from Model.
  • Stores scratchpad data (velocities, accelerations, forces).

Algorithms

  • pin.rnea(model, data, q, v, a): Recursive Newton-Euler Algorithm (Inverse Dynamics). Returns torques.
  • pin.forwardKinematics(model, data, q): Updates joint placements.
  • pin.centerOfMass(model, data, q): Computes CoM position.
  • pin.computeTotalMass(model): Returns total mass.

URDF Parser (src/urdf-parser.mjs)

  • parseURDF(xmlString): Parses raw XML into intermediate JS object.
  • buildPinocchioModel(pin, urdfData): Converts intermediate object to pin.Model.
    • Note: Implements "Fixed Joint Reduction". Fixed joints in URDF are fused into their parent joints to ensure numerical stability and correct behavior in Pinocchio.

Testing

Run the full test suite (Node.js required):

npm test

This runs:

  • Math tests (SE3, Inertia)
  • Model tests (Joint creation)
  • Algo tests (RNEA, COM)
  • URDF tests (Loading real robot descriptions)

Contributing

  1. Fork the repository.
  2. Run npm install and ./build.sh to ensure clean environment.
  3. Add tests for new features in tests/.
  4. Submit a Pull Request.

License

BSD-2-Clause