create-markdown 0.1.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 Val Alexander
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 ADDED
@@ -0,0 +1,88 @@
1
+ # create-markdown
2
+
3
+ Markdown package to enable creating markdown interfaces seamlessly because it is complicated and annoying asf.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Using bun (recommended)
9
+ bun add create-markdown
10
+
11
+ # Using npm
12
+ npm install create-markdown
13
+
14
+ # Using yarn
15
+ yarn add create-markdown
16
+
17
+ # Using pnpm
18
+ pnpm add create-markdown
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ### ESM (recommended)
24
+
25
+ ```typescript
26
+ import { createMarkdown } from 'create-markdown';
27
+
28
+ const doc = createMarkdown('# Hello World');
29
+ console.log(doc.content);
30
+ ```
31
+
32
+ ### CommonJS
33
+
34
+ ```javascript
35
+ const { createMarkdown } = require('create-markdown');
36
+
37
+ const doc = createMarkdown('# Hello World');
38
+ console.log(doc.content);
39
+ ```
40
+
41
+ ### With Options
42
+
43
+ ```typescript
44
+ import { createMarkdown, type MarkdownOptions } from 'create-markdown';
45
+
46
+ const options: MarkdownOptions = {
47
+ strict: true,
48
+ lineEnding: '\n',
49
+ };
50
+
51
+ const doc = createMarkdown('# My Document', options);
52
+ ```
53
+
54
+ ## API
55
+
56
+ ### `createMarkdown(content?, options?)`
57
+
58
+ Creates a new markdown document.
59
+
60
+ **Parameters:**
61
+ - `content` (string, optional): Initial markdown content
62
+ - `options` (MarkdownOptions, optional): Configuration options
63
+ - `strict` (boolean): Enable strict parsing mode
64
+ - `lineEnding` (string): Custom line ending (default: `'\n'`)
65
+
66
+ **Returns:** `MarkdownDocument`
67
+ - `content` (string): Raw markdown content
68
+ - `meta` (Record<string, unknown>): Document metadata
69
+
70
+ ## Development
71
+
72
+ ```bash
73
+ # Install dependencies
74
+ bun install
75
+
76
+ # Build the package
77
+ bun run build
78
+
79
+ # Watch mode during development
80
+ bun run dev
81
+
82
+ # Clean build artifacts
83
+ bun run clean
84
+ ```
85
+
86
+ ## License
87
+
88
+ MIT
package/dist/index.cjs ADDED
@@ -0,0 +1,46 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
6
+ var __toCommonJS = (from) => {
7
+ var entry = __moduleCache.get(from), desc;
8
+ if (entry)
9
+ return entry;
10
+ entry = __defProp({}, "__esModule", { value: true });
11
+ if (from && typeof from === "object" || typeof from === "function")
12
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ }));
16
+ __moduleCache.set(from, entry);
17
+ return entry;
18
+ };
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, {
22
+ get: all[name],
23
+ enumerable: true,
24
+ configurable: true,
25
+ set: (newValue) => all[name] = () => newValue
26
+ });
27
+ };
28
+
29
+ // src/index.ts
30
+ var exports_src = {};
31
+ __export(exports_src, {
32
+ default: () => src_default,
33
+ createMarkdown: () => createMarkdown,
34
+ VERSION: () => VERSION
35
+ });
36
+ module.exports = __toCommonJS(exports_src);
37
+ function createMarkdown(content = "", options = {}) {
38
+ const { lineEnding = `
39
+ ` } = options;
40
+ return {
41
+ content: content.replace(/\r\n|\r/g, lineEnding),
42
+ meta: {}
43
+ };
44
+ }
45
+ var VERSION = "0.1.0";
46
+ var src_default = createMarkdown;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * create-markdown
3
+ * A minimal markdown package for creating and manipulating markdown content
4
+ */
5
+ /**
6
+ * Options for markdown creation
7
+ */
8
+ export interface MarkdownOptions {
9
+ /** Enable strict parsing mode */
10
+ strict?: boolean;
11
+ /** Custom line ending (default: '\n') */
12
+ lineEnding?: string;
13
+ }
14
+ /**
15
+ * Represents a markdown document
16
+ */
17
+ export interface MarkdownDocument {
18
+ /** Raw markdown content */
19
+ content: string;
20
+ /** Document metadata */
21
+ meta?: Record<string, unknown>;
22
+ }
23
+ /**
24
+ * Creates a new markdown document
25
+ * @param content - Initial markdown content
26
+ * @param options - Configuration options
27
+ * @returns A new MarkdownDocument instance
28
+ */
29
+ export declare function createMarkdown(content?: string, options?: MarkdownOptions): MarkdownDocument;
30
+ /**
31
+ * Package version
32
+ */
33
+ export declare const VERSION = "0.1.0";
34
+ export default createMarkdown;
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAMD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,GAAE,MAAW,EACpB,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAOlB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC;AAM/B,eAAe,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ // src/index.ts
2
+ function createMarkdown(content = "", options = {}) {
3
+ const { lineEnding = `
4
+ ` } = options;
5
+ return {
6
+ content: content.replace(/\r\n|\r/g, lineEnding),
7
+ meta: {}
8
+ };
9
+ }
10
+ var VERSION = "0.1.0";
11
+ var src_default = createMarkdown;
12
+ export {
13
+ src_default as default,
14
+ createMarkdown,
15
+ VERSION
16
+ };
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "create-markdown",
3
+ "version": "0.1.0",
4
+ "description": "Minimal markdown package for creating and manipulating markdown content",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "bun run build:esm && bun run build:cjs && bun run build:types",
26
+ "build:esm": "bun build ./src/index.ts --outfile ./dist/index.js --format esm",
27
+ "build:cjs": "bun build ./src/index.ts --outfile ./dist/index.cjs --format cjs",
28
+ "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist",
29
+ "dev": "bun run --watch src/index.ts",
30
+ "clean": "rm -rf dist",
31
+ "prepublishOnly": "bun run clean && bun run build"
32
+ },
33
+ "keywords": [
34
+ "markdown",
35
+ "md",
36
+ "bun",
37
+ "typescript"
38
+ ],
39
+ "author": "",
40
+ "license": "MIT",
41
+ "devDependencies": {
42
+ "typescript": "^5.3.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=18.0.0"
46
+ },
47
+ "packageManager": "bun@1.0.0"
48
+ }