mordorjs 0.0.1 → 0.0.3
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/README.md +53 -3
- package/bin/mordorjs.cjs +6312 -808
- package/mordor.js +117 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,10 +40,60 @@ If no file is provided, it reads from **stdin** (piped text) or defaults to the
|
|
|
40
40
|
| Option | Long Form | Description |
|
|
41
41
|
| :--- | :--- | :--- |
|
|
42
42
|
| `-w <num>` | `--wide <num>` | **Wrap into Columns:** Re-wraps the text into exactly `<num>` vertical strips. Words are preserved and distributed evenly. |
|
|
43
|
-
| `-s` | | **
|
|
43
|
+
| `-s` | | **Separator:** Adds a space between each column strip for better readability. |
|
|
44
44
|
| `-r [num]` | `--random [num]` | **Randomize:** Adds random vertical spacing (0 to `num`) before the first word and between every word in a strip. Default `num` is 3. |
|
|
45
|
-
| `-b64` | `--base64` | **Base64 Mode:** Encodes input to Base64 first. Uses "virtual words" (2
|
|
46
|
-
| `-c` | `--copy` | **Clipboard:** Automatically copies the final
|
|
45
|
+
| `-b64` | `--base64` | **Base64 Mode:** Encodes input to Base64 first. Uses "virtual words" (2–7 chars) to allow wrapping and randomization. |
|
|
46
|
+
| `-c` | `--copy` | **Clipboard:** Automatically copies the final output to your system clipboard. |
|
|
47
|
+
| `-mjs` | `--mordorjs` | **MordorJS Mode:** Converts a `.js` file into a self-executing 1W vertical program (`.cjs`). |
|
|
48
|
+
| `-pro` | `--project` | **Project Mode:** Packages an entire folder tree into a single `mordor-project` file (skips `node_modules`, hidden files, lock files; images truncated to 1KB). |
|
|
49
|
+
| `-h` | `--help` | **Help:** Show options in mordor-code format (`-w 31 -r 3 -s`), prefixed with `==== M\|\|D\|\|JS ====`. |
|
|
50
|
+
| `-ai-h` | `--ai-help` | **AI Help:** Show options in plain readable text, prefixed with `==== M\|\|D\|\|JS ====`. |
|
|
51
|
+
|
|
52
|
+
## mordor-code
|
|
53
|
+
|
|
54
|
+
Transform any JS file into a self-executing 1-character-wide vertical program:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mordorjs myfile.js -mjs > myfile.cjs
|
|
58
|
+
node myfile.cjs
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The generated file runs identically to the original. Shebang lines and `require()` calls are handled automatically.
|
|
62
|
+
|
|
63
|
+
## mordor-project
|
|
64
|
+
|
|
65
|
+
Package an entire project folder into a single portable text file:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
mordorjs ./my-project -pro -w 31 -s > my-project.mordor-project.txt
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Each file in the folder becomes one entry: a header line followed by the file's content in wide mordor format.
|
|
72
|
+
|
|
73
|
+
**Automatically skipped:**
|
|
74
|
+
- Hidden files and directories (`.git`, `.env`, etc.)
|
|
75
|
+
- `node_modules`, `dist`, `build`, `coverage`, `.next`, `.nuxt`
|
|
76
|
+
- Lock files (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, etc.)
|
|
77
|
+
|
|
78
|
+
**Images** (`.jpg`, `.jpeg`, `.png`): only the first 1KB is included as base64.
|
|
79
|
+
**Binary files**: base64-encoded automatically based on extension.
|
|
80
|
+
**Text files**: included as-is, rendered in the same wide mordor format as the other CLI flags produce.
|
|
81
|
+
|
|
82
|
+
Format spec:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
entry :=
|
|
86
|
+
header newline payload
|
|
87
|
+
|
|
88
|
+
header :=
|
|
89
|
+
/^_{4,}\s(.+)\s_{4,}$/
|
|
90
|
+
|
|
91
|
+
header content :=
|
|
92
|
+
<reversed-relative-path>
|
|
93
|
+
|
|
94
|
+
payload :=
|
|
95
|
+
all following lines until next header or EOF
|
|
96
|
+
```
|
|
47
97
|
|
|
48
98
|
## License
|
|
49
99
|
|