Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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": "/Users/tadatuta/Sites/bem/bem-tools-create/templates",
"templates": {
"js-ymodules": "/Users/tadatuta/Sites/bem/bem-tools-create/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
The npm package bem-config receives a total of 7 weekly downloads. As such, bem-config popularity was classified as not popular.
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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.