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

@asimojs/asimo

v7.0.0

Published

Type-safe asynchronous IoC for browser and server runtimes

Readme

asimo

🚀 Full Documentation · API Reference

A zero-dependency, fully type-safe Inversion of Control (IoC) container for TypeScript — browser and server.

import { syncIID, factory, createContainer } from "@asimojs/asimo";

interface Logger { log(msg: string): void; }
const LOGGER = syncIID<Logger>()("app.services.Logger");

const app = createContainer({
    name: "app",
    services: [
        factory({
            provide: [LOGGER],
            load: () => ({ log: (msg) => console.log(`[app] ${msg}`) }),
        }),
    ],
});

const logger = app.get(LOGGER);  // type: Logger
logger.log("hello world");

Why asimo?

  • Zero dependencies — ~2 KB gzipped, no decorators, no reflect-metadata
  • Full compile-time safety — missing dependencies, wrong IID types, retry-on-sync are all TypeScript errors, not runtime crashes
  • Automatic dependency inferencedependencies: [A, B] types the load context as Container<A | B>
  • Lazy bundles — wrap import() in bundle() and services load only on first access
  • Hierarchical containers — child containers inherit from parents, enabling request-scoped DI
  • Retry with exponential backoff — async services retry on failure, configurable per-service or globally
  • Runs everywhere — browser, Node.js, Bun, Deno, Cloudflare Workers

Installation

npm install @asimojs/asimo
pnpm add @asimojs/asimo
yarn add @asimojs/asimo

Quick Start

Define an IID token

import { syncIID, asyncIID } from "@asimojs/asimo";

interface Logger { log(msg: string): void; }
const LOGGER = syncIID<Logger>()("app.Logger");

interface Config { apiUrl: string; }
const CONFIG = asyncIID<Config>()("app.Config");

Create a container with services

import { factory, bundle, createContainer } from "@asimojs/asimo";

const app = createContainer({
    name: "app",
    services: [
        // Sync service — retrieved with get()
        factory({
            provide: [LOGGER],
            load: () => ({ log: (msg) => console.log(msg) }),
        }),
        // Async service — retrieved with fetch()
        factory({
            provide: [CONFIG],
            load: async () => {
                const resp = await fetch("/config.json");
                return resp.json();
            },
        }),
        // Lazy bundle — loaded on first access
        bundle({
            provide: [ANALYTICS],
            load: () => import("./analytics-bundle"),
        }),
    ],
});

Retrieve services

const logger = app.get(LOGGER);              // synchronous, type: Logger
const config = await app.fetch(CONFIG);       // asynchronous, type: Config
const optional = app.getOptional(OPTIONAL);   // null if not registered

Services with dependencies

factory({
    provide: [USER_SERVICE],
    dependencies: [DB, LOGGER],
    load: (c) => {
        // c is typed as Container<typeof DB | typeof LOGGER>
        const db = c.get(DB);
        const log = c.get(LOGGER);
        return new UserService(db, log);
    },
});

One service, multiple interfaces

When a service implements several interfaces, list them all in provide:

factory({
    provide: [LOGGER, AUDITOR],
    load: () => new ConsoleLogger(),  // implements both Logger and Auditor
});

Per-request container

const reqCtx = createContainer({
    name: "request-42",
    extends: [app],  // inherits all app services
    services: [
        factory({ provide: [REQUEST], load: () => currentRequest }),
    ],
});

Documentation

Full documentation is available at asimojs.github.io/asimo:

Development

| Command | Description | |---|---| | pnpm test | Run tests | | pnpm build | Build the library | | pnpm docs:dev | Start docs dev server | | pnpm docs:build | Build docs to docs-dist/ | | pnpm lint | Lint source |

License

MIT