$ gnpm install read-md-safe
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;
};
};
}
Copyright 2013 - present © cnpmjs.org | Home |