
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
load-script2
Advanced tools
Works in the browser with browserify!
npm install load-script2
var load = require('load-script2')
load('foo.js', function (err, script) {
if (err) {
// print useful message
}
else {
console.log(script.src);// Prints 'foo'.js'
// use script
}
})
load-script
This package only supports browsers that use the standard DOM API, opting to drop non-standard browsers like IE8 and below. It also removes all the options, which aren't needed most of the time.
The minfied+gzipped size of load-script2
is 455B, compared to 645B for
load-script
.
load(src, [cb]) {}
Append a <script>
node with the given src
URL to the <head>
element in the DOM.
url
Any url that you would like to load. May be absolute or relative.
cb
A callback function of the following interface: function(err, script) {}
where
err
is an error if any occurred and script
is the script
node that was
appended to the DOM.
MIT. Copyright (c) Feross Aboukhadijeh.
FAQs
Dynamic script loading for modern browsers
The npm package load-script2 receives a total of 8,586 weekly downloads. As such, load-script2 popularity was classified as popular.
We found that load-script2 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
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.