Package Exports
- write-md-safe
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (write-md-safe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Write markdown files from a Marked token list or string.
Installation
yarn add write-md-safenpm install write-md-safeAPI
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;
}Dependencies
- marked: A markdown parser built for speed
- write-file-safe: Write files and create parent directories if necessary
Dev Dependencies
- @bconnorwhite/bob: Bob is a toolkit for TypeScript projects
- @types/marked: TypeScript definitions for Marked
- @types/mock-fs: TypeScript definitions for mock-fs
- mock-fs: A configurable mock file system. You know, for testing.
- read-file-safe: Read files without try catch
License 
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.