Skip to content

Added increased customizability to creating the webworker; #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -70,6 +70,15 @@ 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.
Expand Down