Comparing version 0.0.2 to 0.1.0
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49184
20
1155
56
6
2
1
No