Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nhz-io/dprs

Dependency Resolver
https://github.com/nhz-io/dprs

Last synced: 3 days ago
JSON representation

Dependency Resolver

Awesome Lists containing this project

README

        

# dprs



NPM Version



Travis Build


Coveralls


Bithound Status


License



Dependency Resolver

## Install
```bash
npm i -S dprs
```

## Usage

> Circular dependencies will never get resolved

```javascript
const DependencyResolver = require('dprs')

const dprs = new DependencyResolver()

dprs.add('foobar', ['foo', 'bar'])
dprs.add('barfoo', ['foo', 'bar'])
dprs.add('foo', ['bar'])

dprs.resolve('foobar') // -> false
dprs.resolve('barfoo') // -> false
dprs.resolve('foo') // -> false

dprs.resolve('bar') // -> true
dprs.resolve('foobar') // -> false
dprs.resolve('barfoo') // -> false

dprs.resolve('foo') // -> true
dprs.resolve('foobar') // -> true
dprs.resolve('barfoo') // -> true
```

## Dev

```sh
git clone https://github.com/nhz-io/dprs
cd dprs
npm i
npm start
```

### Coverage
```sh
npm run coverage
npm run report
```

## License

### [MIT](LICENSE)

## Version 1.0.3