# @code-blocks/from-md

> Get code blocks from markdown

Latest version **0.1.0** (published 2020-08-20) · GPLv2 license · 0 weekly downloads

## Install

```sh
npm install @code-blocks/from-md
pnpm add @code-blocks/from-md
yarn add @code-blocks/from-md
bun add @code-blocks/from-md
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-08-20 |
| First published | 2020-06-08 |
| Weekly downloads | 0 |
| License | GPLv2 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | idris-maps |
| Maintainers | idris-maps |

## Links

- npm: https://www.npmjs.com/package/@code-blocks/from-md
- Repository: https://github.com/idris-maps/code-blocks
- Homepage: https://github.com/idris-maps/code-blocks/tree/master/packages/from-md
- Issues: https://github.com/idris-maps/code-blocks/issues
- npm.io page: https://npm.io/package/@code-blocks/from-md

## Recent versions

- 0.1.0 (latest) — 2020-08-20
- 0.0.2 — 2020-08-17
- 0.0.1 — 2020-07-24
- 0.0.0 — 2020-06-08

## README

# `@code-blocks/from-md`

Extracts code blocks from markdown.

## Usage

```ts
import fromMD from '@code-blocks/from-md'

fromMD(someHTML, ['line-chart', 'csv-table'])
```

Takes tow arguments:

* `md` a string containing markdown
* `languages` an array of languages to extract

Returns an array of parts:

```ts
export interface PartCode {
  type: 'code'
  language: string
  content: string
}

export interface PartOther {
  type: 'other'
  content: string
}

export type Part = PartCode | PartOther
```

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