@cto.af/linewrap-cli 2.1.0 → 2.1.1

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 (2) hide show
  1. package/bin/linewrap.js +7 -2
  2. package/package.json +3 -11
package/bin/linewrap.js CHANGED
@@ -7,6 +7,10 @@ import fs from 'fs';
7
7
  import os from 'os';
8
8
  import {parseArgsWithHelp} from 'minus-h';
9
9
 
10
+ export const DEFAULTS = {
11
+ width: process.stdout.columns ?? 80,
12
+ };
13
+
10
14
  /**
11
15
  * @type {Parameters<generateHelp>[0]}
12
16
  */
@@ -121,7 +125,7 @@ const config = {
121
125
  width: {
122
126
  short: 'w',
123
127
  type: 'string',
124
- default: String(process.stdout.columns ?? 80),
128
+ default: String(DEFAULTS.width),
125
129
  argumentName: 'columns',
126
130
  description: 'maximum line length',
127
131
  },
@@ -177,11 +181,12 @@ export async function main(
177
181
  options,
178
182
  process = {exit, stdin, stdout, stderr}
179
183
  ) {
184
+ config.options.width.default = String(DEFAULTS.width);
180
185
  const {values, positionals} = parseArgsWithHelp({
181
186
  ...config,
182
187
  ...extraConfig,
183
188
  }, {
184
- width: config.options.width.default,
189
+ width: DEFAULTS.width,
185
190
  ...options,
186
191
  });
187
192
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cto.af/linewrap-cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Wrap lines using the Unicode Line Breaking algorithm from UAX #14",
5
5
  "type": "module",
6
6
  "bin": {
@@ -26,18 +26,10 @@
26
26
  "license": "MIT",
27
27
  "repository": "cto-af/linewrap-cli",
28
28
  "dependencies": {
29
- "@cto.af/linewrap": "2.1.0",
29
+ "@cto.af/linewrap": "2.1.3",
30
30
  "minus-h": "2.1.0"
31
31
  },
32
- "devDependencies": {
33
- "@cto.af/eslint-config": "4.1.5",
34
- "@types/node": "22.1.0",
35
- "c8": "10.1.2",
36
- "eslint": "9.8.0",
37
- "eslint-plugin-mocha": "10.5.0",
38
- "mocha": "10.7.0"
39
- },
40
- "packageManager": "pnpm@9.7.0",
32
+ "packageManager": "pnpm@9.10.0",
41
33
  "engines": {
42
34
  "node": ">= 18"
43
35
  }