Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

microlink

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

microlink - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

cjs/batch.js

38

package.json
{
"name": "microlink",
"version": "0.0.2",
"version": "0.1.0",
"description": "Comlink Alternative. Built with JSON-RPC.",
"main": "index.js",
"type": "module",
"unpkg": "./dist/microlink.bundle.js",
"jsdelivr": "./dist/microlink.bundle.js",
"exports": {
".": {
"require": "./cjs/index.js",
"import": "./esm/index.js"
}
},
"files": [
"call.js",
"deserialize.js",
"expose.js",
"index.js",
"serialize.js",
"wrap.js"
"cjs",
"esm",
"dist"
],
"scripts": {
"format": "npx prettier --arrow-parens=avoid --print-width=160 --trailing-comma=none --write *.js",
"build": "npm run build:cjs && npm run build:bundle",
"build:bundle": "mkdir -p ./dist && npx browserify ./cjs/index.js > ./dist/microlink.bundle.js",
"build:cjs": "npx babel --plugins @babel/plugin-transform-modules-commonjs --plugins @babel/plugin-proposal-export-namespace-from ./esm/* --out-dir ./cjs",
"clean": "rm -rf ./cjs/* ./dist/*",
"format": "npx prettier --arrow-parens=avoid --print-width=200 --trailing-comma=none --write esm test",
"serve": "npx srvd --debug",
"test": "node test.js"
"test": "npm run test:js && npm run test:build",
"test:js": "node -r esm ./test/test.js",
"test:build": "npm run build && node -r ./cjs/index.js -e '' && node -r ./dist/microlink.bundle.js -e ''"
},

@@ -40,4 +49,9 @@ "repository": {

"devDependencies": {
"flug": "^2.6.0"
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-transform-modules-commonjs": "^7.22.5",
"flug": "^2.6.0",
"mock-worker": "^0.0.1"
}
}

@@ -5,5 +5,6 @@ # microlink

## features
- easily pass function to another thread
- easily pass functions to worker threads
- built with [JSON-RPC 2.0](https://www.jsonrpc.org/specification)
- zero run-time dependencies
- batching

@@ -37,2 +38,13 @@ ## usage

## advanced usage
#### batching
```js
import { expose } from "microlink";
expose(methods, {
batch_size: 10, // how many requests per batch should be sent up to the main thread
batch_wait: 100, // wait up to 100ms for batch to be filled before sent
})
```
#### debugging

@@ -39,0 +51,0 @@ ```js

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc