1.0.5 • Published 2 years ago

read-md-safe v1.0.5

Weekly downloads
9
License
MIT
Repository
github
Last release
2 years ago

Read markdown files as a Marked token list or string.

Installation

yarn add read-md-safe
npm install read-md-safe

API

Types

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;
    };
  };
}

MIT

Related Packages: