Walk the dependency graph of a Twig template.
npm install twig-deps
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);
- Fork the main repository
- Code
- Implement tests using node-tap
- Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue
Apache-2.0 © Eric MORAND