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

@doki-land/live2d-loader

v0.0.24

Published

Fetch and normalize Live2D model.json/model3.json, resolve npm: URLs, AssetResolver for moc/textures.

Readme

@doki-land/live2d-loader

Source resolution and asset loading for the live2d.ts runtime.

This is an implementation package. Most applications should load models through @doki-land/live2d.

✨ Features

  • Local and remote model settings URLs.
  • npm: model references resolved through a configurable CDN base.
  • Model settings normalization for supported formats.
  • Relative model, texture, and resource URL resolution.
  • Byte and JSON fetching.
  • Structured loading progress.
  • Injectable asset resolvers for custom hosts.

📦 Installation

pnpm add @doki-land/live2d-loader

🚀 Source Resolution

import { resolveModelSourceUrl } from "@doki-land/live2d-loader";

const url = resolveModelSourceUrl(
  "npm:[email protected]/assets/hijiki.model.json",
);

console.log(url);

Pin package versions in production so a remote registry or CDN cannot silently change the selected model assets.

🌐 Remote Assets

Remote models usually include several requests:

model settings
  -> MOC binary
  -> textures
  -> optional motions, expressions, physics, pose, and audio

Every referenced resource must be reachable under the browser's CORS and content-security policies. A settings file being accessible does not guarantee that its textures or binary assets are accessible.

🔌 Custom Hosts

Game engines and constrained hosts can provide a custom AssetResolver instead of teaching the loader about every file system or package container.

Appropriate custom resolvers include:

  • game-engine asset databases;
  • hashed build manifests;
  • mini-game package APIs;
  • service-worker caches;
  • authenticated asset gateways;
  • offline bundles.

Host adapters should translate their resource system into the shared resolver contract. They should not duplicate model settings normalization or MOC parsing.

📈 Progress Reporting

Loading progress is divided into meaningful stages such as settings, binary data, decode, and textures. Consumers should display the stage and normalized progress rather than guessing progress from the number of completed fetch calls.

Byte totals may be unavailable when a server omits Content-Length or streams encoded content. Interfaces must tolerate an unknown total.

🔒 Security

Remote model settings are untrusted input. Hosts should consider:

  • allowed schemes and origins;
  • maximum response sizes;
  • request timeouts and cancellation;
  • redirects;
  • MIME validation;
  • decompression and texture size limits;
  • credential forwarding;
  • content-security policy.

Do not attach privileged credentials to arbitrary model URLs.

🧪 Development

pnpm --filter @doki-land/live2d-loader typecheck
pnpm --filter @doki-land/live2d-loader test

Resolution changes should include cases for scoped packages, explicit versions, nested paths, malformed specifiers, relative URLs, and query/hash preservation where supported.

🤝 Contributing

Keep loading separate from model evaluation and rendering. New source schemes should have a clear deployment use case and deterministic resolution rules.

📄 License

See the repository license.