4.18.0-next.1603019265.bf6bf48dab4cd322ac6112f6fbcc8142bbbb002b • Published 5 years ago

dominject v4.18.0-next.1603019265.bf6bf48dab4cd322ac6112f6fbcc8142bbbb002b

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

Inject scripts and styles into the DOM with duplicate prevention and completion callback support

Usage

Complete API Documentation.

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 injected

npm

Skypack

<script type="module">
    import pkg from '//cdn.skypack.dev/dominject@^4.18.0'
</script>

unpkg

<script type="module">
    import pkg from '//unpkg.com/dominject@^4.18.0'
</script>

jspm

<script type="module">
    import pkg from '//dev.jspm.io/dominject@4.18.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:

5.8.0

2 years ago

5.9.0

2 years ago

5.5.0

2 years ago

5.3.0

2 years ago

5.1.0

2 years ago

4.23.0

2 years ago

5.4.0

2 years ago

5.2.0

2 years ago

5.0.0

2 years ago

4.21.0

5 years ago

4.22.0

5 years ago

4.20.0

5 years ago

4.19.0

5 years ago

4.18.0

6 years ago

4.17.0

6 years ago

4.16.0

6 years ago

4.15.0

6 years ago

4.14.0

6 years ago

4.13.0

6 years ago

4.12.0

6 years ago

4.11.0

6 years ago

4.10.0

6 years ago

4.9.0

6 years ago

4.8.0

6 years ago

4.7.0

6 years ago

4.6.0

6 years ago

4.5.0

6 years ago

4.4.0

6 years ago

4.3.0

6 years ago

4.2.0

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.5.0

6 years ago

3.4.0

6 years ago

3.3.0

6 years ago

3.2.0

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.1.0

6 years ago

2.0.0

8 years ago

1.0.3

12 years ago

1.0.2

13 years ago

1.0.1

13 years ago

1.0.0

13 years ago