# @code-blocks/parser

> Code block parser

Latest version **0.1.8** (published 2021-08-07) · GPLv2 license · 0 weekly downloads

## Install

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

## 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.8 |
| Published | 2021-08-07 |
| First published | 2020-06-14 |
| Weekly downloads | 0 |
| License | GPLv2 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.7 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/parser
- Repository: https://github.com/idris-maps/code-blocks
- Homepage: https://github.com/idris-maps/code-blocks/tree/master/packages/parser
- Issues: https://github.com/idris-maps/code-blocks/issues
- npm.io page: https://npm.io/package/@code-blocks/parser

## Dependencies (2)

- [ramda](https://npm.io/package/ramda.md) ^0.27.0
- [front-matter](https://npm.io/package/front-matter.md) ^4.0.2

## Recent versions

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

## README

# `@code-blocks/parser`

Parses code blocks, with or without front-matter, as JSON or DSV.

## Usage

```ts
import {
  getMeta,
  parseDsv,
  parseJson,
} from '@code-blocks/parser'
```

### `getMeta`

Extracts meta data from front-matter. Takes the content of a code block and returns an object with two keys `meta` (a JSON object with the meta data) and `content` (the rest of the code block).

### `parseDsv`

Parses the content as delimiter separated values. Takes the separator as argument and returns a function that takes the content of the code block and returns an array of JSON objects.

### `parseJson`

Parses the content as JSON. Takes the content as only argument and returns a JSON object.

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