ipsumify 0.0.0-stage → 2.6.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ipsumify
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,162 @@
1
- # Temporary Holding Version
1
+ # ipsumify
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Lorem ipsum for the command line and Node: markdown-ready placeholder text with themes, seeds, and plain text, HTML, or JSON output.
4
+
5
+ ```bash
6
+ npx ipsumify
7
+ ```
8
+
9
+ ![Terminal output of npx ipsumify with a theme, headings, and a list](https://raw.githubusercontent.com/ICJIA/ipsumify-next-2026/main/documentation/screenshot-cli.png)
10
+
11
+ With no arguments it prints five paragraphs of classic lorem ipsum. Nothing to install, no dependencies, Node 18.3 or later.
12
+
13
+ It uses the same engine as [ipsumify.com](https://ipsumify.com) and its API: the same theme, block count, seed, and options give the same text in all three.
14
+
15
+ ### Options
16
+
17
+ | Option | Short | What it does |
18
+ | ------ | ----- | ------------ |
19
+ | `--blocks <n>` | `-b` | Number of paragraphs, 1–20. Default 5. Also accepted as the first argument (`npx ipsumify 3`) or as `--paragraphs` / `-p`; give it one way only |
20
+ | `--theme <id>` | `-t` | `lorem` (default), `dog`, `cat`, `baked`, `bbq` |
21
+ | `--seed <n>` | `-s` | Whole number from 0 to 2,147,483,647. The same seed always gives the same text. Random when omitted |
22
+ | `--headings` | | Add markdown headings (also `--headers`) |
23
+ | `--code` | | Add code snippets |
24
+ | `--quotes` | | Add blockquotes |
25
+ | `--lists` | | Add bullet lists |
26
+ | `--links` | | Add links |
27
+ | `--all` | `-a` | All five markdown elements |
28
+ | `--md <list>` | | The same, comma-separated, as the API takes them: `--md headings,lists` |
29
+ | `--lower` | | Lowercase everything |
30
+ | `--no-linebreaks` | | Everything on one line (also `--nowrap`) |
31
+ | `--format <name>` | `-f` | `markdown` (default), `text`, `html`, `json` |
32
+ | `--themes` | | List the themes |
33
+ | `--help` | `-h` | Show help |
34
+ | `--version` | `-v` | Show the version |
35
+
36
+ Code snippets appear before every third block, blockquotes before every second, lists before the third, sixth, and so on, and links before every fourth, so a short run may not include every element you asked for.
37
+
38
+ Invalid input prints a message to stderr and exits with code 1.
39
+
40
+ ### Examples
41
+
42
+ One paragraph. `--seed` makes it repeatable; leave it off for different text each run:
43
+
44
+ ```console
45
+ $ npx ipsumify 1 --seed 42
46
+ Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
47
+ ```
48
+
49
+ A theme, with headings and a list:
50
+
51
+ ```console
52
+ $ npx ipsumify 3 --theme bbq --headings --lists --seed 7
53
+ # Building the Perfect Fire
54
+
55
+ Brisketum planum puntum totum, pinguem capsum updownum debatum. Fumus annulus roseum halum, probatum technicum igneum. Sectum contra granum semper, humidus macer finibus ustum. Pullum femur quartum totum, pellis crispum carnem sucum. Alabama salsamentum album, acetum Carolina moppum stylum. Tractum fumatum grillum optiones, gallinaceum rectum bonum.
56
+
57
+ Fumus surgit caminus ascendit, linea formatur mane fidelis. Venditum signum timendum, mane avis obtinet carneum. Dignum omnis expectatio minutum, pitmasterus ars respectum. Fricatum siccum pasta humidum, pernoctem frigidarium marinatum requiem. Sal piper simplex Texanum, complexum Memphis mixtum secretum. Applicare generosum aequum tegmen, cortex formatur pulchre.
58
+
59
+ - Smoky goodness
60
+ - Fall off the bone
61
+ - Worth the wait
62
+
63
+ Lateribus fabae coleslavium paniscornum, caseum macaroni salatum tuberosum. Pickledus cepae jalapeñus, panisalbus butyrum sectum. Completum plateum aequilibratum prandium, carneum stella lateribus sustentum.
64
+ ```
65
+
66
+ One line, lowercase — handy for seed data:
67
+
68
+ ```console
69
+ $ npx ipsumify 1 --theme cat --no-linebreaks --lower --seed 3
70
+ himalayan persicum pointus fluffium, exotic shorthair teddybearum calmicus. ragamuffin largeum sweeticus docilum, selkirk rex curlycoatum sheepii patientum. laperm curlicus wavium uniqueum.
71
+ ```
72
+
73
+ Rendered HTML:
74
+
75
+ ```console
76
+ $ npx ipsumify 1 --all --format html --seed 42
77
+ <h1>Key Concepts</h1>
78
+ <pre><code class="language-javascript">const example = &#39;code&#39;;
79
+ </code></pre>
80
+ <p><a href="https://example.com">Learn more</a> Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.</p>
81
+ ```
82
+
83
+ Plain text, with the markdown syntax stripped:
84
+
85
+ ```console
86
+ $ npx ipsumify 1 --all --format text --seed 42
87
+ Key Concepts
88
+
89
+ Learn more Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
90
+ ```
91
+
92
+ JSON, in the same shape the API returns. `output` holds each paragraph's body text; `seed` reports the seed that was used, so a random run can be reproduced:
93
+
94
+ ```console
95
+ $ npx ipsumify 2 --format json --seed 42
96
+ {
97
+ "theme": "lorem",
98
+ "blocks": 2,
99
+ "seed": 42,
100
+ "format": "json",
101
+ "options": {
102
+ "headers": false,
103
+ "codeSnippets": false,
104
+ "blockquotes": false,
105
+ "lists": false,
106
+ "links": false,
107
+ "capitalize": true,
108
+ "noWrap": false
109
+ },
110
+ "output": [
111
+ "Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.",
112
+ "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt."
113
+ ],
114
+ "markdown": "Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.\n\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt."
115
+ }
116
+ ```
117
+
118
+ Into a file or the clipboard:
119
+
120
+ ```bash
121
+ npx ipsumify 10 --all > placeholder.md
122
+ npx ipsumify | pbcopy
123
+ ```
124
+
125
+ ### Use from JavaScript
126
+
127
+ ```bash
128
+ npm install ipsumify
129
+ ```
130
+
131
+ ```js
132
+ import ipsumify, { paragraphs, themes } from 'ipsumify'
133
+
134
+ ipsumify() // five paragraphs, random
135
+ ipsumify({ blocks: 2, theme: 'dog', seed: 42 }) // repeatable
136
+ ipsumify({ headers: true, lists: true }) // markdown elements
137
+ ipsumify({ format: 'html' }) // or 'text'
138
+
139
+ paragraphs({ blocks: 3 }) // ['…', '…', '…']
140
+ themes // [{ id: 'lorem', label: 'Lorem Ipsum' }, …]
141
+ ```
142
+
143
+ | Option | Type | Default | |
144
+ | ------ | ---- | ------- | - |
145
+ | `theme` | string | `'lorem'` | `lorem`, `dog`, `cat`, `baked`, `bbq` |
146
+ | `blocks` | number | `5` | 1–20 |
147
+ | `seed` | number | random | 0–2,147,483,647 |
148
+ | `headers`, `code`, `quotes`, `lists`, `links` | boolean | `false` | Markdown elements |
149
+ | `lowercase` | boolean | `false` | Lowercase everything |
150
+ | `noWrap` | boolean | `false` | Everything on one line |
151
+ | `format` | string | `'markdown'` | `markdown`, `text`, `html` |
152
+
153
+ An unknown theme or format, or a `blocks` or `seed` out of range, throws a `RangeError`. Options that are not an object, or a switch that is not `true` or `false`, throw a `TypeError`. `paragraphs()` ignores `format`. The package is ESM only and ships its own TypeScript types.
154
+
155
+ ## Links
156
+
157
+ - Web app: https://ipsumify.com
158
+ - Source and issues: https://github.com/ICJIA/ipsumify-next-2026
159
+
160
+ ## License
161
+
162
+ MIT
package/dist/cli.js ADDED
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ DEFAULT_BLOCKS,
4
+ DEFAULT_THEME,
5
+ FORMATS,
6
+ MAX_BLOCKS,
7
+ MAX_SEED,
8
+ MIN_BLOCKS,
9
+ ipsumify,
10
+ paragraphs,
11
+ randomSeed,
12
+ themes
13
+ } from "./shared-B3DMJ5UC.js";
14
+
15
+ // packages/ipsumify/src/run.ts
16
+ import { parseArgs } from "node:util";
17
+ var CLI_FORMATS = [...FORMATS, "json"];
18
+ var HELP = `ipsumify \u2014 lorem ipsum generator
19
+
20
+ Usage
21
+ npx ipsumify [blocks] [options]
22
+
23
+ With no arguments, prints ${DEFAULT_BLOCKS} paragraphs of lorem ipsum.
24
+
25
+ Content
26
+ -b, --blocks <n> Number of paragraphs, ${MIN_BLOCKS}-${MAX_BLOCKS} (default ${DEFAULT_BLOCKS}).
27
+ Also accepted as the first argument, or as --paragraphs.
28
+ -t, --theme <id> ${themes.map((t) => t.id).join(", ")} (default ${DEFAULT_THEME})
29
+ -s, --seed <n> Whole number, 0-${MAX_SEED}. The same seed always
30
+ gives the same text. Random when omitted.
31
+
32
+ Markdown elements
33
+ --headings Add headings (also --headers)
34
+ --code Add code snippets
35
+ --quotes Add blockquotes
36
+ --lists Add bullet lists
37
+ --links Add links
38
+ -a, --all All five of the above
39
+ --md <list> The same, comma-separated: --md headings,lists
40
+
41
+ Formatting
42
+ --lower Lowercase everything
43
+ --no-linebreaks Everything on one line (also --nowrap)
44
+ -f, --format <name> markdown (default), text, html, json
45
+
46
+ Other
47
+ --themes List the themes
48
+ -h, --help Show this help
49
+ -v, --version Show the version
50
+
51
+ Examples
52
+ npx ipsumify
53
+ npx ipsumify 2
54
+ npx ipsumify --theme dog --blocks 3
55
+ npx ipsumify --headings --lists --seed 42
56
+ npx ipsumify 1 --no-linebreaks --lower
57
+ npx ipsumify --all --format html > sample.html
58
+ npx ipsumify | pbcopy
59
+ `;
60
+ var MD_NAMES = /* @__PURE__ */ new Map([
61
+ ["headings", "headers"],
62
+ ["headers", "headers"],
63
+ ["code", "code"],
64
+ ["quotes", "quotes"],
65
+ ["lists", "lists"],
66
+ ["links", "links"]
67
+ ]);
68
+ function fail(message) {
69
+ return { code: 1, stdout: "", stderr: `ipsumify: ${message}
70
+ Run "ipsumify --help" for usage.
71
+ ` };
72
+ }
73
+ function wholeNumber(name, value) {
74
+ if (!/^\d{1,10}$/.test(value)) {
75
+ throw new RangeError(`Invalid ${name} "${value}". Must be a whole number.`);
76
+ }
77
+ return Number(value);
78
+ }
79
+ function run(argv, version = "0.0.0") {
80
+ let parsed;
81
+ try {
82
+ parsed = parseArgs({
83
+ args: argv,
84
+ allowPositionals: true,
85
+ options: {
86
+ "blocks": { type: "string", short: "b" },
87
+ "paragraphs": { type: "string", short: "p" },
88
+ "theme": { type: "string", short: "t" },
89
+ "seed": { type: "string", short: "s" },
90
+ "headings": { type: "boolean" },
91
+ "headers": { type: "boolean" },
92
+ "code": { type: "boolean" },
93
+ "quotes": { type: "boolean" },
94
+ "lists": { type: "boolean" },
95
+ "links": { type: "boolean" },
96
+ "all": { type: "boolean", short: "a" },
97
+ "md": { type: "string" },
98
+ "lower": { type: "boolean" },
99
+ "nowrap": { type: "boolean" },
100
+ "no-linebreaks": { type: "boolean" },
101
+ "format": { type: "string", short: "f" },
102
+ "themes": { type: "boolean" },
103
+ "help": { type: "boolean", short: "h" },
104
+ "version": { type: "boolean", short: "v" }
105
+ }
106
+ });
107
+ } catch (error) {
108
+ return fail(error.message);
109
+ }
110
+ const { values, positionals } = parsed;
111
+ if (values.help) return { code: 0, stdout: HELP, stderr: "" };
112
+ if (values.version) return { code: 0, stdout: `${version}
113
+ `, stderr: "" };
114
+ if (values.themes) {
115
+ const width = Math.max(...themes.map((t) => t.id.length));
116
+ return { code: 0, stdout: themes.map((t) => `${t.id.padEnd(width)} ${t.label}`).join("\n") + "\n", stderr: "" };
117
+ }
118
+ try {
119
+ if (positionals.length > 1) {
120
+ throw new RangeError(`Unexpected argument "${positionals[1]}".`);
121
+ }
122
+ const blockCounts = [values.blocks, values.paragraphs, positionals[0]].filter((value) => value !== void 0);
123
+ if (blockCounts.length > 1) {
124
+ throw new RangeError("The number of blocks is given more than once. Use one of: a first argument, --blocks, --paragraphs.");
125
+ }
126
+ const blocksArg = blockCounts[0];
127
+ const options = {
128
+ theme: values.theme,
129
+ blocks: blocksArg === void 0 ? void 0 : wholeNumber("blocks", blocksArg),
130
+ // Chosen here, not inside the library, so the json output can report it
131
+ seed: values.seed === void 0 ? randomSeed() : wholeNumber("seed", values.seed),
132
+ headers: values.all || values.headings || values.headers,
133
+ code: values.all || values.code,
134
+ quotes: values.all || values.quotes,
135
+ lists: values.all || values.lists,
136
+ links: values.all || values.links,
137
+ lowercase: values.lower,
138
+ noWrap: values.nowrap || values["no-linebreaks"]
139
+ };
140
+ if (values.md !== void 0) {
141
+ for (const name of values.md.split(",").map((part) => part.trim()).filter(Boolean)) {
142
+ const key = MD_NAMES.get(name);
143
+ if (!key) {
144
+ throw new RangeError(`Invalid --md value "${name}". Valid values: headings, code, quotes, lists, links`);
145
+ }
146
+ options[key] = true;
147
+ }
148
+ }
149
+ const format = values.format ?? "markdown";
150
+ if (!CLI_FORMATS.includes(format)) {
151
+ throw new RangeError(`Invalid format "${format}". Valid formats: ${CLI_FORMATS.join(", ")}`);
152
+ }
153
+ if (format === "json") {
154
+ const markdown = ipsumify(options);
155
+ const json = {
156
+ theme: options.theme ?? DEFAULT_THEME,
157
+ blocks: options.blocks ?? DEFAULT_BLOCKS,
158
+ seed: options.seed,
159
+ format,
160
+ options: {
161
+ headers: !!options.headers,
162
+ codeSnippets: !!options.code,
163
+ blockquotes: !!options.quotes,
164
+ lists: !!options.lists,
165
+ links: !!options.links,
166
+ capitalize: !options.lowercase,
167
+ noWrap: !!options.noWrap
168
+ },
169
+ output: paragraphs(options),
170
+ markdown
171
+ };
172
+ return { code: 0, stdout: JSON.stringify(json, null, 2) + "\n", stderr: "" };
173
+ }
174
+ return { code: 0, stdout: ipsumify({ ...options, format }) + "\n", stderr: "" };
175
+ } catch (error) {
176
+ return fail(error.message);
177
+ }
178
+ }
179
+
180
+ // packages/ipsumify/src/cli.ts
181
+ var result = run(process.argv.slice(2), "2.6.0");
182
+ if (result.stdout) process.stdout.write(result.stdout);
183
+ if (result.stderr) process.stderr.write(result.stderr);
184
+ process.exitCode = result.code;
@@ -0,0 +1,56 @@
1
+ export type Format = 'markdown' | 'text' | 'html'
2
+
3
+ export interface IpsumifyOptions {
4
+ /** Theme id: lorem (default), dog, cat, baked, bbq */
5
+ theme?: string
6
+ /** Number of blocks (paragraphs), 1 to 20. Default 5 */
7
+ blocks?: number
8
+ /** Whole number from 0 to 2147483647. The same seed gives the same text. Random when omitted */
9
+ seed?: number
10
+ /** Add markdown headings */
11
+ headers?: boolean
12
+ /** Add code snippets */
13
+ code?: boolean
14
+ /** Add blockquotes */
15
+ quotes?: boolean
16
+ /** Add bullet lists */
17
+ lists?: boolean
18
+ /** Add links */
19
+ links?: boolean
20
+ /** Lowercase everything */
21
+ lowercase?: boolean
22
+ /** Put everything on one line, with no line breaks */
23
+ noWrap?: boolean
24
+ /** markdown (default), text (markdown syntax stripped), or html */
25
+ format?: Format
26
+ }
27
+
28
+ export declare const MIN_BLOCKS: number
29
+ export declare const MAX_BLOCKS: number
30
+ export declare const DEFAULT_BLOCKS: number
31
+ export declare const DEFAULT_THEME: string
32
+ export declare const MAX_SEED: number
33
+ export declare const FORMATS: readonly Format[]
34
+
35
+ /** The available themes. */
36
+ export declare const themes: readonly { id: string, label: string }[]
37
+
38
+ /** A seed chosen at random. */
39
+ export declare function randomSeed(): number
40
+
41
+ /**
42
+ * Generates placeholder text.
43
+ * @throws {RangeError} For an unknown theme or format, or blocks or seed out of range
44
+ * @throws {TypeError} If options is not an object, or a switch is not a boolean
45
+ */
46
+ export declare function ipsumify(options?: IpsumifyOptions): string
47
+
48
+ /**
49
+ * Generates the body paragraphs as an array, one string per block, without markdown elements.
50
+ * `format` is ignored.
51
+ * @throws {RangeError} For an unknown theme, or blocks or seed out of range
52
+ * @throws {TypeError} If options is not an object, or a switch is not a boolean
53
+ */
54
+ export declare function paragraphs(options?: IpsumifyOptions): string[]
55
+
56
+ export default ipsumify
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ import {
2
+ DEFAULT_BLOCKS,
3
+ DEFAULT_THEME,
4
+ FORMATS,
5
+ MAX_BLOCKS,
6
+ MAX_SEED,
7
+ MIN_BLOCKS,
8
+ ipsumify,
9
+ paragraphs,
10
+ randomSeed,
11
+ src_default,
12
+ themes
13
+ } from "./shared-B3DMJ5UC.js";
14
+ export {
15
+ DEFAULT_BLOCKS,
16
+ DEFAULT_THEME,
17
+ FORMATS,
18
+ MAX_BLOCKS,
19
+ MAX_SEED,
20
+ MIN_BLOCKS,
21
+ src_default as default,
22
+ ipsumify,
23
+ paragraphs,
24
+ randomSeed,
25
+ themes
26
+ };