Package Exports
- tree-visitor-async
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tree-visitor-async) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Tree Visitor Async
Visit nodes in the tree asynchronously and sequentially.
Like Tree Visitor, but actions accept an additional callback function that should be called when it's done processing the node.
API
var VisitorAsync = require('tree-visitor-async');
var nodes = [
{ type: 'import', value: 'path/to/file1' },
{ type: 'import', value: 'path/to/file2' },
];
var visitorAsync = new VisitorAsync({
import: function (visitor, importNode, done) {
fs.readFile(importNode.value, 'utf8', done);
}
});
visitorAsync.visit(nodes, function (err) {
if (err) throw err;
});visit() also accepts a callback function that will be called when all node in the tree has been processed.