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

@rtjkro/mljs

v1.0.0

Published

A JS library to run ML tasks on browser

Readme

mljs

This is a JS library that provides ML capabilities on browsers using ONNX runtime web.


Features

Below is a list of features available:

  1. Spatial image

Spatial image

This lets you convert images into spatial image on browsers. To do this, you need to embed your image element into a div element:

<div id="target_div">
    <img src="/your/image/src">
</div>

and simply pass the div element to the library:

const div_container = document.getElementById("target_div");
spatial_scene.convert_single_image(div_container, 4);

To achieve this, there are two models used:

  1. Depth Anything V2
  2. MI-GAN

The ONNX binaries for these models can be found at this HuggingFace repository


Project structure

.
├── dist/
│   ├── index.js                          // Code generated by npm
│   └── ort-wasm-simd-threaded.jsep.wasm  // The ONNX runtime web WASM binary. This is copied from ONNX runtime NPM module.
├── src/
│   ├── demo                              
│   │   └── spatial-image                 // A directory containing a simple demo for the spatial scene feature
│   │       ├── index.html
│   │       └── script.js
│   ├── docs                            // Docs for each feature
│   ├── features                        // Contains the wrapper code that calls `models/` & `ui/`. Each feature such as spatial image is implemented here.
│   │   └── spatial-scene.ts
│   ├── models                          // Handles model inference.
│   │   ├── base-model.ts
│   │   ├── depth-estimation.ts
│   │   └── inpaint.ts
│   ├── package_loader                  // TODO.
│   │   └── TODO
│   ├── ui                              // Contains all UI-related code. For example, the code that animates the images from spatial image is written here.
│   │   └── animation.ts
│   └── utils                          // Just some utility functions....
│       ├── ort_tensor_manipulator.ts
│       └── type_converter.ts
├── index.ts                          // The file that esbuild refers to when building the package.
├── package.json
└── tsconfig.json

Building the package

To build the package, simply run npm run build


Dependencies

TODO


How to use the library for testing purposes

Currently, as package_loader hasn't been implemented yet, you need to do the following to use the library:

  1. Create a directory called model_binaries in the root directory & put the models there.
  2. Run the browser with web security disabled. For Chrome:
# On Windows
"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu --user-data-dir="C:\chromeTemp" --enable-features=SharedArrayBuffer

# On Linux
google-chrome --disable-web-security --user-data-dir="/temp/dev/" --enable-features=SharedArrayBuffer