
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
toast-loader
Advanced tools
Toast is a promise-based asset loader for JS and CSS files. It aims to optimize web site performance by loading and deferring the needed assets only.
Since it have a small footprint Toast can be loaded as soon as possible on the HEAD
tag.
As a side note: Toast is packaged as an UMD module.
yarn add toast-loader
toast.css(url: string): Promise
toast.js(url: string): Promise
toast.all(urls: string[]): Promise
if (dark_mode === true) {
toast.css('styles/dark.css')
} else {
toast.css('styles/light.css')
}
toast.js('http://some.cdn.com/jquery.js').then(() => {
toast.js('http://some.cdn.com/jquery-myplugin.js').then(() => {
$('.someClass').myPlugin()
})
})
toast.all([
'assets/css/styles1.css',
'assets/css/styles2.css',
'assets/js/script1.js',
'assets/js/script2.js',
'assets/js/script3.js',
]).then(() => {
console.log('Everything has been loaded, yay!')
})
IE9-IE11 and Edge never trigger error
event on CSS loading if something went wrong. Keep this in mind when you're using catch
promise block with Toast.
If you want to look at some feature supporting details, you can take a look at this compatibility table.
It worth noting that Toast has been designed to be compatible with modern browsers and IE9+. Supporting other older browsers would have a negative impact on the library size.
Install the dependencies with:
yarn install
Build the lib with:
yarn build
Tests are written with Mocha and Chai and run with Karma on LambdaTest.
First, you will need to set up you're own environment:
LT
command is accessible (e.g. in the PATH
).bashrc
:export LT_USERNAME="<your_username>"
export LT_ACCESS_KEY="<your_access_key>"
Finally, you can run the tests with:
yarn test
They will be run under the following browsers:
If needed, you can run the tests under only one browser with:
yarn chrome
yarn firefox
yarn edge
yarn ie11
yarn ie10
yarn ie9
yarn safari
Licensed under the MIT license.
FAQs
A modern JS/CSS asset loader
The npm package toast-loader receives a total of 368 weekly downloads. As such, toast-loader popularity was classified as not popular.
We found that toast-loader 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.