
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@ln-zap/comlink-loader
Advanced tools
Webpack loader: offload modules to Worker threads seamlessly using Comlink
Offload modules to Worker threads seamlessly using Comlink.
await new Foo())npm install -D comlink-loader
The goal of comlink-loader is to make the fact that a module is running inside a Worker nearly transparent to the developer.
In the example below, the sole difference between running MyClass on a Worker thread instead of the main thread is that instantiation and method calls must be prefixed with await. This is required because Worker interactions are inherently asynchronous.
my-class.js: (gets moved into a worker)
// Dependencies get bundled into the worker:
import rnd from 'random-int';
// Export as you would in a normal module:
export class MyClass {
constructor(value = rnd()) {
this.value = value;
}
increment() {
this.value++;
}
// Tip: async functions make the interface identical
async getValue() {
return this.value;
}
}
main.js: (our demo, on the main thread)
import { MyClass } from 'comlink-loader!./my-class';
const inst = await new MyClass(42); // notice the await
await inst.increment();
await inst.getValue(); // 43
Apache-2.0
FAQs
Webpack loader: offload modules to Worker threads seamlessly using Comlink
The npm package @ln-zap/comlink-loader receives a total of 2 weekly downloads. As such, @ln-zap/comlink-loader popularity was classified as not popular.
We found that @ln-zap/comlink-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.