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

angioc

v0.0.4

Published

A simple ioc inspired by angular

Downloads

29

Readme

#angioc

A simple library of inversion of control, following the dependency injection pattern. This library is inspired by the angular ioc.

Install

With npm

npm install angioc

With bower

bower install angioc

Import

AMD loader

define('myApplication', ['angioc'], function() {
    ...
});	

Node.js

var angioc = require('angioc');

Plain HTML5

<script src="angioc.min.js"></script>

Introduction

Angioc instance let you register different components. Each type of component has some specific options. If you register one component by file, you don't need to load the files in any order. There is no file path dependencies, angioc provides you the dependencies you need.

How to use

Register class

Register a class.

angioc
    .register('customerService', Service)
    .asClass()
    .withDependencies(['customerDataService', 'purchaseDataService']);

function Service(customerDataService, purchaseDataService) {
    var self = this;
    
    // ...
}

Register a singleton class.

angioc
    .register('customerController', Controller)
    .asClass()
    .asSingleton()
    .withDependencies(['customerService', 'parameters']);
    
function Controller(customerService, parameters) {
    var self = this;
    
    // ...
}

Register a constant.

var parameters = {
    customerCount: 5
};

angioc
    .register('parameters', parameters)
    .asConstant();

Resolve dependencies

Resolve dependency names and inject them in the given function.

angioc.resolve(['customerController', 'parameters'], function (controller, myConstantParameters) {
    // ...
});

Angioc does not inject the class definition but a class instance, following the specified configuration at registering.

Inject dependencies for better testing

To help you testing your application that is using angioc, you can install angioc-mocks. It helps you inject dependencies in a beforeEach() (mocha, jasmine) and replace injected member by mock objects.

With bower

bower install angioc-mocks --save-dev

Or npm

npm install angioc-mocks --save-dev

Repo : https://github.com/pierregillon/angioc-mocks

How to develop

Run unit test

gulp test

Run unit tests in continuous mode

gulp test-dev

Run example tests

gulp test-example