$ gnpm install write-md-safe
Write markdown files from a Marked token list or string.
yarn add write-md-safe
npm install write-md-safe
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;
}
Copyright 2013 - present © cnpmjs.org | Home |