How to use bem - 10 common examples

To help you get started, we’ve selected a few bem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bem-archive / bem-site-engine / datasrc / .bem / nodes / exampler.js View on Github external
var CP = require('child_process'),
    PATH = require('path'),
//    UTIL = require('util'),
    BEM = require('bem'),
    Q = BEM.require('q'),
    LOGGER = BEM.require('./logger.js'),
    registry = BEM.require('./nodesregistry.js'),
    nodes = BEM.require('./nodes/node.js'),

    PRJ_ROOT = PATH.resolve(__dirname, '../../../');


var ExamplerNodeName = exports.ExamplerNodeName = 'ExamplerNode';
Object.defineProperty(exports, ExamplerNodeName, {
    get : function() { return registry.getNodeClass(ExamplerNodeName) }
});


registry.decl(ExamplerNodeName, nodes.NodeName, {

    __constructor : function(o) {
        this.__base(o);
github bem / bem-core / .bem / techs / html.js View on Github external
var BEM = require('bem'),
    Q = BEM.require('q'),
    VM = require('vm');

exports.API_VER = 2;

exports.techMixin = {

    getBemhtml : function(prefix) {

        var path = this.getPath(prefix, 'bemhtml.js');
        return BEM.util.readFile(path)
            .then(function(c) {
                /* global BEMHTML */
                /** @name BEMHTML variable appears after runInThisContext() call */
                VM.runInThisContext(c, path);
                return BEMHTML;
            });
github bem-archive / bem-site-engine / datasrc / .bem / nodes / exampler.js View on Github external
var CP = require('child_process'),
    PATH = require('path'),
//    UTIL = require('util'),
    BEM = require('bem'),
    Q = BEM.require('q'),
    LOGGER = BEM.require('./logger.js'),
    registry = BEM.require('./nodesregistry.js'),
    nodes = BEM.require('./nodes/node.js'),

    PRJ_ROOT = PATH.resolve(__dirname, '../../../');


var ExamplerNodeName = exports.ExamplerNodeName = 'ExamplerNode';
Object.defineProperty(exports, ExamplerNodeName, {
    get : function() { return registry.getNodeClass(ExamplerNodeName) }
});


registry.decl(ExamplerNodeName, nodes.NodeName, {

    __constructor : function(o) {
        this.__base(o);
        this.root = o.root;
github bem-archive / bem-site-engine / datasrc / .bem / nodes / exampler.js View on Github external
var CP = require('child_process'),
    PATH = require('path'),
//    UTIL = require('util'),
    BEM = require('bem'),
    Q = BEM.require('q'),
    LOGGER = BEM.require('./logger.js'),
    registry = BEM.require('./nodesregistry.js'),
    nodes = BEM.require('./nodes/node.js'),

    PRJ_ROOT = PATH.resolve(__dirname, '../../../');


var ExamplerNodeName = exports.ExamplerNodeName = 'ExamplerNode';
Object.defineProperty(exports, ExamplerNodeName, {
    get : function() { return registry.getNodeClass(ExamplerNodeName) }
});


registry.decl(ExamplerNodeName, nodes.NodeName, {

    __constructor : function(o) {
        this.__base(o);
        this.root = o.root;
github bem-archive / bem-site-engine / datasrc / .bem / boot.js View on Github external
// Tests only

require('./sources.js');

var PATH = require('path'),
    BEM = require('bem'),

    Q = BEM.require('q'),
    APW = BEM.require('apw'),
    registry = BEM.require('./nodesregistry'),
    LOGGER = BEM.require('./logger'),
    MAKE = BEM.require('./make'),

    arch = new APW.Arch(),
    CacherNode = registry.getNodeClass('CacherNode'),
    SourceNode = registry.getNodeClass('SourceNode'),

    targets = process.argv.slice(2),
    opts = {
        root : PATH.dirname(__dirname),
        arch : arch
    };

if(!targets.length) {
    targets = ['sources'];
github bem-archive / bem-site-engine / datasrc / .bem / nodes / workers / make-examples.js View on Github external
var BEM = require('bem'),
    APW = BEM.require('apw'),
    MAKE = BEM.require('./make.js'),
    make = require('../../lib/make.js'),
    arch = new APW.Arch(),

    // FIXME: с 10 воркерами (bem-tools, default) сборка падает:
    // "Error: channel closed"
    //DEFAULT_WORKERS = 4;
    DEFAULT_WORKERS = 12;

function appendExamplesNodes(DefaultArch) {
    require('../examples.js');

    return DefaultArch;
}

process.once('message', function(m) {
github bem-archive / bem-site-engine / datasrc / .bem / nodes / introspector.js View on Github external
var PATH = require('path'),
    BEM = require('bem'),
    Q = BEM.require('qq'),
    QFS = BEM.require('q-fs'),
    LOGGER = BEM.require('./logger.js'),
    registry = BEM.require('./nodesregistry.js'),
    nodes = BEM.require('./nodes/node.js'),
    fileNodes = BEM.require('./nodes/file.js'),

    createLevel = BEM.createLevel,
    U = BEM.util;


var IntrospectorNodeName = exports.IntrospectorNodeName = 'IntrospectorNode';
Object.defineProperty(exports, IntrospectorNodeName, {
    get : function() { return registry.getNodeClass(IntrospectorNodeName) }
});

registry.decl(IntrospectorNodeName, nodes.NodeName, {

    __constructor : function(o) {
github bem-archive / bem-site-engine / datasrc / .bem / nodes / source.js View on Github external
var PATH = require('path'),
    BEM = require('bem'),
    Q = BEM.require('q'),
    LOGGER = BEM.require('./logger.js'),
    registry = BEM.require('./nodesregistry.js'),
    nodes = BEM.require('./nodes/node.js'),
    cacherNodes = require('./cacher.js'),
    cacheNodes = require('./cache.js'),
    introspectorNodes = require('./introspector.js'),
    examplerNodes = require('./exampler.js'),
    pageNodes = require('./page.js'),

    PRJ_ROOT = PATH.resolve(__dirname, '../../../'),
    environ = require(PATH.join(PRJ_ROOT, '.bem/environ.js')),
    outputNodes = require(environ.getLibPath('bem-gen-doc', '.bem/nodes/output.js')),

    U = BEM.util,
    SOURCE_NODEID = exports.SOURCE_NODEID = 'sources';
github bem-archive / bem-site-engine / datasrc / .bem / nodes / page.js View on Github external
var PATH = require('path'),
    BEM = require('bem'),
    Q = BEM.require('q'),
    QFS = BEM.require('q-fs'),
    registry = BEM.require('./nodesregistry.js'),
    nodes = BEM.require('./nodes/node.js'),
    fileNodes = BEM.require('./nodes/file.js'),

    U = BEM.util;


var PageNodeName = exports.PageNodeName = 'PageNode';
Object.defineProperty(exports, PageNodeName, {
    get : function() { return registry.getNodeClass(PageNodeName) }
});

registry.decl(PageNodeName, nodes.NodeName, {

    __constructor : function(o) {
        this.__base(o);
github bem-archive / bem-site-engine / datasrc / .bem / nodes / cache.js View on Github external
var CRYPTO = require('crypto'),
    PATH = require('path'),
    BEM = require('bem'),
    QFS = BEM.require('q-fs'),
    LOGGER = BEM.require('./logger.js'),
    registry = BEM.require('./nodesregistry.js'),
    nodes = BEM.require('./nodes/node.js'),
    libNodes = BEM.require('./nodes/lib.js'),
    repo = require('legoa-repodb'),
    U = BEM.util,
    DECL_SEP = '@';


var CacheNodeName = exports.CacheNodeName = 'CacheNode';
Object.defineProperty(exports, CacheNodeName, {
    get : function() { return registry.getNodeClass(CacheNodeName) }
});

registry.decl(CacheNodeName, nodes.NodeName, {

    __constructor : function(o) {

bem

BEM Tools

MPL-2.0
Latest version published 8 years ago

Package Health Score

40 / 100
Full package analysis

Popular bem functions