Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floatdrop/deps-graph
Builds graph by BEM deps
https://github.com/floatdrop/deps-graph
Last synced: 22 days ago
JSON representation
Builds graph by BEM deps
- Host: GitHub
- URL: https://github.com/floatdrop/deps-graph
- Owner: floatdrop
- Created: 2014-08-10T17:08:56.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-26T18:03:50.000Z (about 10 years ago)
- Last Synced: 2024-10-28T00:04:51.943Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 578 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# deps-graph
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url]
This module constructs dependency graph of blocks, constructed with [BEM objects](https://github.com/floatdrop/gulp-bem#bem-object). It relies on `require` and `expect` properties in BEM objects to build connections between blocks.
`require` and `expect` should be `Array` of BEMObjects.
## API
### DepsGraph([parent])
Constructor. Can accept parent DepsGraph.
### DepsGraph.add(BEMObject...)
Returns: nothingStores [BEM object](https://github.com/floatdrop/gulp-bem#bem-object) in graph.
### DepsGraph.deps(bem)
Type: `Object`
Returns: `Array` of [BEM objects](https://github.com/floatdrop/gulp-bem#bem-object).Gets all dependencies for block. Returns dependencies in order, that defined by `require` and `expect` of corresponding BEM objects and levels of declaration.
It will throw `NotFound` exception, when `path` or any block in dependencies of blocks is not found.
## License
MIT (c) 2014 Vsevolod Strukchinsky, Vladimir Starkov
[npm-url]: https://npmjs.org/package/deps-graph
[npm-image]: http://img.shields.io/npm/v/deps-graph.svg?style=flat[travis-url]: http://travis-ci.org/floatdrop/deps-graph
[travis-image]: http://img.shields.io/travis/floatdrop/deps-graph.svg?branch=master&style=flat[depstat-url]: https://david-dm.org/floatdrop/deps-graph
[depstat-image]: http://img.shields.io/david/floatdrop/deps-graph.svg?style=flat[coveralls-url]: https://coveralls.io/r/floatdrop/deps-graph
[coveralls-image]: http://img.shields.io/coveralls/floatdrop/deps-graph.svg?style=flat