1.2.0 • Published 3 years ago

write-md-safe v1.2.0

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

Write markdown files from a Marked token list or string.

Installation

yarn add write-md-safe
npm install write-md-safe

API

Types

import {
  writeMarkdown,
  writeMarkdownSync,
  markdownContentToString,
  MarkdownContent,
  Token, // a Marked token
  Tokens,
  Options
} from "write-md-safe";

function writeMarkdown(path: string, content?: MarkdownContent, options?: Options): Promise<void>;

function writeMarkdownSync(path: string, content?: MarkdownContent, options?: Options): void;

function markdownContentToString(content?: MarkdownContent): string;

type MarkdownContent = string | (Token | string)[];

type Options = {
  /**
   * Recursively create parent directories if needed. Default: `true`
   */
  recursive?: boolean;
  /**
   * Ensure file ends with a newline. Default: `true`
   */
  appendNewline?: boolean;
  /**
   * Write even if file already exists. Default: `true`
   */
  overwrite?: boolean;
}
  • marked: A markdown parser built for speed
  • write-file-safe: Write files and create parent directories if necessary

MIT

Related Packages:

  • read-md-safe: Read markdown files as a Marked token list or string.
  • write-file-safe: Write files, and create parent directories if necessary.
1.2.0

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago