<commit_before>
# express-bem [![Build Status](https://travis-ci.org/zxqfox/express-bem.svg)](https://travis-ci.org/zxqfox/express-bem) [![Dependency Status](https://david-dm.org/zxqfox/express-bem.png)](https://david-dm.org/zxqfox/express-bem)

[BEM][] bundles render adapter for [express][] :palm_tree:

[express]: https://github.com/visionmedia/express
[BEM]: http://bem.info/

## Why

Because laziness and short memory. And because simple solutions rocks.

And now it's just a `npm i express-bem` and 3 lines of code to use bem blocks library in any app.

## Plugins

- [express-bem-bemtree](https://github.com/zxqfox/express-bem-bemtree)
- [express-bem-bemhtml](https://github.com/zxqfox/express-bem-bemhtml)
- [express-bem-tools-make](https://github.com/zxqfox/express-bem-tools-make) bem-tools make middleware

## Dependencies

### Peer

[express][] v3.0+

## Installation

```sh
$ npm i express-bem --save
```

## Usage

To _load_ and _init_ module you can use this snippet:

```js
var Express = require('express'),
var ExpressBem = require('express-bem'),

// create app and bem
app = Express(),
bem = ExpressBem({
  projectRoot: './path-to/bem-project', // bem project root, used for bem make only
  path: './custom.bundles',             // path to your bundles
  cache: false                          // to reload files each render
});

// register engines
bem.usePlugin('bemtree'); // requires module express-bem-bemtree
bem.usePlugin('bemhtml'); // ... express-bem-bemhtml

bem.engine('.bh.js', function (name, options, cb) {
  // some custom .bh.js realisation
  cb(null, 'result');<commit_msg>little readme update<commit_after>
# express-bem [![Build Status](https://travis-ci.org/zxqfox/express-bem.svg)](https://travis-ci.org/zxqfox/express-bem) [![Dependency Status](https://david-dm.org/zxqfox/express-bem.png)](https://david-dm.org/zxqfox/express-bem)

[BEM][] bundles render adapter for [express][] :palm_tree:

[express]: https://github.com/visionmedia/express
[BEM]: http://bem.info/

## Why

Because laziness and short memory. And because simple solutions rocks.

And now it's just a `npm i express-bem` and 3 lines of code to use bem blocks library in any app.

## Plugins

- [express-bem-bemtree](https://github.com/zxqfox/express-bem-bemtree)
- [express-bem-bemhtml](https://github.com/zxqfox/express-bem-bemhtml)
- [express-bem-tools-make](https://github.com/zxqfox/express-bem-tools-make) bem-tools make middleware

## Dependencies

### Peer

[express][] v3.0+

## Installation

```sh
$ npm i express-bem --save
```

## Usage

To _load_ and _init_ module you can use this snippet:

```js
var Express = require('express'),
var ExpressBem = require('express-bem'),

// create app and bem
app = Express(),
bem = ExpressBem({
  projectRoot: './path-to/bem-project', // bem project root, used for bem make only
  path: './custom.bundles',             // path to your bundles
  cache: false                          // to reload files each render
});

// register engines
bem.usePlugin('express-bem-bemtree'); // requires module express-bem-bemtree
bem.usePlugin('express-bem-bemhtml'); // ... express-bem-bemhtml

bem.engine('.bh.js', function (name, options, cb) {
  // some custom .bh.js realisation
  cb(null, 'result');
{'fraction_non_alphanumeric': 0.16630736064059132, 'fraction_numerical': 0.0018478595626732369, 'mean_word_length': 3.659971305595409, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4272530', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1139, 'n_words': 269}