promise-create-script

2.0.2 • Public • Published

promise-create-script

Creates script and returns a promise.

Build Status npm version js-standard-style

Installing with npm

npm i --save promise-create-script

Usage

const createScript = require('promise-create-script')
const uri = 'http://code.jquery.com/jquery-3.2.1.slim.min.js'
createScript(document.body, uri).then(script => {
    // This returns the script tag
    console.log(script.src)
}).catch(err => {
    // Oops, some ting wong
    console.error(err)
})

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.2
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.2
    3
  • 2.0.0
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i promise-create-script

Weekly Downloads

5

Version

2.0.2

License

MIT

Last publish

Collaborators

  • kahwee