npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

enb-bem-pseudo-levels

v0.4.0

Published

Pseudo BEM levels for ENB

Readme

enb-bem-pseudo-levels

NPM version Build Status Dependency Status

Инструмент для манипуляции уровнями переопределений для ENB позволяет создавать уровни на основе уже существующих.

Текущая реализация основана на симлинках. Это означает, что созданный уровень будет состоять из симлинок на файлы исходных уровней.

Установка

npm install --save-dev enb-bem-pseudo-levels

Для работы модуля требуется зависимость от пакета enb версии 0.15.0 или выше.

Как использовать?

Для того, чтобы выполнить манипуляцию над уровнями, следует:

  1. Задать список исходных уровней, на основе которых будут производиться манипуляции.
  2. Задекларировать resolve-функцию по пути до нового уровня.
  3. Запустить процесс сборки новых уровней.

Пример того, как скопировать nested-уровень и положить его на файловую систему в simple-стиле:

var pseudo = require('enb-bem-pseudo-levels');

module.exports = function (config) {

var dstpath = config.resolvePath('pseudo-level');  // путь до нового уровня

// Создаём таск с названием `pseudo`, для манипуляций с уровнями.
config.task('pseudo', function () {
var args = [].slice.call(arguments, 1).map(function (arg) {
    return config.resolvePath(arg);
});                                 // Получаем список целей, которые хотим
                                    // построить в новом уровне. Если список пуст
                                    // уровень будет построен полностью.

return pseudo(getLevels(config))    // Сканируем исходные уровни.    (1)
    .addBuilder(dstpath, resolve)   // Задаём путь и resolve-функцию (2)
    .build(args);                   // Строим новый уровень          (3)
});

};

/**
 * Функция применяется для каждого файла найденного на исходных уровнях `levels`
 *
 * @param file информация о текущем файле
 * @param levels список исходных уровней
 * @param dstpath путь до нового уровня
 */
function resolve (file, levels, dstpath) {
    return [{
        sourcePath: file.fullname,                 // путь до исходного файла
        targetPath: path.join(dstpath, file.name)  // путь до нового файла
    }];
}

function getLevels (config) {
    return [
        'source-level'
    ].map(function (level) {
        return config.resolvePath(level);
    });
}

Запускаем описанный в таске скрипт манипуляции с уровнями pseudo:

$ ./node_modules/.bin/enb make pseudo

Лицензия

© 2014 YANDEX LLC. Код лицензирован Mozilla Public License 2.0.