Travis CI Build Status CodeFactor Score

GG Script

NPM

Inject scripts into any website.

Importing

From your NodeJS application:

const GGScript = require("ggscript")

From your web application:

<script src="https://unpkg.com/ggscript/ggscript.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((src) => {
    console.log("Finished loading " + src)
})

// Custom options
GGScript("https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js", {
    strategy: "eval"
})

Options