Skip to content

finalclass/dependency-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DependencyResolver

Example usage

var DependencyResolver = require('dependency-resolver'); //if in node env

var resolver = new DependencyResolver(); //or new grom.DependencyResolver(); when in browser env
resolver.add('a');
resolver.add('b');
resolver.add('c');
resolver.add('d');

resolver.setDependency('d', 'c');
resolver.setDependency('c', 'b');
resolver.setDependency('c', 'a');
resolver.setDependency('b', 'a');

resolver.resolve('d'); //=> ['a', 'b', 'c', 'd'];
resolver.sort(); // => ['a', 'b', 'c', 'd'];

resolver.resolve(serviceName:string):string[]

Resolves dependencies of serviceName.

resolver.sort():string[]

Returns all services in the right order.

License - ISC

ISC is even simpler MIT like license

About

Dependency Resolver class

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published