From b61845bc01b542e8c92ed46044e7ae66393ee468 Mon Sep 17 00:00:00 2001 From: Joshua-Zou <77520157+Joshua-Zou@users.noreply.github.com> Date: Sat, 26 Jun 2021 11:07:30 -0700 Subject: [PATCH 1/2] Update readme.markdown --- readme.markdown | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/readme.markdown b/readme.markdown index cf08315..a6eb98c 100644 --- a/readme.markdown +++ b/readme.markdown @@ -55,7 +55,7 @@ contain output from the worker: var work = require('webworkify') ``` -## var w = work(require(modulePath)) +## var w = work(require(modulePath), [options]) Return a new [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker) @@ -70,6 +70,14 @@ part. It is necessary for the main code to `require()` the worker code to fetch the module reference and load `modulePath`'s dependency graph into the bundle output. +### Options + + - bare - the return value will be the blob constructed with the worker's code and not the web worker itself. + - name - the name of the worker thread to be assigned + - type - the type of worker to create; `classic` or `module`; The default is `classic` + The full list of options is [here](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker) + **Important note: ** if the option `bare` is used, the other options will be ignored. Pass these options in a javascript object. + ## Worker.objectURL The worker `w` returned by `webworkify` has the property `objectURL` attached. From 947bd3cdcc9c940683a72e2f6bbaee14566baf60 Mon Sep 17 00:00:00 2001 From: Joshua-Zou <77520157+Joshua-Zou@users.noreply.github.com> Date: Sat, 26 Jun 2021 11:08:18 -0700 Subject: [PATCH 2/2] Update readme.markdown --- readme.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.markdown b/readme.markdown index a6eb98c..4042c06 100644 --- a/readme.markdown +++ b/readme.markdown @@ -76,7 +76,8 @@ output. - name - the name of the worker thread to be assigned - type - the type of worker to create; `classic` or `module`; The default is `classic` The full list of options is [here](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker) - **Important note: ** if the option `bare` is used, the other options will be ignored. Pass these options in a javascript object. + + **Important note:** if the option `bare` is used, the other options will be ignored. Pass these options in a javascript object. ## Worker.objectURL