# invert-markdown

> inverts markdown code, converting fenced code into the body and markdown into comments

Latest version **0.0.1** (published 2014-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install invert-markdown
pnpm add invert-markdown
yarn add invert-markdown
bun add invert-markdown
```

Provides the command `invert-markdown`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-05-14 |
| First published | 2014-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Benjamin Atkin |
| Maintainers | bat |
| Keywords | markdown |

## Links

- npm: https://www.npmjs.com/package/invert-markdown
- Repository: https://github.com/benatkin/invert-markdown
- Issues: https://github.com/benatkin/invert-markdown/issues
- npm.io page: https://npm.io/package/invert-markdown

## Dependencies (2)

- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [commander](https://npm.io/package/commander.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

- 0.0.1 (latest) — 2014-05-14

## README

# invert-markdown

inverts markdown code, converting fenced code into the body and markdown into comments

To install, run `npm install invert-markdown`.

This contains a script. For usage run `./node_modules/.bin/invert-markdown --help`.
You can try it on this file with `./node_modules/.bin/invert-markdown README.md`.
The output will be written to stdout.

``` javascript
var invertMarkdown = require('./');
var assert = require('assert');

function testConvertToJavascript() {
  var input = "# Hello\n\n``` javascript\nconsole.log('Hello World')\n```\n\nThis is an example\n";
  var expected = "// # Hello\n\nconsole.log('Hello World')\n\n// This is an example\n";
  var output = invertMarkdown(input);
  assert.strictEqual(output, expected);
}

function testConvertToMarkdown() {
  var input = "// # Hello\n\nconsole.log('Hello World')\n\n// This is an example\n";
  var expected = "# Hello\n\n``` javascript\nconsole.log('Hello World')\n```\n\nThis is an example\n";
  var output = invertMarkdown(input);
  assert.strictEqual(output, expected);
}

testConvertToJavaScript();
testConvertToMarkdown();

console.log('it worked!');
```

# LICENSE

[MIT](http://bat.mit-license.org/)

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