Read markdown files as a Marked token list or string.
yarn add read-md-safe
npm install read-md-safe
import {
readMarkdown,
readMarkdownSync,
readMarkdownString,
readMarkdownStringSync,
TokensList,
Token
} from "write-file-safe";
function readMarkdown(path: string): Promise<TokensList | undefined>;
function readMarkdownSync(path: string): TokensList | undefined;
function readMarkdownString(path: string): Promise<string | undefined>;
function readMarkdownStringSync(path: string): string | undefined;
// a Marked token list
type TokensList = Token[] & {
links: {
[key: string]: {
href: string | null;
title: string | null;
};
};
}
- @types/marked: TypeScript definitions for Marked
- marked: A markdown parser built for speed
- read-file-safe: Read files without try catch.
- @bconnorwhite/bob: Bob is a toolkit for TypeScript projects
- @types/mock-fs: TypeScript definitions for mock-fs
- mock-fs: A configurable mock file system. You know, for testing.
- marked: A markdown parser built for speed
- write-md-safe: Write markdown files from a Marked token list or string.
- read-file-safe: Read files without try catch.