Skip to content

Commit

Permalink
Merge pull request #1 from karankraina/fix-documentation
Browse files Browse the repository at this point in the history
update: documentation
  • Loading branch information
karankraina authored Dec 26, 2021
2 parents 3972177 + 25f547f commit 78b81fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Use the ```defineWorker``` function to define a worker job in ```worker.js``` fi
/**
* This code will execute in a separate thread
*/
const { defineWorker } = require('nodejs-utils');
const { defineWorker } = require('nodejs-threads');
// OR
import { defineWorker } from 'nodejs-utils';
import { defineWorker } from 'nodejs-threads';


defineWorker(async (payload) => {
Expand All @@ -68,7 +68,9 @@ defineWorker(async (payload) => {
You can create a new worker thread by simply calling ```createWorker``` function. The first argument is the path of the ```worker.js``` file and you can pass any payload as the second argument. The payload passed will be provided as an argument in the worker callback function.

```javascript
const { createWorker } = require('nodejs-utils');
const { createWorker } = require('nodejs-threads');
// OR
import { createWorker } from 'nodejs-threads';

// Inside any async function
const worker = await createWorker('./worker.js', {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodejs-threads",
"version": "1.0.1",
"version": "1.0.2",
"description": "A very simple functiobn based implementation of node.js worker threads",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 78b81fb

Please # to comment.