New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

spaceworker-loader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spaceworker-loader

spaceworker.js loader for webpack: make webworker even easier.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Spaceworker.js Webpack-loader

This is the Webpack loader for my simple libary to make it easier to use WebWorker called Spaceworker.js

Install

npm install --save-dev spaceworker-loader
OR
yarn add --dev spaceworker-loader

Usage

// app.js
const worker = require("./iss.worker.js")

worker.run("sayHelloWorld", "hello", "world")
    .then(res => {
        console.log(res)
    })
// iss.worker.js
class ISS {
    sayHelloWorld(hello, world) {
        return hello + " " + world + " :)"
    }
}

SpaceWorker.provide(ISS, self)
// webpack.config.js
const path = require('path')
const config = {
    entry: "./app.js",
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: "bundle.js"
    },
    module: {
        rules: [
            { test: /\.worker\.js$/, use: { loader: 'spaceworker-loader' } }
        ]
    }
}

module.exports = config

FAQs

Package last updated on 22 Jan 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