@depup/sharp-cli 5.2.0-depup.0 → 6.0.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 (50) hide show
  1. package/.github/workflows/ci.yml +30 -0
  2. package/.prettierignore +2 -0
  3. package/.prettierrc +1 -0
  4. package/CHANGELOG.md +40 -8
  5. package/README.md +6 -9
  6. package/bin/cli.js +5 -5
  7. package/changes.json +5 -17
  8. package/cmd/channel-manipulation/bandbool.js +24 -19
  9. package/cmd/channel-manipulation/ensure-alpha.js +27 -22
  10. package/cmd/channel-manipulation/extract-channel.js +23 -19
  11. package/cmd/channel-manipulation/join-channel.js +19 -20
  12. package/cmd/channel-manipulation/remove-alpha.js +12 -15
  13. package/cmd/colour-manipulation/greyscale.js +16 -16
  14. package/cmd/colour-manipulation/pipeline-colourspace.js +26 -22
  15. package/cmd/colour-manipulation/tint.js +17 -19
  16. package/cmd/colour-manipulation/tocolourspace.js +22 -21
  17. package/cmd/compositing/composite.js +133 -102
  18. package/cmd/operations/affine.js +57 -51
  19. package/cmd/operations/blur.js +44 -41
  20. package/cmd/operations/boolean.js +22 -21
  21. package/cmd/operations/clahe.js +37 -37
  22. package/cmd/operations/convolve.js +52 -48
  23. package/cmd/operations/dilate.js +58 -0
  24. package/cmd/operations/erode.js +58 -0
  25. package/cmd/operations/flatten.js +23 -24
  26. package/cmd/operations/flip.js +12 -15
  27. package/cmd/operations/flop.js +12 -15
  28. package/cmd/operations/gamma.js +26 -25
  29. package/cmd/operations/linear.js +30 -29
  30. package/cmd/operations/median.js +18 -22
  31. package/cmd/operations/modulate.js +42 -31
  32. package/cmd/operations/negate.js +17 -20
  33. package/cmd/operations/normalise.js +28 -25
  34. package/cmd/operations/recomb.js +34 -32
  35. package/cmd/operations/rotate.js +31 -29
  36. package/cmd/operations/sharpen.js +49 -45
  37. package/cmd/operations/threshold.js +29 -29
  38. package/cmd/operations/unflatten.js +14 -16
  39. package/cmd/output.js +61 -56
  40. package/cmd/resizing/extend.js +55 -49
  41. package/cmd/resizing/extract.js +32 -33
  42. package/cmd/resizing/resize.js +79 -56
  43. package/cmd/resizing/trim.js +59 -36
  44. package/{lib/queue.js → eslint.config.mjs} +21 -17
  45. package/lib/cli.js +637 -383
  46. package/lib/constants.js +24 -18
  47. package/lib/convert.js +106 -73
  48. package/lib/index.js +56 -23
  49. package/lib/utils.js +50 -0
  50. package/package.json +27 -37
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Check out repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Node.js
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: "20.10.0"
24
+ cache: npm
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: Lint and test
30
+ run: npm test
@@ -0,0 +1,2 @@
1
+ # Ignore artifacts.
2
+ coverage
package/.prettierrc ADDED
@@ -0,0 +1 @@
1
+ {}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.0 (August 21, 2026)
4
+
5
+ - Added [`--limitInputChannels`](https://sharp.pixelplumbing.com/api-constructor/) input option.
6
+ - Added `--dry` option to process images without writing output files.
7
+ - Added [`--exact`](https://sharp.pixelplumbing.com/api-output#webp) output option.
8
+ - Added [`--keepGainMap`](https://sharp.pixelplumbing.com/api-output#keepgainmap) and [`--withGainMap`](https://sharp.pixelplumbing.com/api-output#withgainmap) output options.
9
+ - Added `--print` option to print input and output metadata as JSON ([#48](https://github.com/vseventer/sharp-cli/issues/48)).
10
+ - Added [`--tune`](https://sharp.pixelplumbing.com/api-output#avif) output option.
11
+ - Added [`--withDensity`](https://sharp.pixelplumbing.com/api-output#withdensity) output option.
12
+ - Added [`--margin`](https://sharp.pixelplumbing.com/api-resize#trim) option to the `trim` command.
13
+ - Removed `jpg` output format alias; use `jpeg` instead.
14
+ - Added graceful handling of partial failures during batch image processing ([#98](https://github.com/vseventer/sharp-cli/issues/98)).
15
+ - Fixes bug where format options could cause errors. Consequently, removed `jpg` output format alias; use `jpeg` instead ([#92](https://github.com/vseventer/sharp-cli/issues/92)).
16
+ - Drop `must` dependency in favor of Node.js native `assert`.
17
+ - Internal refactor from CommonJS to ESM.
18
+ - Tightened `yargs` option configuration to require values.
19
+ - Updated `sharp` dependency to 0.35.3.
20
+ - Updated dependencies.
21
+ - Requires Node.js 20.10.
22
+
23
+ ## 5.3.0 (August 13, 2026)
24
+
25
+ > Last release compatible with Node.js 18.
26
+
27
+ - Added [`dilate`](https://sharp.pixelplumbing.com/api-operation#dilate) and [`erode`](https://sharp.pixelplumbing.com/api-operation#erode) operations.
28
+ - Added [`--bigtiff`](https://sharp.pixelplumbing.com/api-output#tiff) output option.
29
+ - Added [`--keepDuplicateFrames`](https://sharp.pixelplumbing.com/api-output#gif) output option.
30
+ - Fixes bug where zero (`0`) number option values would be silently ignored (e.g. `--compressionLevel`, `--dither`, `--delay`, or `--effort`).
31
+ - Drop `bubble-stream-error` dependency in favor of Node.js native `stream.pipeline`.
32
+ - Updated `sharp` dependency to 0.34.5.
33
+ - Updated dependencies, including replacing `standard` and `snazzy` with `prettier`.
34
+
3
35
  ## 5.2.0 (June 24, 2025)
4
36
 
5
37
  - Added [`--autoOrient`, `pdfBackground`](https://sharp.pixelplumbing.com/api-constructor/) input option.
@@ -156,16 +188,16 @@
156
188
 
157
189
  ## 1.8.0 (January 5, 2019)
158
190
 
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.
191
+ - Added `--background` option to [`resize`](https://sharp.pixelplumbing.com/api-resize#resize) and [`rotate`](https://sharp.pixelplumbing.com/api-operation#rotate) commands.
192
+ - Added [`--fit` and `--position`](https://sharp.pixelplumbing.com/api-resize#resize) options.
193
+ - Added [`--factorOut`](https://sharp.pixelplumbing.com/api-operation#gamma) option.
194
+ - Added [`--pyramid`, `--tileWidth`, and `--tileHeight`](https://sharp.pixelplumbing.com/api-output#tiff) options.
195
+ - Added [`extend`](https://sharp.pixelplumbing.com/api-resize#extend) command.
196
+ - Added [`flatten`](https://sharp.pixelplumbing.com/api-operation#flatten) command.
197
+ - Added [`recomb`](https://sharp.pixelplumbing.com/api-operation#recomb) command.
166
198
  - Removed `--crop`, `--ignoreAspectRatio`, `--min`, and `--max` options.
167
199
  - Removed `background` command.
168
- - Renamed `--tolerance` option to [`--threshold`](https://sharp.dimens.io/api-resize#trim).
200
+ - Renamed `--tolerance` option to [`--threshold`](https://sharp.pixelplumbing.com/api-resize#trim).
169
201
  - Updated `sharp` and `sinon` dependencies.
170
202
 
171
203
  ## 1.7.2 (December 4, 2018)
package/README.md CHANGED
@@ -13,20 +13,17 @@ 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 |
18
- | Smoke test | failed |
19
- | Deps updated | 5 |
16
+ | Original | [sharp-cli](https://www.npmjs.com/package/sharp-cli) @ 6.0.0 |
17
+ | Processed | 2026-08-23 |
18
+ | Smoke test | passed |
19
+ | Deps updated | 2 |
20
20
 
21
21
  ## Dependency Changes
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | glob | 11.0.x | ^13.0.6 |
26
- | is-directory | 0.3.x | ^0.3.1 |
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 |
25
+ | glob | 13.0.x | ^13.0.6 |
26
+ | yargs | 17.7.x | ^18.1.0 |
30
27
 
31
28
  ---
32
29
 
package/bin/cli.js CHANGED
@@ -22,11 +22,11 @@
22
22
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
24
 
25
- // Strict mode.
26
- 'use strict'
27
-
28
25
  // Package modules.
29
- const { hideBin } = require('yargs/helpers')
26
+ import { hideBin } from "yargs/helpers";
27
+
28
+ // Local modules.
29
+ import sharp from "../lib/index.js";
30
30
 
31
31
  // Run.
32
- require('../lib')(hideBin(process.argv))
32
+ sharp(hideBin(process.argv));
package/changes.json CHANGED
@@ -1,26 +1,14 @@
1
1
  {
2
2
  "bumped": {
3
3
  "glob": {
4
- "from": "11.0.x",
4
+ "from": "13.0.x",
5
5
  "to": "^13.0.6"
6
6
  },
7
- "is-directory": {
8
- "from": "0.3.x",
9
- "to": "^0.3.1"
10
- },
11
- "lodash.pick": {
12
- "from": "3.1.0",
13
- "to": "^4.4.0"
14
- },
15
- "sharp": {
16
- "from": "0.34.2",
17
- "to": "^0.34.5"
18
- },
19
7
  "yargs": {
20
- "from": "^17.6.2",
21
- "to": "^18.0.0"
8
+ "from": "17.7.x",
9
+ "to": "^18.1.0"
22
10
  }
23
11
  },
24
- "timestamp": "2026-03-19T03:28:37.858Z",
25
- "totalUpdated": 5
12
+ "timestamp": "2026-08-23T00:28:58.451Z",
13
+ "totalUpdated": 2
26
14
  }
@@ -23,39 +23,44 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#bandbool
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
26
  // Local modules.
30
- const constants = require('../../lib/constants')
31
- const queue = require('../../lib/queue')
27
+ import constants from "../../lib/constants.js";
32
28
 
33
29
  // Configure.
34
30
  const positionals = {
35
31
  operator: {
36
32
  choices: constants.BOOL,
37
- desc: 'Operator to perform that bitwise operation'
38
- }
39
- }
33
+ desc: "Operator to perform that bitwise operation",
34
+ },
35
+ };
40
36
 
41
37
  // Command builder.
42
38
  const builder = (yargs) => {
43
39
  return yargs
44
40
  .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
- }
41
+ .example(
42
+ "$0 bandbool and",
43
+ "The output will be a single channel image where each pixel `P = R & G & B`",
44
+ )
45
+ .epilog(
46
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#bandbool",
47
+ )
48
+ .positional("operator", positionals.operator);
49
+ };
49
50
 
50
51
  // Command handler.
51
52
  const handler = (args) => {
52
- return queue.push(['bandbool', (sharp) => sharp.bandbool(args.operator)])
53
- }
53
+ return args["#queue"].push([
54
+ "bandbool",
55
+ (sharp) => sharp.bandbool(args.operator),
56
+ ]);
57
+ };
54
58
 
55
59
  // Exports.
56
- 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',
60
+ export default {
61
+ command: "bandbool <operator>",
62
+ describe:
63
+ "Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image",
59
64
  builder,
60
- handler
61
- }
65
+ handler,
66
+ };
@@ -23,40 +23,45 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#ensurealpha
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Configure.
33
27
  const positionals = {
34
28
  alpha: {
35
29
  default: 1,
36
- desc: 'Alpha transparency level',
37
- type: 'number'
38
- }
39
- }
30
+ desc: "Alpha transparency level",
31
+ type: "number",
32
+ },
33
+ };
40
34
 
41
35
  // Command builder.
42
36
  const builder = (yargs) => {
43
37
  return yargs
44
38
  .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
- }
39
+ .example(
40
+ "$0 ensureAlpha",
41
+ "The output will be a 4 channel image with a fully-opaque alpha channel",
42
+ )
43
+ .example(
44
+ "$0 ensureAlpha 0",
45
+ "The output will be a 4 channel image with a fully-transparent alpha channel",
46
+ )
47
+ .epilog(
48
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#removealpha",
49
+ )
50
+ .positional("alpha", positionals.alpha);
51
+ };
50
52
 
51
53
  // Command handler.
52
54
  const handler = (args) => {
53
- return queue.push(['ensureAlpha', (sharp) => sharp.ensureAlpha(args.alpha)])
54
- }
55
+ return args["#queue"].push([
56
+ "ensureAlpha",
57
+ (sharp) => sharp.ensureAlpha(args.alpha),
58
+ ]);
59
+ };
55
60
 
56
61
  // Exports.
57
- module.exports = {
58
- command: 'ensureAlpha [alpha]',
59
- describe: 'Ensure the output image has an alpha transparency channel',
62
+ export default {
63
+ command: "ensureAlpha [alpha]",
64
+ describe: "Ensure the output image has an alpha transparency channel",
60
65
  builder,
61
- handler
62
- }
66
+ handler,
67
+ };
@@ -23,39 +23,43 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#extractchannel
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
26
  // Local modules.
30
- const constants = require('../../lib/constants')
31
- const queue = require('../../lib/queue')
27
+ import constants from "../../lib/constants.js";
32
28
 
33
29
  // Configure.
34
30
  const positionals = {
35
31
  channel: {
36
32
  choices: constants.CHANNEL,
37
- desc: 'The channel/band number to extract'
38
- }
39
- }
33
+ desc: "The channel/band number to extract",
34
+ },
35
+ };
40
36
 
41
37
  // Command builder.
42
38
  const builder = (yargs) => {
43
39
  return yargs
44
40
  .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
- }
41
+ .example(
42
+ "$0 extractChannel green",
43
+ "The output will contain the green channel of the input image",
44
+ )
45
+ .epilog(
46
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#extractchannel",
47
+ )
48
+ .positional("channel", positionals.channel);
49
+ };
49
50
 
50
51
  // Command handler.
51
52
  const handler = (args) => {
52
- return queue.push(['extractChannel', (sharp) => sharp.extractChannel(args.channel)])
53
- }
53
+ return args["#queue"].push([
54
+ "extractChannel",
55
+ (sharp) => sharp.extractChannel(args.channel),
56
+ ]);
57
+ };
54
58
 
55
59
  // Exports.
56
- module.exports = {
57
- command: 'extractChannel <channel>',
58
- describe: 'Extract a single channel from a multi-channel image',
60
+ export default {
61
+ command: "extractChannel <channel>",
62
+ describe: "Extract a single channel from a multi-channel image",
59
63
  builder,
60
- handler
61
- }
64
+ handler,
65
+ };
@@ -23,38 +23,37 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#joinchannel
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Configure.
33
27
  const positionals = {
34
28
  images: {
35
- desc: 'One or more images',
29
+ desc: "One or more images",
36
30
  normalize: true,
37
- type: 'array'
38
- }
39
- }
31
+ type: "array",
32
+ },
33
+ };
40
34
 
41
35
  // Command builder.
42
36
  const builder = (yargs) => {
43
37
  return yargs
44
38
  .strict()
45
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#joinchannel')
46
- .positional('images', positionals.images)
47
- }
39
+ .epilog(
40
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#joinchannel",
41
+ )
42
+ .positional("images", positionals.images);
43
+ };
48
44
 
49
45
  // Command handler.
50
46
  const handler = (args) => {
51
- return queue.push(['joinChannel', (sharp) => sharp.joinChannel(args.images)])
52
- }
47
+ return args["#queue"].push([
48
+ "joinChannel",
49
+ (sharp) => sharp.joinChannel(args.images),
50
+ ]);
51
+ };
53
52
 
54
53
  // Exports.
55
- module.exports = {
56
- command: 'joinChannel <images..>',
57
- describe: 'Join one or more channels to the image',
54
+ export default {
55
+ command: "joinChannel <images..>",
56
+ describe: "Join one or more channels to the image",
58
57
  builder,
59
- handler
60
- }
58
+ handler,
59
+ };
@@ -23,27 +23,24 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-channel#removealpha
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Command builder.
33
27
  const builder = (yargs) => {
34
28
  return yargs
35
29
  .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
- }
30
+ .example("$0 removeAlpha", "The output will be without an alpha channel")
31
+ .epilog(
32
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-channel#removealpha",
33
+ );
34
+ };
39
35
 
40
36
  // Command handler.
41
- const handler = (args) => queue.push(['removeAlpha', (sharp) => sharp.removeAlpha()])
37
+ const handler = (args) =>
38
+ args["#queue"].push(["removeAlpha", (sharp) => sharp.removeAlpha()]);
42
39
 
43
40
  // Exports.
44
- module.exports = {
45
- command: 'removeAlpha',
46
- describe: 'Remove alpha channel, if any',
41
+ export default {
42
+ command: "removeAlpha",
43
+ describe: "Remove alpha channel, if any",
47
44
  builder,
48
- handler
49
- }
45
+ handler,
46
+ };
@@ -23,28 +23,28 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-colour#greyscale
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Command builder.
33
27
  const builder = (yargs) => {
34
28
  return yargs
35
29
  .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
- }
30
+ .example(
31
+ "$0 greyscale",
32
+ "The output will contain three identical color channels",
33
+ )
34
+ .epilog(
35
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#greyscale",
36
+ );
37
+ };
39
38
 
40
39
  // Command handler.
41
- const handler = (args) => queue.push(['greyscale', (sharp) => sharp.greyscale()])
40
+ const handler = (args) =>
41
+ args["#queue"].push(["greyscale", (sharp) => sharp.greyscale()]);
42
42
 
43
43
  // Exports.
44
- module.exports = {
45
- command: 'greyscale',
46
- aliases: 'grayscale',
47
- describe: 'Convert to 8-bit greyscale; 256 shades of grey',
44
+ export default {
45
+ command: "greyscale",
46
+ aliases: "grayscale",
47
+ describe: "Convert to 8-bit greyscale; 256 shades of grey",
48
48
  builder,
49
- handler
50
- }
49
+ handler,
50
+ };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * The MIT License (MIT)
3
3
  *
4
- * Copyright (c) 2022 Mark van Seventer
4
+ * Copyright (c) 2019 Mark van Seventer
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
7
  * this software and associated documentation files (the "Software"), to deal in
@@ -23,41 +23,45 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-colour#tocolourspace
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
26
  // Local modules.
30
- const constants = require('../../lib/constants')
31
- const queue = require('../../lib/queue')
27
+ import constants from "../../lib/constants.js";
32
28
 
33
29
  // Configure.
34
30
  const positionals = {
35
31
  colourspace: {
36
- alias: 'colorspace',
32
+ alias: "colorspace",
37
33
  choices: constants.COLOURSPACE,
38
- desc: 'Pipeline colourspace'
39
- }
40
- }
34
+ desc: "Pipeline colourspace",
35
+ },
36
+ };
41
37
 
42
38
  // Command builder.
43
39
  const builder = (yargs) => {
44
40
  return yargs
45
41
  .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
- }
42
+ .example(
43
+ "$0 pipelineColourspace rgb16",
44
+ "Run the pipeline in 16 bits per channel RGB",
45
+ )
46
+ .epilog(
47
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#tocolourspace",
48
+ )
49
+ .positional("colourspacae", positionals.colourspace);
50
+ };
50
51
 
51
52
  // Command handler.
52
53
  const handler = (args) => {
53
- return queue.push(['pipelineColourspace', (sharp) => sharp.pipelineColourspace(args.colourspace)])
54
- }
54
+ return args["#queue"].push([
55
+ "pipelineColourspace",
56
+ (sharp) => sharp.pipelineColourspace(args.colourspace),
57
+ ]);
58
+ };
55
59
 
56
60
  // Exports.
57
- module.exports = {
58
- command: 'pipelineColourspace <colourspace>',
59
- aliases: 'pipelineColorspace',
60
- describe: 'Set the pipeline colourspace',
61
+ export default {
62
+ command: "pipelineColourspace <colourspace>",
63
+ aliases: "pipelineColorspace",
64
+ describe: "Set the pipeline colourspace",
61
65
  builder,
62
- handler
63
- }
66
+ handler,
67
+ };
@@ -23,36 +23,34 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-colour#tint
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Configure.
33
27
  const positionals = {
34
28
  rgb: {
35
- desc: 'Parsed by the color module to extract chroma values',
36
- type: 'string'
37
- }
38
- }
29
+ desc: "Parsed by the color module to extract chroma values",
30
+ type: "string",
31
+ },
32
+ };
39
33
 
40
34
  // Command builder.
41
35
  const builder = (yargs) => {
42
36
  return yargs
43
37
  .strict()
44
38
  .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
- }
39
+ .epilog(
40
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-colour#tint",
41
+ )
42
+ .positional("rgb", positionals.rgb);
43
+ };
48
44
 
49
45
  // Command handler.
50
- const handler = (args) => queue.push(['tint', (sharp) => sharp.tint(args.rgb)])
46
+ const handler = (args) =>
47
+ args["#queue"].push(["tint", (sharp) => sharp.tint(args.rgb)]);
51
48
 
52
49
  // Exports.
53
- module.exports = {
54
- command: 'tint <rgb>',
55
- describe: 'Tint the image using the provided chroma while preserving the image luminance',
50
+ export default {
51
+ command: "tint <rgb>",
52
+ describe:
53
+ "Tint the image using the provided chroma while preserving the image luminance",
56
54
  builder,
57
- handler
58
- }
55
+ handler,
56
+ };