# remark-bemjson

> remark plugin to compile bemjson

Latest version **1.0.2** (published 2019-06-20) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install remark-bemjson
pnpm add remark-bemjson
yarn add remark-bemjson
bun add remark-bemjson
```

## 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 | 2019-06-20 |
| First published | 2017-03-13 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8 |
| Dependencies | 3 |
| Unpacked size | 26.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Konstantin Gladkikh |
| Maintainers | birhoff |
| Keywords | remark, bemjson, compiler |

## Links

- npm: https://www.npmjs.com/package/remark-bemjson
- Repository: https://github.com/bem-contrib/md-to-bemjson
- Homepage: https://github.com/bem-contrib/md-to-bemjson/packages/remark-bemjson#readme
- Issues: https://github.com/bem-contrib/md-to-bemjson/issues?q=label%3Apkg%3Aremark-bemjson
- npm.io page: https://npm.io/package/remark-bemjson

## Dependencies (3)

- [umd](https://npm.io/package/umd.md) ^3.0.3
- [lodash.defaultsdeep](https://npm.io/package/lodash.defaultsdeep.md) ^4.6.0
- [mdast-util-to-bemjson](https://npm.io/package/mdast-util-to-bemjson.md) ^1.0.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-06-20
- 0.4.0-alpha.a5125ef3 (canary) — 2017-10-06
- 1.0.1 — 2019-06-20
- 1.0.0 — 2019-02-25
- 0.5.3 — 2018-10-23
- 0.5.2 — 2018-08-16
- 0.5.0 — 2018-06-29
- 0.4.0 — 2017-10-06
- 0.3.1 — 2017-10-01
- 0.3.0 — 2017-04-03
- 0.2.0 — 2017-03-31
- 0.1.1 — 2017-03-26
- 0.1.0 — 2017-03-26
- 0.0.4 — 2017-03-15
- 0.0.2 — 2017-03-13

## README

# remark-bemjson
Compile markdown to BEMJSON with [**remark**](https://github.com/wooorm/remark).

[![NPM Status][npm-img]][npm]
[![Travis Status][test-img]][travis]
[![Coverage Status][coverage-img]][coveralls]
[![Dependency Status][dependency-img]][david]
[![Greenkeeper badge][greenkeeper-img]][greenkeeper]

[npm]:            https://www.npmjs.org/package/remark-bemjson
[npm-img]:        https://img.shields.io/npm/v/remark-bemjson.svg

[travis]:         https://travis-ci.org/birhoff/remark-bemjson
[test-img]:       https://img.shields.io/travis/birhoff/remark-bemjson.svg?label=tests

[coveralls]:      https://coveralls.io/r/birhoff/remark-bemjson
[coverage-img]:   https://img.shields.io/coveralls/birhoff/remark-bemjson.svg

[david]:          https://david-dm.org/birhoff/remark-bemjson
[dependency-img]: http://img.shields.io/david/birhoff/remark-bemjson.svg

[greenkeeper]:    https://greenkeeper.io/
[greenkeeper-img]:https://badges.greenkeeper.io/birhoff/remark-bemjson.svg

## Requirements

* [Node.js 8+](https://nodejs.org/en/)

## Install

```sh
$ npm install remark-bemjson
```

## Usage

```js
const remark = require('remark');
const bemjson = require('remark-bemjson');

const file = remark().use(bemjson).processSync('# Hello im _heading_');

console.log(String(file));
```
Yields: 
```json
{
  "block": "documentation",
  "content": {
    "block": "heading",
    "mods": {
      "level": 1
    },
    "content": [
      "Hello im ",
      {
        "block": "emphasis",
        "content": "heading"
      }
    ]
  }
}
```

## API

### `remark.use(bemjson[, options])`

#### `options`

##### *string* exportType - determinate how to export bemjson. Default: `commonJS`

Value      | Description
-----------|------------
`commonJS` | Exports to [CJS](https://nodejs.org/docs/latest/api/modules.html#modules_modules).
`modules`  | Exports to [ES6 modules](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export). Optional combines with `exportName`. 
`umd`      | Exports to [UMD](https://github.com/umdjs/umd) with [umd package](https://github.com/ForbesLindesay/umd). *Requires* exportName.
`YModules` | Exports to [YModules](https://github.com/ymaps/modules). *Requires* exportName.
`no export`| Don't do any export. Just plain `JSON.stringify`.

##### *string* exportName - export bemjson with given name when use `modules`, `umd` or `YModules`.

##### *boolean* export - if `false` don't generate export. Default: `true` 

##### *Function* augment - callback called on every node. [Signature](https://github.com/birhoff/mdast-util-to-bemjson#augmentbemnodebemnode-important-must-return-bemnode). Option passed to [`mdast-util-to-bemjson`](https://github.com/birhoff/mdast-util-to-bemjson).


License
-------

Code and documentation copyright 2017 YANDEX LLC. Code released under the [Mozilla Public License 2.0](LICENSE.txt).

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