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

@bittrd/siccly

v0.0.5

Published

(S)imple (I)nversion of (C)ontrol (C)ontainer (ly)

Downloads

18

Readme

Siccly - Simple Inversion of Control Container

npm (scoped) Build Status Coverage Status Conventional Commits

Usage

Container

Create your di container file (I like to start simple with a siccly.ts file in the root of my project).

You can put these files wherever works for you though if you want more structure.

// "src/siccly.ts"
import { Kernel } from '@bittrd/siccly';
import { TYPES } from './types';
import { MyClass } from './my-class';
import { MyInterfaceImplementation } from './my-interface-implementation';
export const container = new Kernel();

container.bind(TYPES.MyInterface).toSingleton(MyInterfaceImplementation);
container.bind(MyClass).toClass(MyClass);

Types

In addition to the container, you need a place to handle interfaces as they are not value types in javascript the way objects are. (I usually create a types.ts file next to siccly.ts)

// "src/types.ts"
import { Type } from '@bittrd/siccly';
import { MyInterface } from './my-interface';
export const TYPES = {
  MyInterface: Type<MyInterface>('MyInterface'),
};

Interfaces

Interfaces are easy, create them as you normally would. They get annotated using the Type<T> helper function inside of "src/types.ts" see Types

// "src/my-interface.ts"
export interface MyInterface {
  isAwesome(): boolean;
}

Classes

Classes are just as easy, and need no extra annotation. They can be passed directly into the bind methods on the kernel as-is.

// "src/my-class.ts"
export class MyClass {
  isNifty(): boolean {
    return true;
  }
}

Injection

In order to use injection in your class, create it as you normally would. Then add a static inject = [] with an array of the types in order that you want injected into your constructor.

// "src/my-interface-implementation.ts"
import { MyInterface } from './my-interface';
import { MyClass } from './my-class';
export class MyInterfaceImplementation implements MyInterface {
  static inject = [MyClass];
  constructor(private readonly nifty: MyClass) {}
  public isAwesome(): boolean {
    return this.nifty.isNifty();
  }
}

Binding

In order for a class or interface to be usable from the DI container, you have to bind your interfaces/classes to their implementations.

Transient

To bind a class in transient scope, use one of the following methods.

import { Kernel } from '@bittrd/siccly';
import { MyClass } from './my-class';
import { MyInterface } from './my-interface';
import { TYPES } from './types';
const container = new Kernel();

// Default bind call with interface as first argument and implementation class as second.
container.bind(MyClass, MyClass);
// Method chaining with interface as argument to bind and implementation as argument to toClass
container.bind(MyClass).toClass(MyClass);
// With interface example.
container.bind(TYPES.MyInterface, MyClass);
container.bind(TYPES.MyInterface).toClass(MyClass);

Singleton

To bind a class in singleton scope, use one of the following methods.

import { Kernel } from '@bittrd/siccly';
import { MyClass } from './my-class';
import { MyInterface } from './my-interface';
import { TYPES } from './types';
const container = new Kernel();

// Method chaining with interface as argument to bind and instance of the object as argument to toSingleton
container.bind(MyClass).toSingleton(new MyClass());
// With interface example.
container.bind(TYPES.MyInterface).toSingleton(new MyClass());