load-resource

1.1.10 • Public • Published

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

/load-resource/

    Package Sidebar

    Install

    npm i load-resource

    Weekly Downloads

    110

    Version

    1.1.10

    License

    ISC

    Unpacked Size

    30.8 kB

    Total Files

    15

    Last publish

    Collaborators

    • mhewitt
    • rymccarty
    • epayret
    • dmooney
    • leahshearer
    • jcalleja-hubspot
    • lopchannorie
    • kelvinmr
    • rraj_hubspot
    • pwilver
    • dding
    • tstelmach
    • hs_cfrisoli
    • priedle
    • amichelini
    • lbergin
    • nhodgkiss447
    • dharmeshs
    • annagallo-hs
    • lhampson
    • cutlah
    • gwilliamshubspot
    • kelin599
    • cprince
    • aulfich-hs
    • samson.yuwono
    • vickytran
    • denishubspot
    • markelly-hs
    • sgoldenson
    • bpuseyhs
    • mndhlovu
    • snigam
    • andresllinasr
    • ronaldtorresn
    • hayala
    • conor_heffernan
    • sdiaz88
    • kimccarthy
    • sduque
    • stevehealy
    • henryqdineen
    • gsugrue_npm
    • bjacobel
    • ruthfarrell
    • adiazcometa
    • sasharma
    • pstafford
    • bcarolan
    • iogrizovic
    • dgroechel_hs
    • cayre
    • siva_h
    • mahad2
    • ahiremath
    • cwilliford_hubspot
    • cwunder_hubspot
    • conormalone
    • nmansurov
    • cfritz
    • hzahra
    • mbegyn
    • mlamacchia
    • yjgcharriz
    • mariana.sanchez.s
    • damartinez
    • ralo_alo
    • awilks
    • leocifnpm
    • mvalenciahubspot
    • hsneking
    • jgilhs
    • ericsalvi
    • appstructio
    • dshamis
    • eshaw
    • tswyter
    • kebrahim
    • smcelhinney_hubs
    • mdstaff
    • tcollinshubspot