
Product
Introducing Custom Tabs for Org Alerts
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.
fetch-files
Advanced tools
Download files using presets.
Install with npm
$ npm i fetch-files --save
var FetchFiles = require('fetch-files');
var downloader = new FetchFiles({destBase: 'foo/bar'});
Create an instance of FetchFiles with the given options.
Params
options {Object}Store a preset with the given configuration values.
Params
name {String}: Preset name, e.g. githubconfig {Object}returns {Object}: Returns FetchFiles for chainingExample
downloader.preset('github', {
url: 'https://raw.githubusercontent.com',
fn: function (preset, config) {
config.pathname = config.url.split('/').slice(-3).join('_');
return preset.url;
}
});
Add a URL to the download queue.
Params
url {String}config {Object}: The configuration to use for the URL.returns {Object}: Returns FetchFiles for chainingExample
downloader.queue('/assemble/assemble/v0.6.0/.verb.md', {preset: 'github'});
Fetch all files in the queue.
Params
cb {Function}: callbackreturns {Object}: Returns FetchFiles for chainingExample
downloader.fetch(function (err, res) {
console.log(res);
});
Fetch three files from three different GitHub repos:
var FetchFiles = require('fetch-files');
var downloader = new FetchFiles({destBase: 'foo/bar'});
downloader.preset('github', {
url: 'https://raw.githubusercontent.com',
fn: function (preset, config) {
config.pathname = config.url.split('/').slice(-3).join('_');
return preset.url;
}
})
.queue('/assemble/assemble/v0.6.0/.verb.md', {preset: 'github'})
.queue('/jonschlinkert/template/master/.verb.md', {preset: 'github'})
.queue('/verbose/verb/master/.verb.md', {preset: 'github'})
.fetch(function (err, res) {
if (err) console.error(err);
console.log(res)
})
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on August 19, 2015.
FAQs
Download files using presets.
We found that fetch-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.