
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
depject-scripts
Advanced tools
apply depject to a script tags.
Javascript modules have just come full circle - originally, we just concatenated script tags,
then we loaded modules with require() now depject helps you use script tags again.
depject enables you to somewhat specify the intefaces you need from dependency and describe the interfaces you give to dependants, and is intended for cases where you want a looser coupling than npm provides - when you want to be able to easily switch out whole layers of modules.
depject-scripts enables you to take anything you would pass to combine and add it as a script tag,
wrapped in a expose(module) call.
Note, you must first load depject-scripts/bundle.js, and your app must give app plug, which
will be called at startup.
The following works (although in practice, you'll probably load files rather than embed the script tags)
<script src=depject-scripts/bundle.js></script>
<script>
expose({
needs: {decorate: 'reduce'},
gives: 'hello',
create: function (sockets) {
return function (name) {
return sockets.decorate(name)
}
}
})
</script>
<script>
expose({
gives: 'decorate',
create: function () {
return function (name) {
return name.toUpperCase()
}
}
})
</script>
<script>
expose({
gives: 'decorate',
create: function () {
return function (name) {
return 'Hello, ' + name
}
}
})
</script>
<script>
// depject-scripts runs the first `app` plug once everything is loaded.
// so this needs to be provided as initial starting point otherwise your
// program won't do anything.
expose({
gives: 'app',
needs: {hello: 'first'},
create: function (api) {
return function () {
//add text to page and console
var s = api.hello('depject')
document.body.appendChild(document.createTextNode(s))
console.log(s)
}
}
})
</script>
MIT
FAQs
apply depject to a script tags.
The npm package depject-scripts receives a total of 1 weekly downloads. As such, depject-scripts popularity was classified as not popular.
We found that depject-scripts 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.