Super lazy minimalist IOC container for node v5.5.
Specifically designed to support ES6 classes
Supports constructor injection and property autowiring
constctx=require('rocinante').create(__dirname);classProvider{constructor(){}}// this will register class under camelized class name// the instance will be available via ctx.providerctx.register(Provider);classConsumer{constructor(provider){this.provider=provider;}}ctx.register(Consumer)// inject provider object into the constructor.inject(ctx.provider);ctx// use external module.register('./../loader').inject(ctx.provider,{},'./some_file_somewhere');classMagiQ{constructor(){}importantMethod(){assert(this.provider,'should have a provider');assert(this.consumer,'should have a consumer');}}ctx//override default registration key.register(MagiQ,"que")// autowire these properties, so they could be // used by class methods .autowire(ctx.provider,ctx.consumer);classSuperLazy{constructor(provider,consumer,que){this.provider=provider;this.consumer=consumer;this.que=que;}}ctx.register(SuperLazy)// this will inject dependencies inferred from constructor // parameter names.inject();// get an instance from the contextvarque=ctx.que;//do something with itque.importantMethod();