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 ## Worker threads
The main thread must call `require('sharp')` On some platforms, including glibc-based Linux,
before worker threads are created the main thread must call `require('sharp')`
to ensure shared libraries remain loaded in memory _before_ worker threads are created.
This is to ensure shared libraries remain loaded in memory
until after all threads are complete. until after all threads are complete.
Without this, the following error may occur:
```
Module did not self-register
```
## Known conflicts ## Known conflicts
### Canvas and Windows ### 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(/\s+/g, ' ')
.replace(/[^A-Za-z0-9_/\-,. ]/g, '') .replace(/[^A-Za-z0-9_/\-,. ]/g, '')
.replace(/\s+/g, ' ') .replace(/\s+/g, ' ')
.substr(0, 180) .substring(0, 200)
.trim(); .trim();
const extractParameters = (str) => const extractParameters = (str) =>

View File

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