Skip to content

zacharysierakowski/remotejs-loader

Repository files navigation

remotejs-loader

Dynamically load remote javascript into the DOM

Build Status Commitizen friendly styled with prettier semantic-release

Installing

npm install remotejs-loader

Basic usage

import remotejs from "remotejs-loader";

remotejs("/path/to/remote/js.js")
  .then(() => {
    console.log("js.js is ready");
  })
  .catch(e => {
    console.error(e);
  });

Using options

import remotejs from "remotejs-loader";

remotejs("/path/to/remote/js.js", { forceReload: true })
  .then(() => {
    console.log("js.js is ready");
  })
  .catch(e => {
    console.error(e);
  });

Options

  • forceReload: boolean (default = false)

    If the script has already been loaded once, and requested to be loaded again, force the script to rerun by removing the script tag and readding it.

Contributing

see CONTRIBUTING.MD

About

Easily load remote javascript code for execution

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published