Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
bem-tools-find
Advanced tools
Readme
Инструмент для поиска БЭМ сущностей по заданным критериям.
Инструмент устанавливается как обычная npm-зависимость:
$ npm install bem-tools-find
BEM Tool Find
Usage:
find COMMAND [OPTIONS] [ARGS]
find [OPTIONS] [ARGS]
Commands:
completion : Shell completion
Options:
-h, --help : Help
-l LEVEL, --level=LEVEL : Name of level(s)
-b BLOCK, --block=BLOCK : Name of block(s)
-e ELEMENT, --element=ELEMENT : Name of element(s)
-m MODIFIER, --mod=MODIFIER : Name of modifier(s)
-t TECH, --tech=TECH : Name of tech(s)
-v VIEW, --view=VIEW : Type of output
Arguments:
ENTITY : entity
Здесь:
-h
, --help
- флаг предназначенный для получения справочной информации по вызову команды.-l
, --level
- имя уровня(ей) переопределения блоков для поиска. Может быть использован несколько раз.-b
, --block
- имя блока(ов) для поиска. Может быть использован несколько раз.-e
, --element
- имя элемента(ов) блока(ов) для поиска. Может быть использован несколько раз.-m
, --mod
- имя модификатора. Если указан также параметр элемента (-e
, --element
),
то подразумевается поиск по модификаторам элементов блока. Если параметр элемента отсутствует, то
будет произведен поиск по модификаторам блока.-t
, --tech
- имя технологии блока.-v
, --view
- стиль вывода результата поиска. Может принимать значения plain
(по умолчанию), table
и tree
.$ ./node-modules/bem-tools-find/find
my-block
:$ ./node-modules/bem-tools-find/find -b my-block
my-block
на уровне переопределения desktop.blocks
:$ ./node-modules/bem-tools-find/find -l desktop.blocks -b my-block
$ ./node-modules/bem-tools-find/find -b my-block1 -b my-block2
my-element
блока my-block
:$ ./node-modules/bem-tools-find/find -b my-block -e my-element
my-mod
блока my-block
:$ ./node-modules/bem-tools-find/find -b my-block -m my-mod
my-mod
элемента my-element
блока my-block
:$ ./node-modules/bem-tools-find/find -b my-block -e my-element -m my-mod
js
блока my-block
:$ ./node-modules/bem-tools-find/find -b my-block -t js
my-block
в табличном виде:$ ./node-modules/bem-tools-find/find -b my-block -v table
my-block
в виде дерева БЭМ сущностей:$ ./node-modules/bem-tools-find/find -b my-block -v tree
$ ./node-modules/bem-tools-find/find --help
Кроме того, инструмент допускает использование сокращенного синтаксиса для поиска сущностей, например
для того, чтобы найти файлы блоков my-block1
и my-block2
, можно использовать команду:
$ ./node-modules/bem-tools-find/find my-block1 my-block2
Аналогично для элементов и модификаторов блоков:
$ ./node-modules/bem-tools-find/find my-block1__some-elem
$ ./node-modules/bem-tools-find/find my-block1_modName_modValue
bem-tools-find
также может быть использован программно. Для этого нужно подключить зависимость
bem-tools-find
в модуль вашего проекта и передать переметры для поиска BEM-сущностей.
var bemToolsFind = require('bem-tools-find');
bemToolsFind({
levels: ['level1'],
blocks: ['block1', 'block2'],
elements: ['elem1', 'elem2'],
modifiers: ['mod1', 'mod2'],
techs: ['tech1', 'tech2']
}).pipe(process.stdout) //здесь вместо `process.stdout` можно использовать ваш собственный stream.
Примечание: в передаваемом объекте с параметрами поиска любые поля могут быть опущены в том случае если критерий поиска по ним не является необходимым.
Запуск тестов
$ npm test
Запуск тестов с вычислением покрытия кода тестами с помощью инструмента istanbul:
$ npm run cover
Проверка синтаксиса кода с помощью: jshint, jscs
$ npm run lint
Особая благодарность за помощь в разработке:
Разработчики:
Вопросы и предложения присылать в раздел issues репозитория данного инструмента.
FAQs
Tool for bem-entities lookup
The npm package bem-tools-find receives a total of 1 weekly downloads. As such, bem-tools-find popularity was classified as not popular.
We found that bem-tools-find demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.