https://github.com/ericmorand/twig-deps
https://github.com/ericmorand/twig-deps
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ericmorand/twig-deps
- Owner: ericmorand
- License: apache-2.0
- Created: 2017-03-24T05:23:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-18T12:45:20.000Z (about 8 years ago)
- Last Synced: 2025-10-30T09:38:01.453Z (8 months ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twig-deps
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
Walk the dependency graph of a [Twig](http://twig.sensiolabs.org/)
template.
## Installation
```bash
npm install twig-deps
```
# Example
``` js
var TwigDeps = require('twig-deps');
var depper = new TwigDeps();
var entry = '/path/to/your/template.twig';
depper.on('data', function (dependency) {
// do something with dependency
});
depper.on('missing', function (dependency) {
// do something with missing dependency
});
depper.on('error', function (error) {
// do something on error
});
depper.end(entry);
```
## Contributing
* Fork the main repository
* Code
* Implement tests using [node-tap](https://github.com/tapjs/node-tap)
* Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue
## License
Apache-2.0 © [Eric MORAND]()
[npm-image]: https://badge.fury.io/js/twig-deps.svg
[npm-url]: https://npmjs.org/package/twig-deps
[travis-image]: https://travis-ci.org/ericmorand/twig-deps.svg?branch=master
[travis-url]: https://travis-ci.org/ericmorand/twig-deps
[daviddm-image]: https://david-dm.org/ericmorand/twig-deps.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/ericmorand/twig-deps
[coveralls-image]: https://coveralls.io/repos/github/ericmorand/twig-deps/badge.svg
[coveralls-url]: https://coveralls.io/github/ericmorand/twig-deps