palabra 2.5.1 → 2.5.2

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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2026.04.20, v2.5.2
2
+
3
+ feature:
4
+ - 3fb9eac palabra: -h: add
5
+
1
6
  2026.04.20, v2.5.1
2
7
 
3
8
  fix:
package/bin/palabra.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import process from 'node:process';
3
+ import process, {exit} from 'node:process';
4
4
  import {readdir} from 'node:fs/promises';
5
5
  import {execa} from 'execa';
6
6
  import {tryToCatch} from 'try-to-catch';
@@ -18,6 +18,12 @@ if (args.version) {
18
18
  process.exit();
19
19
  }
20
20
 
21
+ if (args.help || !args._.length) {
22
+ const {help} = await import('../lib/help.js');
23
+ console.log(help());
24
+ exit();
25
+ }
26
+
21
27
  const instrucciones = args._.shift();
22
28
 
23
29
  let cmd = '';
@@ -46,3 +52,4 @@ const [error] = await tryToCatch(execa, cmd, {
46
52
 
47
53
  if (error)
48
54
  process.exitCode = error.exitCode;
55
+
package/help.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "-h, --help ": "display this help and exit",
3
+ "-v, --version ": "output version information and exit"
4
+ }
package/lib/help.js ADDED
@@ -0,0 +1,18 @@
1
+ import helpJson from '../help.json' with {
2
+ type: 'json',
3
+ };
4
+
5
+ const {entries} = Object;
6
+
7
+ export const help = () => {
8
+ const result = [
9
+ 'Usage: palabra [command|options]',
10
+ 'Options:',
11
+ ];
12
+
13
+ for (const [name, description] of entries(helpJson)) {
14
+ result.push(` ${name} ${description}`);
15
+ }
16
+
17
+ return result.join('\n');
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",