diff --git a/readme.markdown b/readme.markdown index cf08315..4042c06 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,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.