# gfm-code-blocks

> Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.

Latest version **1.0.0** (published 2017-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install gfm-code-blocks
pnpm add gfm-code-blocks
yarn add gfm-code-blocks
bun add gfm-code-blocks
```

## 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.0 |
| Published | 2017-03-16 |
| First published | 2014-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | backtick, block, blocks, code, exec, expression, extract, fence, fenced, fences, flavor, flavored, gfm, github, inline, lang, language, markdown, marked, match, matches, md, parse, pattern, patterns, re, regex, regexp, regular, render, replace, replacement |

## Links

- npm: https://www.npmjs.com/package/gfm-code-blocks
- Repository: https://github.com/jonschlinkert/gfm-code-blocks
- Issues: https://github.com/jonschlinkert/gfm-code-blocks/issues
- npm.io page: https://npm.io/package/gfm-code-blocks

## Dependencies (1)

- [gfm-code-block-regex](https://npm.io/package/gfm-code-block-regex.md) ^1.0.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

- 1.0.0 (latest) — 2017-03-16
- 0.3.0 — 2015-05-22
- 0.2.2 — 2015-04-27
- 0.2.1 — 2015-04-02
- 0.2.0 — 2014-09-24
- 0.1.0 — 2014-08-13

## README

# gfm-code-blocks [![NPM version](https://img.shields.io/npm/v/gfm-code-blocks.svg?style=flat)](https://www.npmjs.com/package/gfm-code-blocks) [![NPM monthly downloads](https://img.shields.io/npm/dm/gfm-code-blocks.svg?style=flat)](https://npmjs.org/package/gfm-code-blocks)  [![NPM total downloads](https://img.shields.io/npm/dt/gfm-code-blocks.svg?style=flat)](https://npmjs.org/package/gfm-code-blocks) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/gfm-code-blocks.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/gfm-code-blocks)

> Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save gfm-code-blocks
```

## Usage

```js
var codeBlocks = require('gfm-code-blocks');
console.log(codeBlocks('usage\n```js\nvar qux = 123;\n```\nxyz'));
//=> {lang: 'js', 
//  code: 'var qux = 123;', 
//  block: '```js\nvar qux = 123;\n```',
//  start: 6,
//  end: 30}
```

## About

### Related projects

* [gfm-code-block-regex](https://www.npmjs.com/package/gfm-code-block-regex): RegExp for gfm (GitHub Flavored Markdown) fenced code blocks. | [homepage](https://github.com/regexhq/gfm-code-block-regex "RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.")
* [markdown-toc](https://www.npmjs.com/package/markdown-toc): Generate a markdown TOC (table of contents) with Remarkable. | [homepage](https://github.com/jonschlinkert/markdown-toc "Generate a markdown TOC (table of contents) with Remarkable.")
* [prettify-markdown](https://www.npmjs.com/package/prettify-markdown): Prettify, format or beautify your markdown. Whatever you want to call it, this does that… [more](https://github.com/jonschlinkert/prettify-markdown) | [homepage](https://github.com/jonschlinkert/prettify-markdown "Prettify, format or beautify your markdown. Whatever you want to call it, this does that. Used on hundreds of projects by verb.")
* [remarkable](https://www.npmjs.com/package/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in… [more](https://github.com/jonschlinkert/remarkable) | [homepage](https://github.com/jonschlinkert/remarkable "Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Contributors

| **Commits** | **Contributor** | 
| --- | --- |
| 16 | [jonschlinkert](https://github.com/jonschlinkert) |
| 3 | [tunnckoCore](https://github.com/tunnckoCore) |

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 16, 2017._

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