read-md-safe

1.0.5 • Public • Published

read-md-safe

NPM TypeScript Coverage Status GitHub Stars Twitter Follow

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

Dependenciesdependencies


Dev DependenciesDavid


License license

MIT


Related Packages:

/read-md-safe/

    Package Sidebar

    Install

    npm i read-md-safe

    Weekly Downloads

    59

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    7.96 kB

    Total Files

    7

    Last publish

    Collaborators

    • bconnorwhite