Package Exports
- goldwasher-needle
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 (goldwasher-needle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-goldwasher-needle
Plugin for goldwasher to add needle for easy HTTP requests. Uses retry for robustness. Requires goldwasher to work. If you want to run this as a web server/service, have a look at the module hapi-goldwasher.
Installation
npm install goldwasher-needleOptions
Options can be optionally passed in as the second parameter, as an object with a property goldwasher for goldwasher options, a property needle for needle options and a property retry for retry options. For instance:
var options = {
goldwasher: {
selector: 'h1'
},
needle: {
follow_max: 20,
read_timeout: 30000
},
retry: {
retries: 3
}
}Have a look at their respective doc pages for goldwasher, needle and retry for options available.
Example
var gn = require('goldwasher-needle');
gn('http://www.google.com', function(error, result) {
console.log(result);
});Advanced example
var gn = require('goldwasher-needle');
var url = 'http://www.google.com';
var options = {
goldwasher: {
selector: 'h1, h2, h3, h4, h5, h6, p'
}
};
gn(url, options, function(error, result) {
console.log(result);
});