New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

load-scripts

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-scripts

Dynamic scripts loading for modern browsers.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
1.7K
-6.25%
Maintainers
1
Weekly downloads
 
Created
Source

load-scripts

Coverage Status Downloads Version Gzip Size

Dynamic scripts loading for modern browsers.

Main files

dist/
├── load-scripts.js         (UMD, default)
├── load-scripts.min.js     (UMD, compressed)
├── load-scripts.esm.js     (ECMAScript Module)
├── load-scripts.esm.min.js (ECMAScript Module, compressed)
└── load-scripts.d.ts       (TypeScript Declaration File)

Getting started

Installation

npm install load-scripts

In browser:

<script src="/path/to/load-scripts.js"></script>

Usage

Syntax

loadScripts(script1, script2, ..., scriptN)
  .then(() => {})
  .catch((err) => {})
  .finally(() => {});

Example

import loadScripts from 'load-scripts';

loadScripts('foo.js').then(() => {
  console.log(window.Foo);
});

loadScripts('foo.js', 'bar.js').then(() => {
  console.log(window.Foo, window.Bar);
});

In browser:

<script>
  loadScripts('foo.js').then(() => {
    console.log(window.Foo);
  });
</script>

Browser support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Opera (latest)
  • Edge (latest)
  • Internet Explorer 10+ (requires a Promise polyfill as es6-promise)

Versioning

Maintained under the Semantic Versioning guidelines.

License

MIT © Chen Fengyuan

Keywords

load

FAQs

Package last updated on 21 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts