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 committed Mar 30, 2022
1 parent b0ca23c commit d0c8e95
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
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
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
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 d0c8e95

Please sign in to comment.