Docs: expand info about use with worker threads

This commit is contained in:
Lovell Fuller 2022-03-30 10:09:15 +01:00
parent b0ca23c3e7
commit d0c8e95641
4 changed files with 16 additions and 5 deletions

View File

@ -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

File diff suppressed because one or more lines are too long

View File

@ -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) =>

View File

@ -21,6 +21,7 @@ module.exports = [
'can',
'containing',
'contains',
'created',
'current',
'date',
'default',
@ -43,6 +44,8 @@ module.exports = [
'how',
'image',
'implies',
'include',
'including',
'involve',
'its',
'last',
@ -69,6 +72,7 @@ module.exports = [
'provided',
'ready',
'requires',
'requiresharp',
'returned',
'same',
'see',
@ -77,6 +81,7 @@ module.exports = [
'should',
'since',
'site',
'some',
'specified',
'spelling',
'such',