Skip to content

Commit

Permalink
Docs: expand info about use with worker threads
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell authored and martinj committed Mar 31, 2022
1 parent 82ba677 commit 6c7edfa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
12 changes: 9 additions & 3 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,17 @@ esbuild app.js --bundle --platform=node --external:sharp

## Worker threads

The main thread must call `require('sharp')`
before worker threads are created
to ensure shared libraries remain loaded in memory
On some platforms, including glibc-based Linux,
the main thread must call `require('sharp')`
_before_ worker threads are created.
This is to ensure shared libraries remain loaded in memory
until after all threads are complete.

Without this, the following error may occur:
```
Module did not self-register
```

## Known conflicts

### Canvas and Windows
Expand Down
2 changes: 1 addition & 1 deletion docs/search-index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/search-index/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const extractDescription = (str) =>
.replace(/\s+/g, ' ')
.replace(/[^A-Za-z0-9_/\-,. ]/g, '')
.replace(/\s+/g, ' ')
.substr(0, 180)
.substring(0, 200)
.trim();

const extractParameters = (str) =>
Expand Down
5 changes: 5 additions & 0 deletions docs/search-index/stop-words.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = [
'can',
'containing',
'contains',
'created',
'current',
'date',
'default',
Expand All @@ -43,6 +44,8 @@ module.exports = [
'how',
'image',
'implies',
'include',
'including',
'involve',
'its',
'last',
Expand All @@ -69,6 +72,7 @@ module.exports = [
'provided',
'ready',
'requires',
'requiresharp',
'returned',
'same',
'see',
Expand All @@ -77,6 +81,7 @@ module.exports = [
'should',
'since',
'site',
'some',
'specified',
'spelling',
'such',
Expand Down

0 comments on commit 6c7edfa

Please sign in to comment.