script-utils

0.0.3 • Public • Published

script

Script utils to create script elements, add and remove them from <head>

Installation

npm install script-utils

In the browser:

&lt;script src="script-utils-browser"&gt;&lt;/script&gt;

Usage

var script = require("script-utils");
 
// create a new script element with an onload callback
var newScript = script.create("source/to/file", function onload() {
    // do something when script is loaded;
}, this);
 
// Append the script to &lt;head&gt;
script.append(newScript);
 
// Remove script from &lt;head&gt;
script.remove(newScript);
 

Licence

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i script-utils

Weekly Downloads

0

Version

0.0.3

License

none

Last publish

Collaborators

  • podefr