jkit maker
Read line-separated text and emit a JSON string array. Great for turning a list you copied from somewhere into valid JSON in one step.
bash
jkit maker # full name
jkit m # short aliasSynopsis
jkit maker [--unique]
jkit m [-u]| Flag | Description |
|---|---|
--unique, -u | Drop duplicate lines. First-seen order is preserved. |
Reads from stdin or the clipboard — see Input handling.
What it does
- Splits the input on
\n(also handles\r\nfor Windows clipboard content). TrimSpaceeach line.- Drops empty lines (after trimming).
- With
-u, drops duplicates while preserving first-seen order. - Emits the result as a 4-space-indented JSON string array.
Examples
Basic
bash
> printf 'apple\nbanana\ncherry\n' | jkit m
[
"apple",
"banana",
"cherry"
]Empty lines and whitespace are cleaned up
bash
> printf 'apple\n\n banana \n\ncherry\n' | jkit m
[
"apple",
"banana",
"cherry"
]Drop duplicates with -u
bash
> printf 'apple\nbanana\napple\n' | jkit m -u
[
"apple",
"banana"
]From clipboard
Copy a list (e.g. from a markdown bullet list, paste it into a chat, etc.), then:
bash
> jkit m
[
"Hi, I'm E99p1ant. 🍆",
"🐭 Focus on Golang.",
"🏠 Blog at github.red."
]Edge cases
- All blank input yields an empty array
[]. - Each line is JSON-encoded, so embedded quotes and special characters are escaped automatically.