5.9.0 • Published 4 months ago

dominject v5.9.0

Weekly downloads
11
License
Artistic-2.0
Repository
github
Last release
4 months ago

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

npm

jspm

<script type="module">
    import * as pkg from '//dev.jspm.io/dominject'
</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
  }
}

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 injected

API Documentation

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

4 months ago

5.9.0

4 months ago

5.5.0

5 months ago

5.3.0

6 months ago

5.1.0

6 months ago

4.23.0

6 months ago

5.4.0

6 months ago

5.2.0

6 months ago

5.0.0

6 months ago

4.21.0

3 years ago

4.22.0

3 years ago

4.20.0

3 years ago

4.19.0

4 years ago

4.18.0

4 years ago

4.17.0

4 years ago

4.16.0

4 years ago

4.15.0

4 years ago

4.14.0

4 years ago

4.13.0

4 years ago

4.12.0

4 years ago

4.11.0

4 years ago

4.10.0

4 years ago

4.9.0

4 years ago

4.8.0

4 years ago

4.7.0

4 years ago

4.6.0

4 years ago

4.5.0

4 years ago

4.4.0

4 years ago

4.3.0

4 years ago

4.2.0

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.1.0

4 years ago

2.0.0

6 years ago

1.0.3

10 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago