
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@dan503/load-js
Advanced tools
A small function for loading a js file before running code. It will only ever load the file once per page load even if called multiple times.
A small function for loading a js file before running code.
This function is ideal for loading up something like a polyfill before running code that is dependant on that polyfill.
Install using npm which comes bundled with Node.js.
npm i @dan503/load-js
// Import using one of these 2 methods
import loadJS from '@dan503/load-js' // ES Module import syntax
var loadJS = require('@dan503/load-js').default // Common JS import syntax
// Use the first parameter to point to where the external js file needs to be downloaded from.
loadJS('https://www.website.com/js-file.js', () => {
// The 2nd parameter is a callback function.
// The callback will be called once the JS file has finished downloading.
})
It will only ever download the target file once per page load even if called multiple times.
If the script has already been downloaded, it will trigger the callback function immediately in a synchronous fashion.
It will call all of the callbacks in the order that they were declared in when the script has finished loading.
As you can see from the usage example above, the usage syntax is extremely simple and easy to remember.
This project uses Cypress end to end tests to ensure the function does what it is supposed to.
This function has been written in TypeScript so it has full TypeScript support built in.
FAQs
A small function for loading a js file before running code. It will only ever load the file once per page load even if called multiple times.
The npm package @dan503/load-js receives a total of 13 weekly downloads. As such, @dan503/load-js popularity was classified as not popular.
We found that @dan503/load-js 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.