Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
external-load
Advanced tools
This small library helps you to load external javascript / css from url
This small function helps you to load external CSS / Javascript from url.
It's helpful if you are using some framework, and code that you wanted to use is not directly supported by that framework, and you don't want to put load scripts into your html (why? code splitting).
Load is a immediately invoked function which returns 3 functions that you may use;
Load.js()
Load.css()
Load.img()
This functions take url and return promise. In case off error, you can catch it.
import Load from 'external-load';
Load.js('https://js.stripe.com/v3/')
.then( () => {
// Stripe is now avaliable
const stripe = Stripe(environment.stripeKey);
})
.catch( error => {
console.log(error)
})
This function is taken from David Walsh's [Create a Basic Loader with JavaScript Promises](Create a Basic Loader with JavaScript Promises) tutorial. Reason I'm publishing is; It's been very useful for me, and It's hard to find the code.
FAQs
This small library helps you to load external javascript / css from url
The npm package external-load receives a total of 4 weekly downloads. As such, external-load popularity was classified as not popular.
We found that external-load 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.