1.0.6 • Published 8 years ago

extract-bem v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Extract BEM NPM Package

Build Status NPM Downloads NPM Version NPM License

This package will help you to get BEM blocks from your HTML.

Only elements with classes like this will apear in an output object:

<div class="block"></div>
<div class="some-block"></div>
<div class="someBlock"></div>

Usage

Install package via npm:

$ npm install extract-bem

Require the package:

var extractBEM = require('extract-bem');

In your script put down these lines of code:

var blocks = extractBEM({
    blade: false, // turn on blade engine parser (this options could help you with Laravel templates)
    directory: './src/html', // the directory where your files (also can be an array)
    extension: 'html', // the extension of your files (also can be an array)
    encoding: 'utf8' // the encoding of your files
});

The output will be an object like this:

{
    "filename-without-extension": ["block", "some-block", "someBlock"],
    "another-file-without-extension": []
}
1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago