Dear all,
Bower API is based on asynchronous callbacks as described in the documentation. I am trying to use it with node the following way:
var dependenciesTree = {};
var _underscore = require('underscore');
bower.commands.list({paths:true},bowerConfig).on('end', function(tree){
dependenciesTree = tree;
});
// Because of _underscore.pick apply signature, this is required
var prodDependencies = _underscore.pick(dependenciesTree, _underscore.keys(bowerConfig.dependencies));
var devDependencies = _underscore.pick(dependenciesTree, _underscore.keys(bowerConfig.devDependencies));
The following code does not yield the correct result because when entering the assignment of **prodDependencies** and **devDependencies**. I need it to be synchronous because it's inside my Gruntfile, so I could push the locking at a later stage, but I will have the same problem sooner or later.
How do I correctly wait for the command to be completed?
Thank you very much
Best Regards
Edmondo