Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

import-scripts

sebdeckers215ISC1.0.0

importScripts() from the Web APIs for Service Workers and Web Workers

service worker, web worker, web api, importscript

readme

importScripts

Node.js ponyfill of importScripts() from the Web APIs for Service Workers and Web Workers.

Usage

import importScripts from 'import-scripts'

importScripts('foo.js')

// foo.js:
// var bar = {lol: 123}

console.dir(bar)
// Result: {lol: 123}

Use Case

Useful when writing testing for code that runs in Service Workers.

References

See Also

Colophon

Made by Sebastiaan Deckers in Singapore 🇸🇬