You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

multijs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multijs

Multi.js is cross browsing JavaScript multithread library.

2.0.11
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Multi.js v2.0.1

Light weight, easy to use cross browsing JavaScript multithread module.

How does it work?

If the browser supports Web Worker and Blob, it uses Web Worker. But if not, use timer function instead. Yes, it is not cross browsing 'multithread', but can use this module for old browsers with same code.

Support?

IE5.5-11 and all major browsers supported.

License?

MIT.

Example

  • Install module via NPM

$ npm install --save multi.js

  • Include from browser script. You need Web bundler(Browserify/Webpack) and transpiler like Babel.
import Thread from 'multijs';

var thread = new Thread(function() {
	postData = Math.PI * postData;
	return postData;
});

thread.start().execute(100, function(err, data) {
	if(err) {
		console.log(err);
		return;
	}

	console.log(data);
	thread.terminate();
});
  • Build and run.

Keywords

Multithread

FAQs

Package last updated on 15 Sep 2016

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