
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.
Some useful response handlers for using [Fetch](https://github.com/github/fetch) API in the real world.
Some useful response handlers for using Fetch API in the real world.
Warning: doesn't come with Fetch or Promise, so you'll need to bring your own polyfill (unless you're using this module within Service Workers, where both fetch
and Promise
are already defined).
npm install --save fetchres
Or
bower install --save fetchres
var fetchres = require('fetchres');
fetch('https://mattandre.ws/my-json-endpoint')
.then(fetchres.json)
.then(function(data) {
// `data` is an object containing the data
// from the response, not a Response object
console.log(data);
})
.catch(function(err) {
if (err.name === fetchres.BadServerResponseError.name) {
// just a dodgy response
console.error(err);
} else if (err.name === fetchres.InvalidJsonError.name) {
// malformed json, probably
console.error('malformed json returned');
} else {
// something more serious could be wrong.
// probably want to investigate / send to
// error aggregation service
debugger;
}
});
FAQs
Some useful response handlers for using [Fetch](https://github.com/github/fetch) API in the real world.
We found that fetchres demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.