palabra 1.20.2 → 1.21.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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2026.04.12, v1.21.0
2
+
3
+ feature:
4
+ - a0ae29e palabra: PALABRA_DIR
5
+
1
6
  2026.04.11, v1.20.2
2
7
 
3
8
  fix:
package/README.md CHANGED
@@ -70,6 +70,10 @@ palabra l
70
70
  ]
71
71
  ```
72
72
 
73
+ ## Env variables
74
+
75
+ Use `PALABRA_DIR` to override default installation path `~/.local/src`.
76
+
73
77
  That's it!
74
78
 
75
79
  ## License
@@ -6,6 +6,7 @@ export const instalar = async (nombres, {directorio}) => {
6
6
  const palabra = createPalabra(nombres, {
7
7
  directorio,
8
8
  });
9
+
9
10
  return create(palabra);
10
11
  }
11
12
 
@@ -1,3 +1,4 @@
1
+ import process from 'node:process';
1
2
  import yargsParse from 'yargs-parser';
2
3
 
3
4
  export const parseArgs = (args) => {
@@ -10,7 +11,7 @@ export const parseArgs = (args) => {
10
11
  },
11
12
  string: ['directorio'],
12
13
  default: {
13
- directorio: '~/.local/src',
14
+ directorio: process.env.PALABRA_DIR || '~/.local/src',
14
15
  },
15
16
  boolean: [
16
17
  'quiet',
package/lib/hablar.js CHANGED
@@ -22,4 +22,3 @@ export const hablar = (silabas, {directorio} = {}) => {
22
22
 
23
23
  return commands;
24
24
  };
25
-
@@ -18,4 +18,3 @@ export const download = (letra) => {
18
18
 
19
19
  return commands;
20
20
  };
21
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "1.20.2",
3
+ "version": "1.21.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",
@@ -0,0 +1,27 @@
1
+ import {readdir} from 'node:fs/promises';
2
+
3
+ const isString = (a) => typeof a === 'string';
4
+ const {keys} = Object;
5
+ const names = await readdir(new URL('../letras', import.meta.url));
6
+
7
+ const bins = [];
8
+
9
+ for (const name of names) {
10
+ const {default: letra} = await import(new URL(`../letras/${name}/${name}.json`, import.meta.url), {
11
+ with: {
12
+ type: 'json',
13
+ },
14
+ });
15
+
16
+ if (!letra.bin)
17
+ continue;
18
+
19
+ if (isString(letra.bin)) {
20
+ bins.push(`type ${letra.name}`);
21
+ continue;
22
+ }
23
+
24
+ for (const bin of keys(letra.bin)) {
25
+ bins.push(`type ${bin}`);
26
+ }
27
+ }