Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
bem-config
Advanced tools
var bemConfig = require('bem-config');
var optionalConfig = { plugins: { create: { techs: ['styl', 'browser.js'] } } };
var projectConfig = bemConfig(optionalConfig); // returns BemConfig instance
All options are optional:
name
// base name for rc files. Default value is bem
.cwd
// Default value is process.cwd()
.defaults
// extends found configs with this objectpathToConfig
// custom path to config on FSfsRoot
// custom '/' directoryfsHome
// custom $HOME directoryplugins
// array of paths to plugings to requirevar config = require('bem-config')();
config.get().then(function(conf) {
console.log(conf); // config is a merge of CLI args + optionalConfig + all configs found by rc
});
var config = require('bem-config')();
config.level('path/to/level').then(function(levelConf) {
console.log(levelConf); // merged level config
});
var config = require('bem-config')();
config.library('bem-components').then(function(libConf) {
console.log(libConf); // library config
});
var config = require('bem-config')();
config.levelMap().then(function(levelMap) {
console.log(levelMap); // all levels hash with their options
});
var config = require('bem-config')();
config.module('bem-tools').then(function(bemToolsConf) {
console.log(bemToolsConf); // merged config for required module
});
var config = require('bem-config')();
config.configs().then(function(configs) {
console.log(configs); // all found configs from all dirs
});
var config = require('bem-config')();
var conf = config.getSync();
console.log(conf); // config is a merge of CLI args + optionalConfig + all configs found by rc
var config = require('bem-config')();
var levelConf = config.levelSync('path/to/level');
console.log(levelConf); // merged level config
var config = require('bem-config')();
var libConf = config.librarySync('bem-components');
console.log(libConf); // library config
var config = require('bem-config')();
var levelMap = config.levelMapSync();
console.log(levelMap); // all levels hash with their options
var config = require('bem-config')();
var bemToolsConf = config.moduleSync('bem-tools')
console.log(bemToolsConf); // merged config for required module
var config = require('bem-config')();
var configs = config.configs(true);
console.log(configs); // all found configs from all dirs
.bemrc
:
{
"root": true,
"levels": {
"path/to/level": {
"scheme": "nested",
"default": true
}
},
"libs": {
"libName": {
"path": "path/to/lib"
}
},
"sets": {
"setName": ["level1", "level2"]
},
"modules": {
"bem-tools": {
"plugins": {
"create": {
"techs": [
"css", "js"
],
"templateFolder": "path/to/templates",
"templates": {
"js-ymodules": "path/to/templates/js"
},
"techsTemplates": {
"js": "js-ymodules"
},
"levels": {
"path/to/level": {
"techs": ["bemhtml.js", "trololo.olo"]
}
}
}
}
},
"bem-libs-site-data": {
"someOption": "someValue"
}
}
}
levels
override common options.
Code and documentation © 2015 YANDEX LLC. Code released under the Mozilla Public License 2.0.
FAQs
Config module for bem-tools
We found that bem-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.