
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@wikipathways/cget
Advanced tools
cget
is a robust streaming parallel download manager with a filesystem cache and a simple API.
These docs are relevant to the new version under construction on Github, not yet published on NPM.
cget
and look at cached files..header.json
files.file://
URLs, bypassing the cache.cget
is perfect for downloading and caching various schema files,
and is used in cxsd
var Cache = require('cget').Cache;
// Store files in "cache" subdirectory next to this script.
var basePath = require('path').join(__dirname, 'cache');
// Initialize the download cache.
var cache = new Cache(basePath, {
// Allow up to 2 parallel downloads.
concurrency: 2
});
// Download a web page and print some info.
cache.fetch('http://www.google.com/').then(function(result) {
console.log('Remote address: ' + result.address.url);
console.log('Local cache path: ' + result.address.path);
console.log('HTTP status code: ' + result.status + ' ' + result.message);
console.log('Headers:');
console.log(result.headers);
console.log('Content:');
result.stream.pipe(process.stdout);
});
Running it the first time prints and saves the downloaded file and its headers including any redirects in local files, for example:
cache/www.google.com.header.json
cache/www.google.<COUNTRY>/<NONCE>
cache/www.google.<COUNTRY>/<NONCE>.header.json
The second time it prints the exact same output, but without needing a network connection.
The store
method supports caching a string with any URI (URL or URN) as the key:
var cache = new (require('cget').Cache)();
cache.store('urn:x-inspire:specification:gmlas:GeographicalNames:3.0', 'Some data');
cache.store('http://inspire.ec.europa.eu/schemas/ad/4.0', 'More data');
Copyright (c) 2015-2016 BusFaster Ltd
FAQs
Robust streaming parallel download manager with filesystem cache
We found that @wikipathways/cget demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.