@cto.af/linewrap-cli 2.1.1 → 3.0.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.
- package/bin/linewrap.js +5 -10
- package/package.json +6 -6
package/bin/linewrap.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {inspect, promisify} from 'util';
|
|
3
|
+
import {inspect, promisify} from 'node:util';
|
|
4
4
|
import {LineWrap} from '@cto.af/linewrap';
|
|
5
|
-
import {fileURLToPath} from 'url';
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import os from 'os';
|
|
5
|
+
import {fileURLToPath} from 'node:url';
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import os from 'node:os';
|
|
8
8
|
import {parseArgsWithHelp} from 'minus-h';
|
|
9
9
|
|
|
10
10
|
export const DEFAULTS = {
|
|
@@ -30,11 +30,6 @@ const config = {
|
|
|
30
30
|
argumentName: 'string',
|
|
31
31
|
description: 'What string to use when a word is longer than the max width, and in overflow mode "clip"',
|
|
32
32
|
},
|
|
33
|
-
example7: {
|
|
34
|
-
short: '7',
|
|
35
|
-
type: 'boolean',
|
|
36
|
-
description: 'turn on the extra rules from Example 7 of UAX #14',
|
|
37
|
-
},
|
|
38
33
|
firstCol: {
|
|
39
34
|
short: 'c',
|
|
40
35
|
type: 'string',
|
|
@@ -210,7 +205,6 @@ export async function main(
|
|
|
210
205
|
const opts = {
|
|
211
206
|
escape: values.html ? htmlEscape : s => s,
|
|
212
207
|
ellipsis: values.ellipsis,
|
|
213
|
-
example7: Boolean(values.example7),
|
|
214
208
|
firstCol: parseInt(values.firstCol, 10),
|
|
215
209
|
hyphen: values.hyphen,
|
|
216
210
|
indent: parseInt(values.indent, 10) || values.indent,
|
|
@@ -256,6 +250,7 @@ export async function main(
|
|
|
256
250
|
|
|
257
251
|
if (fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
258
252
|
main().catch(e => {
|
|
253
|
+
// eslint-disable-next-line no-console
|
|
259
254
|
console.error(e);
|
|
260
255
|
process.exit(1);
|
|
261
256
|
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cto.af/linewrap-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Wrap lines using the Unicode Line Breaking algorithm from UAX #14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"linewrap": "bin/linewrap.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"test": "c8
|
|
10
|
+
"test": "c8 node --test test/*.test.js",
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"build": "npm run lint && npm run test && npm pack --dry-run"
|
|
13
13
|
},
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"repository": "cto-af/linewrap-cli",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cto.af/linewrap": "
|
|
30
|
-
"minus-h": "
|
|
29
|
+
"@cto.af/linewrap": "3.0.0",
|
|
30
|
+
"minus-h": "3.0.0"
|
|
31
31
|
},
|
|
32
|
-
"packageManager": "pnpm@
|
|
32
|
+
"packageManager": "pnpm@10.11.0",
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
34
|
+
"node": ">=20"
|
|
35
35
|
}
|
|
36
36
|
}
|