Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

load-resource

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-resource

This package exposes a function named "load" which takes a URL or an array of URLs and returns a Promise will resolve after all resources finishes loading.

  • 1.1.10
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
77
decreased by-21.43%
Maintainers
1
Weekly downloads
 
Created
Source

HubSpot Client API

This package exposes a function named "load" which takes a URL or an array of URLs and returns a Promise will resolve after all resources finishes loading.

npm i
npm run prepublish

Installation

npm i -S load-resource

API

require('load-resource') returns a function with the following signature: function(url[, opts = {}) => Promise

url

Any url that you would like to load. May be absolute or relative.

[, opts]

A map of attributes to set on the script or link node before appending it to the DOM. By default this is empty.

Usage

import loadResource from 'load-resource';

// Load a single library
loadResource.load('url').then(res => {console.log('url has finished loading')});

// Load multiple libraries
loadResource.load([
	'url1', 
	'url2',
]).then(res => {console.log('all urls have finished loading')});

License

See LICENSE.txt

FAQs

Package last updated on 15 Mar 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc