Socket
Book a DemoInstallSign in
Socket

as-module

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-module

A module that exports primitives that will bootstrap as module

latest
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

as-module

Social Media Photo by Vlado Paunovic on Unsplash

A module that exports primitives that will bootstrap as module.

import { Worker, SharedWorker } from 'as-module';

// no need for extra options
// if provided, these will be forwarded
new Worker('./worker.js');
// worker.js
// import anything from 'anywhere';

// optional name, no need for extra options
// if provided, these will be forwarded
new SharedWorker('./shared.js');
// shared.js
// import anything from 'anywhere';

All instances will bootstrap with { type: 'module' } ability so that we can stop doing the awkward dance in every modern project based on workers' modules.

How to contribute?

If there are native APIs that require a { type: 'module' } somewhere while initializing, please just point me at those to be provided via this module too, thank you 🙏

Keywords

Worker

FAQs

Package last updated on 29 Jan 2025

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