dominject v5.3.0-next.1700554039.d5adeaba2f6e742e720507f0331c20ac96a4f75d
Inject scripts and styles into the DOM with duplicate prevention and completion callback support
Usage
var dominject = require('dominject')
var element = dominject({
type: 'script',
url: '//some-url.js',
attrs: {}, // attributes to be added to the injected dom element
timeout: 60 * 1000, // defaults to one minute that is allowed before the injection times out
next: function (err, el) {
// completion callback for once the element has completed or error'd
},
}) // returns the element that was injectednpm
Skypack
<script type="module">
import pkg from '//cdn.skypack.dev/dominject@^5.3.0'
</script>unpkg
<script type="module">
import pkg from '//unpkg.com/dominject@^5.3.0'
</script>jspm
<script type="module">
import pkg from '//dev.jspm.io/dominject@5.3.0'
</script>This project provides its type information via inline JSDoc Comments. To make use of this in TypeScript, set your maxNodeModuleJsDepth compiler option to 5 or thereabouts. You can accomlish this via your tsconfig.json file like so:
{
"compilerOptions": {
"maxNodeModuleJsDepth": 5
}
}Discover the release history by heading on over to the HISTORY.md file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
These amazing people are maintaining this project:
These amazing people have contributed finances to this project:
Become a sponsor!
These amazing people have contributed code to this project:
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
Unless stated otherwise all works are:
and licensed under:
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
8 years ago
12 years ago
13 years ago
13 years ago
13 years ago