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

sugar-boot

v0.7.0

Published

Sugar Boot application

Readme

sugar-boot is an little express bootstrap managing dependency injections and routes directly inside of classes.

Current status

Alpha version, creation on 18/09/15. There will be more in the near future.

Should be used with es6 babel

How it works

The sugar-boot module will look inside of a dist folder, to find components and routers. It then add them inside of an injector through di-injector and manage the application through this.

It's just an alpha, but feel free to try it and to me a feedback :-).

#Creation of a controller, Billing for example :

class Billing{
  constructor(billingService){
    this.billingService = billingService;
  }

  getAll(req, res){
    res.send(this.billingService.getAll());
  }
}


/* Allow Billing class to be injected or to inject some other objects */
Billing.Component = true;

/* Require an instance of BillingService in the constructor, based on di-injector external module */
Billing.diConstructor = ['BillingService'];

/* Tell /path with the concerned verb and the callback method (of the current class) */
Billing.Routes = [
  {verb:'get', path:'/billings', callback:'getAll'}
];

export default Billing;

#Creation of a service like this BillingService :

class BillingService{

 getAll(){
   return [{id:1,title:"First billing"},{id:2,title:"Second billing"}];
 }
}

/* Allow BillingService class to be injected or to inject some other objects */
BillingService.Component = true;
export default BillingService;

#Creation of the application

The default one :

/* Require the sugar-boot */
var boot = require('sugar-boot');

/* Boot the express server and watch inside of the dist folder to find components or routers */
boot.runFrom('./dist',['']).then(function(server){
 /* start the server on which port you need */
 server.start(8010);
});

The most advanced one :

/* Require the sugar-boot */
var boot = require('sugar-boot');

/* Binding librairie for external injection */
var binding = require('di-injector').Binding;

/* Boot the express server and watch inside of the dist folder to find components or routers, except in the dist/repo-not-needed */
boot.runFrom('./dist', ['!dist/repo-not-needed'],[
 new Binding('MyDatabaseAccess',{toValue:mongoInstance}) // Allow you to make something like diConstructor = ['MyDatabaseAccess'] inside of a component (Component = true)
]).then(function(server){

 /* Use callback before routing*/
 server.expressInstance.use(path,middlewareCallback);

 /* start the server on which port you need */
 server.start(8010);
});