
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.
use-script-loader
Advanced tools
Inspired by scriptLoader2
npm install use-script-loader --save
const useScriptLoader = require('use-script-loader')
const [loading, script, error] = useScriptLoader('https://ajax.googleapis.com/ajax/libs/jquery/x.x.x/jquery.min.js')
if (loading) return <Spinner />
if (error) throw error
console.log(script.src); // Prints 'https://ajax.googleapis.com/ajax/libs/jquery/x.x.x/jquery.min.js'
// use jQuery here
object = useScriptLoader(src, [attrs], [parentNode], [skip])Append a <script> node with the given src URL to the <head> element in the DOM.
srcAny url that you would like to load. May be absolute or relative.
attrs (optional)An object that contains HTML attributes to set on the <script> tag. For
example, the value { id: 'hi' } would set the attribute id="hi" on the
<script> tag before it is injected.
parentNode (optional)The HTML node to which the <script> tag will be appended. If not specified,
defaults to the <head> tag.
skip (optional)If true, will not append script. Default value is false
array: [loading, script, error]Returns an array which can be destructed to [loading, script, error]
true till script is loadedMIT. Copyright (c) Eesa Abid.
FAQs
React.js script loader hook
We found that use-script-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.

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.