# codemirror-highlight-node

> Transforms source code into formatted HTML using Codemirror

Latest version **1.0.2** (published 2015-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install codemirror-highlight-node
pnpm add codemirror-highlight-node
yarn add codemirror-highlight-node
bun add codemirror-highlight-node
```

## 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 | 1.0.2 |
| Published | 2015-05-16 |
| First published | 2015-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Michal Dorner |
| Maintainers | dorny |
| Keywords | codemirror, highlight |

## Links

- npm: https://www.npmjs.com/package/codemirror-highlight-node
- Repository: https://github.com/dorny/codemirror-highlight-node
- Issues: https://github.com/dorny/codemirror-highlight-node/issues
- npm.io page: https://npm.io/package/codemirror-highlight-node

## Dependencies (3)

- [resolve](https://npm.io/package/resolve.md) ^1.1.6
- [codemirror](https://npm.io/package/codemirror.md) ^5.2.0
- [escape-html](https://npm.io/package/escape-html.md) ^1.0.1

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2015-05-16
- 1.0.1 — 2015-05-16
- 1.0.0 — 2015-05-16

## README

[![Build Status](https://travis-ci.org/dorny/codemirror-highlight-node.png?branch=master)](https://travis-ci.org/dorny/codemirror-highlight-node)
[![Dependency Status](https://gemnasium.com/dorny/codemirror-highlight-node.png)](https://gemnasium.com/dorny/codemirror-highlight-node)

# codemirror-highlight-node

Transforms source code into formatted HTML using [CodeMirror](http://codemirror.net/).
Tabs, whitespaces and new line characters are preserved from original source code.


## Install

```
npm install codemirror-highlight-node
```


## Usage

``` javascript
var highlight = require('codemirror-highlight-node');
highlight('function Test() {}', 'javascript');
// => <span class="cm-keyword">function</span> <span class="cm-variable">Test</span>() {}
```

## API

Loading this module will add two functions to CodeMirror:
 * loadMode(name) - resolve and load requested mode
 * highlightCode(code, modeSpec) - transform soruce code to formatted HTML

As `modeSpec` parameter you can use name (e.g. `"javascript"`), alias (e.g. `"csharp"` for C#) or full modeSpec object required by CodeMirror.
Module exports directly `highlightCode` function. CodeMirror object is also re-exported as `highlightCode.CodeMirror`.


## LICENSE

MIT

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