NodeJS module
Gaël Métais edited this page Jan 6, 2015
·
17 revisions
Yellow Lab Tools is build around a core, which is a NodeJS module. The server uses the core, the CLI uses the core, and you can use if also if none of them fits your needs.
Don't hesitate to contact us before coding, your need could be the need of the many. So adding the functionality directly into YLT would probably be great.
npm install yellowlabtools --save
The core returns a promise you can use this way:
var ylt = require('../lib/index');
ylt(url).
then(function(data) {
console.log('Success');
console.log(JSON.stringify(data, null, 2));
}).fail(function(err) {
console.log('Test failed for url: ' + url);
console.error(err);
});
no options for the moment
The data
attribute provided in the .then()
is the entire JSON response. It can be long.