
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
async-loader-cdn
Advanced tools
Using npm:
$ npm i async-loader-cdn
The AsyncLoaderCDN is a module that exposes a configurable class, where it has just one method: loader. This method
is responsible for reading an informed list (either a fixed list or a firebase return), locating the item specified as a
parameter in the method and uploading all necessary files. The load method returns a Promise when resolved it contains
the global reference of what was loaded.
As some libraries are very extensive and large, including them in the project even with tree shaking, code splitting, in addition to requiring a more advanced configuration (just like in the case of webpack) can generate a final large file (like firebase library for example).
With AsyncLoaderCDN you can:
After installing, you can use in the following ways:
import asyncLoader from 'async-loader-cdn';
const list = [
{
global: '_',
name: 'lodash',
version: '',
files: ['https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.19/lodash.min.js'],
},
];
// use async/await
const myLoaders = new asyncLoader(files);
myLoaders
.load('lodash')
.then((_) => {
if (!_) return console.log('erro');
console.log(_.VERSION);
})
.catch((err) => console.log(err));
If you decide to use the list parameter, you need to send a list with this structure (contract):
const list = [
{
global: String, // global variable name of the module or project. Ex.: '$' if you want to load jQuery
name: String, // name that asyncLoaderCDN will look for when the load method is called. Ex.: 'jQuery'
version: <String|Int>, // if you need distribute multiple versions of the same module.
files: [String],
},
];
To contribute to the project, fork this repository;
After the PR is approved and the merge occurs, you can delete your branch.
FAQs
Load any CDN async
We found that async-loader-cdn 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.