Skip to content

Read markdown files as a Marked token list or string

Notifications You must be signed in to change notification settings

bconnorwhite/read-md-safe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: