Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

ggscript

0.1.0 • Public • Published

GG Script

Inject scripts into any website.

Travis CI Build Status CodeFactor Score

NPM

Importing

From your NodeJS application:

const GGScript = require("ggscript")

From your web application:

<script src="https://unpkg.com/ggscript/dist/index.min.js"></script>

Usage

// Inject a single file
GGScript("https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js")
 
// Inject multiple files
GGScript(["https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js", "https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.9/vue.min.js", "https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"])
 
// Promise integration
GGScript("https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js").then(() => {
    console.log("Finished loading resources.")
}).catch((err) => {
    console.error("Something bad just happened! " + err)
})
 
// Custom options
GGScript("https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js", {
    strategy: "eval"
})

Usage

Read the documentation.

Install

npm i ggscript

DownloadsWeekly Downloads

26

Version

0.1.0

License

MIT

Unpacked Size

445 kB

Total Files

18

Last publish

Collaborators

  • avatar