# gfm-preview

> Preview your markdown with GitHub API in real time

Latest version **2.1.0** (published 2019-06-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install gfm-preview
pnpm add gfm-preview
yarn add gfm-preview
bun add gfm-preview
```

Provides the command `preview`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2019-06-04 |
| First published | 2018-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 83.1 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Yoshihide Shiono |
| Maintainers | saltyshiomix |
| Keywords | markdown, preview, gfm, gfm-preview, github, ghe, github enterprise |

## Links

- npm: https://www.npmjs.com/package/gfm-preview
- Repository: https://github.com/saltyshiomix/gfm-preview
- Issues: https://github.com/saltyshiomix/gfm-preview/issues
- npm.io page: https://npm.io/package/gfm-preview

## Dependencies (7)

- [arg](https://npm.io/package/arg.md) ^4.1.0
- [open](https://npm.io/package/open.md) ^6.3.0
- [axios](https://npm.io/package/axios.md) ^0.19.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [express](https://npm.io/package/express.md) ^4.17.1
- [chokidar](https://npm.io/package/chokidar.md) ^3.0.1
- [socket.io](https://npm.io/package/socket.io.md) ^2.2.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2019-06-04
- 2.0.0 — 2019-04-20
- 1.7.0 — 2019-03-29
- 1.6.3 — 2018-11-13
- 1.6.2 — 2018-08-19
- 1.6.1 — 2018-08-19
- 1.6.0 — 2018-08-19
- 1.5.2 — 2018-08-08
- 1.5.1 — 2018-08-07
- 1.5.0 — 2018-08-06
- 1.4.1 — 2018-08-06
- 1.4.0 — 2018-08-05
- 1.3.1 — 2018-08-05
- 1.3.0 — 2018-08-05
- 1.2.0 — 2018-08-04
- … 11 more at https://npm.io/package/gfm-preview/versions

## README

<a href="https://www.npmjs.com/package/gfm-preview"><img src="https://img.shields.io/npm/v/gfm-preview.svg"></a>
<a href="https://www.npmjs.com/package/gfm-preview"><img src="https://img.shields.io/npm/dt/gfm-preview.svg"></a>

## Usage

```bash
# install it
$ npm install --global gfm-preview

# preview your markdown
$ preview file.md

# preview with firefox
$ preview file.md --browser firefox

# preview with chrome on macOS
$ preview file.md --browser 'google chrome'

# preview custom host and port number
$ preview file.md --host yourhost --port 3333

# preview with GitHub Enterprise API
$ preview file.md --github-api-url https://your-ghe-host:port/api/v3
```

## Feature

- Render your markdown with GitHub API
- Launch a local preview server (`http://localhost:4649`)
- Hot reload previews when detecting changes
- Close the server when the preview is closed
- Support GitHub Enterprise

## How to change default browser

The browser name is platform dependent. For example, Chrome is `google chrome` on macOS, `google-chrome` on Linux and `chrome` on Windows.

```bash
# with chrome on macOS
$ preview file.md --browser 'google chrome'

# with a custom executable
$ preview file.md --browser 'C:\\Program Files\\Mozilla Firefox\\firefox.exe'
```

## If you use GitHub Enterprise (GHE)

Add an alias to your `~./bashrc`:

```bash
alias preview='preview --github-api-url https://your-ghe-host:port/api/v3'
```

Then use it:

```bash
$ preview file.md
```

---
_Source: https://npm.io/package/gfm-preview · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
