@depup/sharp-cli 5.2.0-depup.0 → 5.3.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.prettierignore +2 -0
  2. package/.prettierrc +1 -0
  3. package/CHANGELOG.md +20 -8
  4. package/README.md +5 -5
  5. package/bin/cli.js +3 -3
  6. package/changes.json +5 -5
  7. package/cmd/channel-manipulation/bandbool.js +22 -16
  8. package/cmd/channel-manipulation/ensure-alpha.js +25 -17
  9. package/cmd/channel-manipulation/extract-channel.js +24 -16
  10. package/cmd/channel-manipulation/join-channel.js +17 -15
  11. package/cmd/channel-manipulation/remove-alpha.js +13 -10
  12. package/cmd/colour-manipulation/greyscale.js +17 -11
  13. package/cmd/colour-manipulation/pipeline-colourspace.js +26 -18
  14. package/cmd/colour-manipulation/tint.js +17 -14
  15. package/cmd/colour-manipulation/tocolourspace.js +23 -18
  16. package/cmd/compositing/composite.js +127 -99
  17. package/cmd/operations/affine.js +53 -45
  18. package/cmd/operations/blur.js +44 -36
  19. package/cmd/operations/boolean.js +23 -18
  20. package/cmd/operations/clahe.js +36 -31
  21. package/cmd/operations/convolve.js +51 -43
  22. package/cmd/operations/dilate.js +64 -0
  23. package/cmd/operations/erode.js +64 -0
  24. package/cmd/operations/flatten.js +24 -19
  25. package/cmd/operations/flip.js +12 -10
  26. package/cmd/operations/flop.js +12 -10
  27. package/cmd/operations/gamma.js +27 -20
  28. package/cmd/operations/linear.js +31 -24
  29. package/cmd/operations/median.js +19 -17
  30. package/cmd/operations/modulate.js +36 -26
  31. package/cmd/operations/negate.js +18 -15
  32. package/cmd/operations/normalise.js +27 -20
  33. package/cmd/operations/recomb.js +35 -27
  34. package/cmd/operations/rotate.js +32 -24
  35. package/cmd/operations/sharpen.js +45 -40
  36. package/cmd/operations/threshold.js +30 -24
  37. package/cmd/operations/unflatten.js +15 -11
  38. package/cmd/output.js +59 -51
  39. package/cmd/resizing/extend.js +56 -44
  40. package/cmd/resizing/extract.js +33 -28
  41. package/cmd/resizing/resize.js +80 -51
  42. package/cmd/resizing/trim.js +50 -31
  43. package/lib/cli.js +480 -366
  44. package/lib/constants.js +23 -15
  45. package/lib/convert.js +47 -52
  46. package/lib/index.js +23 -19
  47. package/lib/queue.js +8 -7
  48. package/package.json +12 -13
@@ -0,0 +1,2 @@
1
+ # Ignore artifacts.
2
+ coverage
package/.prettierrc ADDED
@@ -0,0 +1 @@
1
+ {}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.3.0 (August 13, 2026)
4
+
5
+ > Last release compatible with Node.js 18.
6
+
7
+ - Added [`dilate`](https://sharp.pixelplumbing.com/api-operation#dilate) and [`erode`](https://sharp.pixelplumbing.com/api-operation#erode) operations.
8
+ - Added [`--bigtiff`](https://sharp.pixelplumbing.com/api-output#tiff) output option.
9
+ - Added [`--keepDuplicateFrames`](https://sharp.pixelplumbing.com/api-output#gif) output option.
10
+ - Fixes bug where zero (`0`) number option values would be silently ignored (e.g. `--compressionLevel`, `--dither`, `--delay`, or `--effort`).
11
+ - Drop `bubble-stream-error` dependency in favor of Node.js native `stream.pipeline`.
12
+ - Updated `sharp` dependency to 0.34.5.
13
+ - Updated dependencies, including replacing `standard` and `snazzy` with `prettier`.
14
+
3
15
  ## 5.2.0 (June 24, 2025)
4
16
 
5
17
  - Added [`--autoOrient`, `pdfBackground`](https://sharp.pixelplumbing.com/api-constructor/) input option.
@@ -156,16 +168,16 @@
156
168
 
157
169
  ## 1.8.0 (January 5, 2019)
158
170
 
159
- - Added `--background` option to [`resize`](https://sharp.dimens.io/api-resize#resize) and [`rotate`](https://sharp.dimens.io/api-operation#rotate) commands.
160
- - Added [`--fit` and `--position`](https://sharp.dimens.io/api-resize#resize) options.
161
- - Added [`--factorOut`](https://sharp.dimens.io/api-operation#gamma) option.
162
- - Added [`--pyramid`, `--tileWidth`, and `--tileHeight`](https://sharp.dimens.io/api-output#tiff) options.
163
- - Added [`extend`](https://sharp.dimens.io/api-resize#extend) command.
164
- - Added [`flatten`](https://sharp.dimens.io/api-operation#flatten) command.
165
- - Added [`recomb`](https://sharp.dimens.io/api-operation#recomb) command.
171
+ - Added `--background` option to [`resize`](https://sharp.pixelplumbing.com/api-resize#resize) and [`rotate`](https://sharp.pixelplumbing.com/api-operation#rotate) commands.
172
+ - Added [`--fit` and `--position`](https://sharp.pixelplumbing.com/api-resize#resize) options.
173
+ - Added [`--factorOut`](https://sharp.pixelplumbing.com/api-operation#gamma) option.
174
+ - Added [`--pyramid`, `--tileWidth`, and `--tileHeight`](https://sharp.pixelplumbing.com/api-output#tiff) options.
175
+ - Added [`extend`](https://sharp.pixelplumbing.com/api-resize#extend) command.
176
+ - Added [`flatten`](https://sharp.pixelplumbing.com/api-operation#flatten) command.
177
+ - Added [`recomb`](https://sharp.pixelplumbing.com/api-operation#recomb) command.
166
178
  - Removed `--crop`, `--ignoreAspectRatio`, `--min`, and `--max` options.
167
179
  - Removed `background` command.
168
- - Renamed `--tolerance` option to [`--threshold`](https://sharp.dimens.io/api-resize#trim).
180
+ - Renamed `--tolerance` option to [`--threshold`](https://sharp.pixelplumbing.com/api-resize#trim).
169
181
  - Updated `sharp` and `sinon` dependencies.
170
182
 
171
183
  ## 1.7.2 (December 4, 2018)
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/sharp-cli
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [sharp-cli](https://www.npmjs.com/package/sharp-cli) @ 5.2.0 |
17
- | Processed | 2026-03-19 |
16
+ | Original | [sharp-cli](https://www.npmjs.com/package/sharp-cli) @ 5.3.0 |
17
+ | Processed | 2026-08-16 |
18
18
  | Smoke test | failed |
19
19
  | Deps updated | 5 |
20
20
 
@@ -22,11 +22,11 @@ npm install @depup/sharp-cli
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | glob | 11.0.x | ^13.0.6 |
25
+ | glob | 10.5.x | ^13.0.6 |
26
26
  | is-directory | 0.3.x | ^0.3.1 |
27
27
  | lodash.pick | 3.1.0 | ^4.4.0 |
28
- | sharp | 0.34.2 | ^0.34.5 |
29
- | yargs | ^17.6.2 | ^18.0.0 |
28
+ | sharp | 0.34.5 | ^0.35.3 |
29
+ | yargs | ^17.6.2 | ^18.1.0 |
30
30
 
31
31
  ---
32
32
 
package/bin/cli.js CHANGED
@@ -23,10 +23,10 @@
23
23
  */
24
24
 
25
25
  // Strict mode.
26
- 'use strict'
26
+ "use strict";
27
27
 
28
28
  // Package modules.
29
- const { hideBin } = require('yargs/helpers')
29
+ const { hideBin } = require("yargs/helpers");
30
30
 
31
31
  // Run.
32
- require('../lib')(hideBin(process.argv))
32
+ require("../lib")(hideBin(process.argv));
package/changes.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bumped": {
3
3
  "glob": {
4
- "from": "11.0.x",
4
+ "from": "10.5.x",
5
5
  "to": "^13.0.6"
6
6
  },
7
7
  "is-directory": {
@@ -13,14 +13,14 @@
13
13
  "to": "^4.4.0"
14
14
  },
15
15
  "sharp": {
16
- "from": "0.34.2",
17
- "to": "^0.34.5"
16
+ "from": "0.34.5",
17
+ "to": "^0.35.3"
18
18
  },
19
19
  "yargs": {
20
20
  "from": "^17.6.2",
21
- "to": "^18.0.0"
21
+ "to": "^18.1.0"
22
22
  }
23
23
  },
24
- "timestamp": "2026-03-19T03:28:37.858Z",
24
+ "timestamp": "2026-08-16T00:30:09.495Z",
25
25
  "totalUpdated": 5
26
26
  }
@@ -24,38 +24,44 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#bandbool
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const constants = require('../../lib/constants')
31
- const queue = require('../../lib/queue')
30
+ const constants = require("../../lib/constants");
31
+ const queue = require("../../lib/queue");
32
32
 
33
33
  // Configure.
34
34
  const positionals = {
35
35
  operator: {
36
36
  choices: constants.BOOL,
37
- desc: 'Operator to perform that bitwise operation'
38
- }
39
- }
37
+ desc: "Operator to perform that bitwise operation",
38
+ },
39
+ };
40
40
 
41
41
  // Command builder.
42
42
  const builder = (yargs) => {
43
43
  return yargs
44
44
  .strict()
45
- .example('$0 bandbool and', 'The output will be a single channel image where each pixel `P = R & G & B`')
46
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#bandbool')
47
- .positional('operator', positionals.operator)
48
- }
45
+ .example(
46
+ "$0 bandbool and",
47
+ "The output will be a single channel image where each pixel `P = R & G & B`",
48
+ )
49
+ .epilog(
50
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#bandbool",
51
+ )
52
+ .positional("operator", positionals.operator);
53
+ };
49
54
 
50
55
  // Command handler.
51
56
  const handler = (args) => {
52
- return queue.push(['bandbool', (sharp) => sharp.bandbool(args.operator)])
53
- }
57
+ return queue.push(["bandbool", (sharp) => sharp.bandbool(args.operator)]);
58
+ };
54
59
 
55
60
  // Exports.
56
61
  module.exports = {
57
- command: 'bandbool <operator>',
58
- describe: 'Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image',
62
+ command: "bandbool <operator>",
63
+ describe:
64
+ "Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image",
59
65
  builder,
60
- handler
61
- }
66
+ handler,
67
+ };
@@ -24,39 +24,47 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#ensurealpha
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const queue = require('../../lib/queue')
30
+ const queue = require("../../lib/queue");
31
31
 
32
32
  // Configure.
33
33
  const positionals = {
34
34
  alpha: {
35
35
  default: 1,
36
- desc: 'Alpha transparency level',
37
- type: 'number'
38
- }
39
- }
36
+ desc: "Alpha transparency level",
37
+ type: "number",
38
+ },
39
+ };
40
40
 
41
41
  // Command builder.
42
42
  const builder = (yargs) => {
43
43
  return yargs
44
44
  .strict()
45
- .example('$0 ensureAlpha', 'The output will be a 4 channel image with a fully-opaque alpha channel')
46
- .example('$0 ensureAlpha 0', 'The output will be a 4 channel image with a fully-transparent alpha channel')
47
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#removealpha')
48
- .positional('alpha', positionals.alpha)
49
- }
45
+ .example(
46
+ "$0 ensureAlpha",
47
+ "The output will be a 4 channel image with a fully-opaque alpha channel",
48
+ )
49
+ .example(
50
+ "$0 ensureAlpha 0",
51
+ "The output will be a 4 channel image with a fully-transparent alpha channel",
52
+ )
53
+ .epilog(
54
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#removealpha",
55
+ )
56
+ .positional("alpha", positionals.alpha);
57
+ };
50
58
 
51
59
  // Command handler.
52
60
  const handler = (args) => {
53
- return queue.push(['ensureAlpha', (sharp) => sharp.ensureAlpha(args.alpha)])
54
- }
61
+ return queue.push(["ensureAlpha", (sharp) => sharp.ensureAlpha(args.alpha)]);
62
+ };
55
63
 
56
64
  // Exports.
57
65
  module.exports = {
58
- command: 'ensureAlpha [alpha]',
59
- describe: 'Ensure the output image has an alpha transparency channel',
66
+ command: "ensureAlpha [alpha]",
67
+ describe: "Ensure the output image has an alpha transparency channel",
60
68
  builder,
61
- handler
62
- }
69
+ handler,
70
+ };
@@ -24,38 +24,46 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#extractchannel
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const constants = require('../../lib/constants')
31
- const queue = require('../../lib/queue')
30
+ const constants = require("../../lib/constants");
31
+ const queue = require("../../lib/queue");
32
32
 
33
33
  // Configure.
34
34
  const positionals = {
35
35
  channel: {
36
36
  choices: constants.CHANNEL,
37
- desc: 'The channel/band number to extract'
38
- }
39
- }
37
+ desc: "The channel/band number to extract",
38
+ },
39
+ };
40
40
 
41
41
  // Command builder.
42
42
  const builder = (yargs) => {
43
43
  return yargs
44
44
  .strict()
45
- .example('$0 extractChannel green', 'The output will contain the green channel of the input image')
46
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#extractchannel')
47
- .positional('channel', positionals.channel)
48
- }
45
+ .example(
46
+ "$0 extractChannel green",
47
+ "The output will contain the green channel of the input image",
48
+ )
49
+ .epilog(
50
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#extractchannel",
51
+ )
52
+ .positional("channel", positionals.channel);
53
+ };
49
54
 
50
55
  // Command handler.
51
56
  const handler = (args) => {
52
- return queue.push(['extractChannel', (sharp) => sharp.extractChannel(args.channel)])
53
- }
57
+ return queue.push([
58
+ "extractChannel",
59
+ (sharp) => sharp.extractChannel(args.channel),
60
+ ]);
61
+ };
54
62
 
55
63
  // Exports.
56
64
  module.exports = {
57
- command: 'extractChannel <channel>',
58
- describe: 'Extract a single channel from a multi-channel image',
65
+ command: "extractChannel <channel>",
66
+ describe: "Extract a single channel from a multi-channel image",
59
67
  builder,
60
- handler
61
- }
68
+ handler,
69
+ };
@@ -24,37 +24,39 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#joinchannel
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const queue = require('../../lib/queue')
30
+ const queue = require("../../lib/queue");
31
31
 
32
32
  // Configure.
33
33
  const positionals = {
34
34
  images: {
35
- desc: 'One or more images',
35
+ desc: "One or more images",
36
36
  normalize: true,
37
- type: 'array'
38
- }
39
- }
37
+ type: "array",
38
+ },
39
+ };
40
40
 
41
41
  // Command builder.
42
42
  const builder = (yargs) => {
43
43
  return yargs
44
44
  .strict()
45
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#joinchannel')
46
- .positional('images', positionals.images)
47
- }
45
+ .epilog(
46
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#joinchannel",
47
+ )
48
+ .positional("images", positionals.images);
49
+ };
48
50
 
49
51
  // Command handler.
50
52
  const handler = (args) => {
51
- return queue.push(['joinChannel', (sharp) => sharp.joinChannel(args.images)])
52
- }
53
+ return queue.push(["joinChannel", (sharp) => sharp.joinChannel(args.images)]);
54
+ };
53
55
 
54
56
  // Exports.
55
57
  module.exports = {
56
- command: 'joinChannel <images..>',
57
- describe: 'Join one or more channels to the image',
58
+ command: "joinChannel <images..>",
59
+ describe: "Join one or more channels to the image",
58
60
  builder,
59
- handler
60
- }
61
+ handler,
62
+ };
@@ -24,26 +24,29 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#removealpha
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const queue = require('../../lib/queue')
30
+ const queue = require("../../lib/queue");
31
31
 
32
32
  // Command builder.
33
33
  const builder = (yargs) => {
34
34
  return yargs
35
35
  .strict()
36
- .example('$0 removeAlpha', 'The output will be without an alpha channel')
37
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#removealpha')
38
- }
36
+ .example("$0 removeAlpha", "The output will be without an alpha channel")
37
+ .epilog(
38
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#removealpha",
39
+ );
40
+ };
39
41
 
40
42
  // Command handler.
41
- const handler = (args) => queue.push(['removeAlpha', (sharp) => sharp.removeAlpha()])
43
+ const handler = (args) =>
44
+ queue.push(["removeAlpha", (sharp) => sharp.removeAlpha()]);
42
45
 
43
46
  // Exports.
44
47
  module.exports = {
45
- command: 'removeAlpha',
46
- describe: 'Remove alpha channel, if any',
48
+ command: "removeAlpha",
49
+ describe: "Remove alpha channel, if any",
47
50
  builder,
48
- handler
49
- }
51
+ handler,
52
+ };
@@ -24,27 +24,33 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-colour#greyscale
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const queue = require('../../lib/queue')
30
+ const queue = require("../../lib/queue");
31
31
 
32
32
  // Command builder.
33
33
  const builder = (yargs) => {
34
34
  return yargs
35
35
  .strict()
36
- .example('$0 greyscale', 'The output will contain three identical color channels')
37
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#greyscale')
38
- }
36
+ .example(
37
+ "$0 greyscale",
38
+ "The output will contain three identical color channels",
39
+ )
40
+ .epilog(
41
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#greyscale",
42
+ );
43
+ };
39
44
 
40
45
  // Command handler.
41
- const handler = (args) => queue.push(['greyscale', (sharp) => sharp.greyscale()])
46
+ const handler = (args) =>
47
+ queue.push(["greyscale", (sharp) => sharp.greyscale()]);
42
48
 
43
49
  // Exports.
44
50
  module.exports = {
45
- command: 'greyscale',
46
- aliases: 'grayscale',
47
- describe: 'Convert to 8-bit greyscale; 256 shades of grey',
51
+ command: "greyscale",
52
+ aliases: "grayscale",
53
+ describe: "Convert to 8-bit greyscale; 256 shades of grey",
48
54
  builder,
49
- handler
50
- }
55
+ handler,
56
+ };
@@ -24,40 +24,48 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-colour#tocolourspace
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const constants = require('../../lib/constants')
31
- const queue = require('../../lib/queue')
30
+ const constants = require("../../lib/constants");
31
+ const queue = require("../../lib/queue");
32
32
 
33
33
  // Configure.
34
34
  const positionals = {
35
35
  colourspace: {
36
- alias: 'colorspace',
36
+ alias: "colorspace",
37
37
  choices: constants.COLOURSPACE,
38
- desc: 'Pipeline colourspace'
39
- }
40
- }
38
+ desc: "Pipeline colourspace",
39
+ },
40
+ };
41
41
 
42
42
  // Command builder.
43
43
  const builder = (yargs) => {
44
44
  return yargs
45
45
  .strict()
46
- .example('$0 pipelineColourspace rgb16', 'Run the pipeline in 16 bits per channel RGB')
47
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#tocolourspace')
48
- .positional('colourspacae', positionals.colourspace)
49
- }
46
+ .example(
47
+ "$0 pipelineColourspace rgb16",
48
+ "Run the pipeline in 16 bits per channel RGB",
49
+ )
50
+ .epilog(
51
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#tocolourspace",
52
+ )
53
+ .positional("colourspacae", positionals.colourspace);
54
+ };
50
55
 
51
56
  // Command handler.
52
57
  const handler = (args) => {
53
- return queue.push(['pipelineColourspace', (sharp) => sharp.pipelineColourspace(args.colourspace)])
54
- }
58
+ return queue.push([
59
+ "pipelineColourspace",
60
+ (sharp) => sharp.pipelineColourspace(args.colourspace),
61
+ ]);
62
+ };
55
63
 
56
64
  // Exports.
57
65
  module.exports = {
58
- command: 'pipelineColourspace <colourspace>',
59
- aliases: 'pipelineColorspace',
60
- describe: 'Set the pipeline colourspace',
66
+ command: "pipelineColourspace <colourspace>",
67
+ aliases: "pipelineColorspace",
68
+ describe: "Set the pipeline colourspace",
61
69
  builder,
62
- handler
63
- }
70
+ handler,
71
+ };
@@ -24,35 +24,38 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-colour#tint
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const queue = require('../../lib/queue')
30
+ const queue = require("../../lib/queue");
31
31
 
32
32
  // Configure.
33
33
  const positionals = {
34
34
  rgb: {
35
- desc: 'Parsed by the color module to extract chroma values',
36
- type: 'string'
37
- }
38
- }
35
+ desc: "Parsed by the color module to extract chroma values",
36
+ type: "string",
37
+ },
38
+ };
39
39
 
40
40
  // Command builder.
41
41
  const builder = (yargs) => {
42
42
  return yargs
43
43
  .strict()
44
44
  .example('$0 tint "rgb(255, 240, 16)"')
45
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#tint')
46
- .positional('rgb', positionals.rgb)
47
- }
45
+ .epilog(
46
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#tint",
47
+ )
48
+ .positional("rgb", positionals.rgb);
49
+ };
48
50
 
49
51
  // Command handler.
50
- const handler = (args) => queue.push(['tint', (sharp) => sharp.tint(args.rgb)])
52
+ const handler = (args) => queue.push(["tint", (sharp) => sharp.tint(args.rgb)]);
51
53
 
52
54
  // Exports.
53
55
  module.exports = {
54
- command: 'tint <rgb>',
55
- describe: 'Tint the image using the provided chroma while preserving the image luminance',
56
+ command: "tint <rgb>",
57
+ describe:
58
+ "Tint the image using the provided chroma while preserving the image luminance",
56
59
  builder,
57
- handler
58
- }
60
+ handler,
61
+ };
@@ -24,40 +24,45 @@
24
24
  // @see https://sharp.pixelplumbing.com/api-colour#tocolourspace
25
25
 
26
26
  // Strict mode.
27
- 'use strict'
27
+ "use strict";
28
28
 
29
29
  // Local modules.
30
- const constants = require('../../lib/constants')
31
- const queue = require('../../lib/queue')
30
+ const constants = require("../../lib/constants");
31
+ const queue = require("../../lib/queue");
32
32
 
33
33
  // Configure.
34
34
  const positionals = {
35
35
  colourspace: {
36
36
  choices: constants.COLOURSPACE,
37
- default: 'srgb',
38
- desc: 'The output colourspace'
39
- }
40
- }
37
+ default: "srgb",
38
+ desc: "The output colourspace",
39
+ },
40
+ };
41
41
 
42
42
  // Command builder.
43
43
  const builder = (yargs) => {
44
44
  return yargs
45
45
  .strict()
46
- .example('$0 toColourspace rgb16', 'Output 16 bits per pixel RGB')
47
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#tocolourspace')
48
- .positional('colourspace', positionals.colourspace)
49
- }
46
+ .example("$0 toColourspace rgb16", "Output 16 bits per pixel RGB")
47
+ .epilog(
48
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#tocolourspace",
49
+ )
50
+ .positional("colourspace", positionals.colourspace);
51
+ };
50
52
 
51
53
  // Command handler.
52
54
  const handler = (args) => {
53
- return queue.push(['toColourspace', (sharp) => sharp.toColourspace(args.colourspace)])
54
- }
55
+ return queue.push([
56
+ "toColourspace",
57
+ (sharp) => sharp.toColourspace(args.colourspace),
58
+ ]);
59
+ };
55
60
 
56
61
  // Exports.
57
62
  module.exports = {
58
- command: 'toColourspace <colourspace>',
59
- aliases: 'toColorspace',
60
- describe: 'Set the output colourspace',
63
+ command: "toColourspace <colourspace>",
64
+ aliases: "toColorspace",
65
+ describe: "Set the output colourspace",
61
66
  builder,
62
- handler
63
- }
67
+ handler,
68
+ };