From b9261c243c7b12794071338af1d2eff4fae488d4 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 20 Aug 2022 09:23:24 +0100 Subject: [PATCH] Bump devDeps, requires doc refresh --- docs/api-channel.md | 10 +++---- docs/api-colour.md | 14 +++++----- docs/api-composite.md | 12 ++++----- docs/api-constructor.md | 4 +-- docs/api-input.md | 6 ++--- docs/api-operation.md | 58 ++++++++++++++++++++--------------------- docs/api-output.md | 45 ++++++++++++++++---------------- docs/api-resize.md | 10 +++---- docs/api-utility.md | 12 ++++----- docs/build.js | 3 ++- package.json | 4 +-- 11 files changed, 89 insertions(+), 89 deletions(-) diff --git a/docs/api-channel.md b/docs/api-channel.md index 4877ec3f..3f6d859f 100644 --- a/docs/api-channel.md +++ b/docs/api-channel.md @@ -16,7 +16,7 @@ sharp('rgba.png') }); ``` -Returns **Sharp** +Returns **Sharp** ## ensureAlpha @@ -47,7 +47,7 @@ const rgba = await sharp(rgb) * Throws **[Error][3]** Invalid alpha transparency level -Returns **Sharp** +Returns **Sharp** **Meta** @@ -80,7 +80,7 @@ const [red1, red2, ...] = await sharp(input) * Throws **[Error][3]** Invalid channel -Returns **Sharp** +Returns **Sharp** ## joinChannel @@ -104,7 +104,7 @@ For raw pixel input, the `options` object should contain a `raw` attribute, whic * Throws **[Error][3]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## bandbool @@ -128,7 +128,7 @@ sharp('3-channel-rgb-input.png') * Throws **[Error][3]** Invalid parameters -Returns **Sharp** +Returns **Sharp** [1]: /api-operation#flatten diff --git a/docs/api-colour.md b/docs/api-colour.md index 75f4c09e..7b7a41d1 100644 --- a/docs/api-colour.md +++ b/docs/api-colour.md @@ -19,7 +19,7 @@ const output = await sharp(input) * Throws **[Error][4]** Invalid parameter -Returns **Sharp** +Returns **Sharp** ## greyscale @@ -40,7 +40,7 @@ An alpha channel may be present, and will be unchanged by the operation. const output = await sharp(input).greyscale().toBuffer(); ``` -Returns **Sharp** +Returns **Sharp** ## grayscale @@ -50,7 +50,7 @@ Alternative spelling of `greyscale`. * `grayscale` **[Boolean][5]** (optional, default `true`) -Returns **Sharp** +Returns **Sharp** ## pipelineColourspace @@ -77,7 +77,7 @@ await sharp(input) * Throws **[Error][4]** Invalid parameters -Returns **Sharp** +Returns **Sharp** **Meta** @@ -95,7 +95,7 @@ Alternative spelling of `pipelineColourspace`. * Throws **[Error][4]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## toColourspace @@ -117,7 +117,7 @@ await sharp(input) * Throws **[Error][4]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## toColorspace @@ -131,7 +131,7 @@ Alternative spelling of `toColourspace`. * Throws **[Error][4]** Invalid parameters -Returns **Sharp** +Returns **Sharp** [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/docs/api-composite.md b/docs/api-composite.md index ebc38f3a..70087eb7 100644 --- a/docs/api-composite.md +++ b/docs/api-composite.md @@ -25,8 +25,8 @@ and [https://www.cairographics.org/operators/][2] * `images[].input.create` **[Object][4]?** describes a blank overlay to be created. - * `images[].input.create.width` **[Number][7]?** - * `images[].input.create.height` **[Number][7]?** + * `images[].input.create.width` **[Number][7]?** + * `images[].input.create.height` **[Number][7]?** * `images[].input.create.channels` **[Number][7]?** 3-4 * `images[].input.create.background` **([String][6] | [Object][4])?** parsed by the [color][8] module to extract values for red, green, blue and alpha. * `images[].input.text` **[Object][4]?** describes a new text image to be created. @@ -50,9 +50,9 @@ and [https://www.cairographics.org/operators/][2] * `images[].density` **[Number][7]** number representing the DPI for vector overlay image. (optional, default `72`) * `images[].raw` **[Object][4]?** describes overlay when using raw pixel data. - * `images[].raw.width` **[Number][7]?** - * `images[].raw.height` **[Number][7]?** - * `images[].raw.channels` **[Number][7]?** + * `images[].raw.width` **[Number][7]?** + * `images[].raw.height` **[Number][7]?** + * `images[].raw.channels` **[Number][7]?** * `images[].animated` **[boolean][9]** Set to `true` to read all frames/pages of an animated image. (optional, default `false`) * `images[].failOn` **[string][6]** @see [constructor parameters][10] (optional, default `'warning'`) * `images[].limitInputPixels` **([number][7] | [boolean][9])** @see [constructor parameters][10] (optional, default `268402689`) @@ -95,7 +95,7 @@ sharp('input.png') * Throws **[Error][11]** Invalid parameters -Returns **Sharp** +Returns **Sharp** **Meta** diff --git a/docs/api-constructor.md b/docs/api-constructor.md index 57459d56..31123b0c 100644 --- a/docs/api-constructor.md +++ b/docs/api-constructor.md @@ -164,7 +164,7 @@ await sharp({ * Throws **[Error][17]** Invalid parameters -Returns **[Sharp][18]** +Returns **[Sharp][18]** ## clone @@ -230,7 +230,7 @@ Promise.all(promises) }); ``` -Returns **[Sharp][18]** +Returns **[Sharp][18]** [1]: http://nodejs.org/api/stream.html#stream_class_stream_duplex diff --git a/docs/api-input.md b/docs/api-input.md index 560ed245..adb6947f 100644 --- a/docs/api-input.md +++ b/docs/api-input.md @@ -36,7 +36,7 @@ A `Promise` is returned when `callback` is not provided. * `icc`: Buffer containing raw [ICC][3] profile data, if present * `iptc`: Buffer containing raw IPTC data, if present * `xmp`: Buffer containing raw XMP data, if present -* `tifftagPhotoshop`: Buffer containing raw TIFFTAG_PHOTOSHOP data, if present +* `tifftagPhotoshop`: Buffer containing raw TIFFTAG\_PHOTOSHOP data, if present ### Parameters @@ -75,7 +75,7 @@ function getNormalSize({ width, height, orientation }) { } ``` -Returns **([Promise][5]<[Object][6]> | Sharp)** +Returns **([Promise][5]<[Object][6]> | Sharp)** ## stats @@ -129,7 +129,7 @@ const part = await image.extract(region).toBuffer(); const stats = await sharp(part).stats(); ``` -Returns **[Promise][5]<[Object][6]>** +Returns **[Promise][5]<[Object][6]>** [1]: https://www.libvips.org/API/current/VipsImage.html#VipsInterpretation diff --git a/docs/api-operation.md b/docs/api-operation.md index d1c31109..a435b2bf 100644 --- a/docs/api-operation.md +++ b/docs/api-operation.md @@ -56,7 +56,7 @@ const resizeThenRotate = await sharp(input) * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## flip @@ -73,7 +73,7 @@ The use of `flip` implies the removal of the EXIF `Orientation` tag, if any. const output = await sharp(input).flip().toBuffer(); ``` -Returns **Sharp** +Returns **Sharp** ## flop @@ -90,7 +90,7 @@ The use of `flop` implies the removal of the EXIF `Orientation` tag, if any. const output = await sharp(input).flop().toBuffer(); ``` -Returns **Sharp** +Returns **Sharp** ## affine @@ -142,7 +142,7 @@ inputStream * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** **Meta** @@ -195,7 +195,7 @@ const data = await sharp(input) * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## median @@ -218,7 +218,7 @@ const output = await sharp(input).median(5).toBuffer(); * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## blur @@ -248,7 +248,7 @@ const gaussianBlurred = await sharp(input) * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## flatten @@ -258,7 +258,7 @@ See also [removeAlpha][9]. ### Parameters -* `options` **[Object][2]?** +* `options` **[Object][2]?** * `options.background` **([string][3] | [Object][2])** background colour, parsed by the [color][4] module, defaults to black. (optional, default `{r:0,g:0,b:0}`) @@ -270,7 +270,7 @@ await sharp(rgbaInput) .toBuffer(); ``` -Returns **Sharp** +Returns **Sharp** ## gamma @@ -291,7 +291,7 @@ Supply a second argument to use a different output gamma value, otherwise the fi * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## negate @@ -299,7 +299,7 @@ Produce the "negative" of the image. ### Parameters -* `options` **[Object][2]?** +* `options` **[Object][2]?** * `options.alpha` **[Boolean][6]** Whether or not to negate any alpha channel (optional, default `true`) @@ -317,7 +317,7 @@ const output = await sharp(input) .toBuffer(); ``` -Returns **Sharp** +Returns **Sharp** ## normalise @@ -333,7 +333,7 @@ Enhance output image contrast by stretching its luminance to cover the full dyna const output = await sharp(input).normalise().toBuffer(); ``` -Returns **Sharp** +Returns **Sharp** ## normalize @@ -349,7 +349,7 @@ Alternative spelling of normalise. const output = await sharp(input).normalize().toBuffer(); ``` -Returns **Sharp** +Returns **Sharp** ## clahe @@ -360,7 +360,7 @@ This will, in general, enhance the clarity of the image by bringing out darker d ### Parameters -* `options` **[Object][2]** +* `options` **[Object][2]** * `options.width` **[number][1]** integer width of the region in pixels. * `options.height` **[number][1]** integer height of the region in pixels. @@ -381,7 +381,7 @@ const output = await sharp(input) * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** **Meta** @@ -393,7 +393,7 @@ Convolve the image with the specified kernel. ### Parameters -* `kernel` **[Object][2]** +* `kernel` **[Object][2]** * `kernel.width` **[number][1]** width of the kernel in pixels. * `kernel.height` **[number][1]** height of the kernel in pixels. @@ -419,7 +419,7 @@ sharp(input) * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## threshold @@ -428,7 +428,7 @@ Any pixel value greater than or equal to the threshold value will be set to 255, ### Parameters * `threshold` **[number][1]** a value in the range 0-255 representing the level at which the threshold will be applied. (optional, default `128`) -* `options` **[Object][2]?** +* `options` **[Object][2]?** * `options.greyscale` **[Boolean][6]** convert to single channel greyscale. (optional, default `true`) * `options.grayscale` **[Boolean][6]** alternative spelling for greyscale. (optional, default `true`) @@ -437,7 +437,7 @@ Any pixel value greater than or equal to the threshold value will be set to 255, * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## boolean @@ -450,19 +450,19 @@ the selected bitwise boolean `operation` between the corresponding pixels of the * `operand` **([Buffer][11] | [string][3])** Buffer containing image data or string containing the path to an image file. * `operator` **[string][3]** one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively. -* `options` **[Object][2]?** +* `options` **[Object][2]?** * `options.raw` **[Object][2]?** describes operand when using raw pixel data. - * `options.raw.width` **[number][1]?** - * `options.raw.height` **[number][1]?** - * `options.raw.channels` **[number][1]?** + * `options.raw.width` **[number][1]?** + * `options.raw.height` **[number][1]?** + * `options.raw.channels` **[number][1]?** * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## linear @@ -477,7 +477,7 @@ Apply the linear formula a \* input + b to the image (levels adjustment) * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## recomb @@ -505,7 +505,7 @@ sharp(input) * Throws **[Error][5]** Invalid parameters -Returns **Sharp** +Returns **Sharp** **Meta** @@ -519,7 +519,7 @@ brightness is multiplicative whereas lightness is additive. ### Parameters -* `options` **[Object][2]?** +* `options` **[Object][2]?** * `options.brightness` **[number][1]?** Brightness multiplier * `options.saturation` **[number][1]?** Saturation multiplier @@ -566,7 +566,7 @@ const output = await sharp(input) .toBuffer(); ``` -Returns **Sharp** +Returns **Sharp** **Meta** diff --git a/docs/api-output.md b/docs/api-output.md index 7d131dbd..ec6d7af4 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -59,19 +59,18 @@ See [withMetadata][1] for control over this. * `err` is an error, if any. * `data` is the output image data. * `info` contains the output image `format`, `size` (bytes), `width`, `height`, - -`channels` and `premultiplied` (indicating if premultiplication was used). -When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`. -May also contain `textAutofitDpi` (dpi the font was rendered at) if image was created from text. + `channels` and `premultiplied` (indicating if premultiplication was used). + When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`. + May also contain `textAutofitDpi` (dpi the font was rendered at) if image was created from text. A `Promise` is returned when `callback` is not provided. ### Parameters -* `options` **[Object][6]?** +* `options` **[Object][6]?** * `options.resolveWithObject` **[boolean][10]?** Resolve the Promise with an Object containing `data` and `info` properties instead of resolving only with `data`. -* `callback` **[Function][3]?** +* `callback` **[Function][3]?** ### Examples @@ -127,7 +126,7 @@ EXIF metadata is unsupported for TIFF output. ### Parameters -* `options` **[Object][6]?** +* `options` **[Object][6]?** * `options.orientation` **[number][12]?** value between 1 and 8, used to update the EXIF `Orientation` tag. * `options.icc` **[string][2]?** filesystem path to output ICC profile, defaults to sRGB. @@ -165,7 +164,7 @@ const data = await sharp(input) * Throws **[Error][4]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## toFormat @@ -187,7 +186,7 @@ const data = await sharp(input) * Throws **[Error][4]** unsupported format or options -Returns **Sharp** +Returns **Sharp** ## jpeg @@ -232,7 +231,7 @@ const data = await sharp(input) * Throws **[Error][4]** Invalid options -Returns **Sharp** +Returns **Sharp** ## png @@ -244,7 +243,7 @@ Set `palette` to `true` for slower, indexed PNG output. ### Parameters -* `options` **[Object][6]?** +* `options` **[Object][6]?** * `options.progressive` **[boolean][10]** use progressive (interlace) scan (optional, default `false`) * `options.compressionLevel` **[number][12]** zlib compression level, 0 (fastest, largest) to 9 (slowest, smallest) (optional, default `6`) @@ -275,7 +274,7 @@ const data = await sharp(input) * Throws **[Error][4]** Invalid options -Returns **Sharp** +Returns **Sharp** ## webp @@ -288,7 +287,7 @@ Use these WebP options for output image. * `options.quality` **[number][12]** quality, integer 1-100 (optional, default `80`) * `options.alphaQuality` **[number][12]** quality of alpha layer, integer 0-100 (optional, default `100`) * `options.lossless` **[boolean][10]** use lossless compression mode (optional, default `false`) - * `options.nearLossless` **[boolean][10]** use near_lossless compression mode (optional, default `false`) + * `options.nearLossless` **[boolean][10]** use near\_lossless compression mode (optional, default `false`) * `options.smartSubsample` **[boolean][10]** use high quality chroma subsampling (optional, default `false`) * `options.effort` **[number][12]** CPU effort, between 0 (fastest) and 6 (slowest) (optional, default `4`) * `options.loop` **[number][12]** number of animation iterations, use 0 for infinite animation (optional, default `0`) @@ -315,7 +314,7 @@ const outputWebp = await sharp(inputWebp, { animated: true }) * Throws **[Error][4]** Invalid options -Returns **Sharp** +Returns **Sharp** ## gif @@ -364,7 +363,7 @@ const out = await sharp('in.gif', { animated: true }) * Throws **[Error][4]** Invalid options -Returns **Sharp** +Returns **Sharp** **Meta** @@ -409,7 +408,7 @@ const data = await sharp(input) * Throws **[Error][4]** Invalid options -Returns **Sharp** +Returns **Sharp** **Meta** @@ -453,7 +452,7 @@ sharp('input.svg') * Throws **[Error][4]** Invalid options -Returns **Sharp** +Returns **Sharp** ## avif @@ -477,7 +476,7 @@ AVIF image sequences are not supported. * Throws **[Error][4]** Invalid options -Returns **Sharp** +Returns **Sharp** **Meta** @@ -504,7 +503,7 @@ globally-installed libvips compiled with support for libheif, libde265 and x265. * Throws **[Error][4]** Invalid options -Returns **Sharp** +Returns **Sharp** **Meta** @@ -554,7 +553,7 @@ The container will be set to `zip` when the output is a Buffer or Stream, otherw ### Parameters -* `options` **[Object][6]?** +* `options` **[Object][6]?** * `options.size` **[number][12]** tile size in pixels, a value between 1 and 8192. (optional, default `256`) * `options.overlap` **[number][12]** tile overlap in pixels, a value between 0 and 8192. (optional, default `0`) @@ -598,7 +597,7 @@ readableStream * Throws **[Error][4]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## timeout @@ -610,7 +609,7 @@ Time spent waiting for a libuv thread to become available is not included. ### Parameters -* `options` **[Object][6]** +* `options` **[Object][6]** * `options.seconds` **[number][12]** Number of seconds after which processing will be stopped @@ -628,7 +627,7 @@ try { } ``` -Returns **Sharp** +Returns **Sharp** **Meta** diff --git a/docs/api-resize.md b/docs/api-resize.md index 09d6f13c..0eaef4b1 100644 --- a/docs/api-resize.md +++ b/docs/api-resize.md @@ -43,7 +43,7 @@ Previous calls to `resize` in the same pipeline will be ignored. * `width` **[number][8]?** pixels wide the resultant image should be. Use `null` or `undefined` to auto-scale the width to match the height. * `height` **[number][8]?** pixels high the resultant image should be. Use `null` or `undefined` to auto-scale the height to match the width. -* `options` **[Object][9]?** +* `options` **[Object][9]?** * `options.width` **[String][10]?** alternative means of specifying `width`. If both are present this take priority. * `options.height` **[String][10]?** alternative means of specifying `height`. If both are present this take priority. @@ -147,7 +147,7 @@ const scaleByHalf = await sharp(input) * Throws **[Error][13]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## extend @@ -193,7 +193,7 @@ sharp(input) * Throws **[Error][13]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## extract @@ -234,7 +234,7 @@ sharp(input) * Throws **[Error][13]** Invalid parameters -Returns **Sharp** +Returns **Sharp** ## trim @@ -255,7 +255,7 @@ will contain `trimOffsetLeft` and `trimOffsetTop` properties. * Throws **[Error][13]** Invalid parameters -Returns **Sharp** +Returns **Sharp** [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit diff --git a/docs/api-utility.md b/docs/api-utility.md index d44c6520..37954428 100644 --- a/docs/api-utility.md +++ b/docs/api-utility.md @@ -10,7 +10,7 @@ An Object containing nested boolean values representing the available input and console.log(sharp.format); ``` -Returns **[Object][1]** +Returns **[Object][1]** ## interpolators @@ -90,7 +90,7 @@ sharp.cache( { files: 0 } ); sharp.cache(false); ``` -Returns **[Object][1]** +Returns **[Object][1]** ## concurrency @@ -115,7 +115,7 @@ The maximum number of images that sharp can process in parallel is controlled by libuv's `UV_THREADPOOL_SIZE` environment variable, which defaults to 4. -[https://nodejs.org/api/cli.html#uv_threadpool_sizesize][12] +[https://nodejs.org/api/cli.html#uv\_threadpool\_sizesize][12] For example, by default, a machine with 8 CPU cores will process 4 images in parallel and use up to 8 threads per image, @@ -123,7 +123,7 @@ so there will be up to 32 concurrent threads. ### Parameters -* `concurrency` **[number][11]?** +* `concurrency` **[number][11]?** ### Examples @@ -163,7 +163,7 @@ Provides access to internal task counters. const counters = sharp.counters(); // { queue: 2, process: 4 } ``` -Returns **[Object][1]** +Returns **[Object][1]** ## simd @@ -189,7 +189,7 @@ const simd = sharp.simd(false); // prevent libvips from using liborc at runtime ``` -Returns **[boolean][10]** +Returns **[boolean][10]** [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object diff --git a/docs/build.js b/docs/build.js index 325138df..b9ee88df 100644 --- a/docs/build.js +++ b/docs/build.js @@ -2,7 +2,6 @@ const fs = require('fs').promises; const path = require('path'); -const documentation = require('documentation'); [ 'constructor', @@ -15,6 +14,8 @@ const documentation = require('documentation'); 'output', 'utility' ].forEach(async (m) => { + const documentation = await import('documentation'); + const input = path.join('lib', `${m}.js`); const output = path.join('docs', `api-${m}.md`); diff --git a/package.json b/package.json index ec75cc3e..baf05db8 100644 --- a/package.json +++ b/package.json @@ -141,13 +141,13 @@ "devDependencies": { "async": "^3.2.4", "cc": "^3.0.1", - "documentation": "^13.2.5", + "documentation": "^14.0.0", "exif-reader": "^1.0.3", "extract-zip": "^2.0.1", "icc": "^2.0.0", "license-checker": "^25.0.1", "mocha": "^10.0.0", - "mock-fs": "^5.1.2", + "mock-fs": "^5.1.4", "nyc": "^15.1.0", "prebuild": "^11.0.4", "rimraf": "^3.0.2",