Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
posthtml-prefix-class
Advanced tools
PostHTML plugin to prefix class names.
npm install --save-dev posthtml-prefix-class
var posthtml = require('posthtml');
var posthtmlPrefixClass = require('posthtml-prefix-class');
posthtml()
.use(posthtmlPrefixClass({
prefix: 'prefix-',
ignore: ['selector-2']
}))
.process(
'<div class="selector-1"><div class="selector-2"></div></div>'
)
.then(function (output) {
console.log(output.html);
// <div class="prefix-selector-1"><div class="selector-2"></div></div>
});
prefix
Type: String
Default: ''
The string used to prefix class names.
ignore
Type: Array|String
Default: []
A class name, or an array of class names, to be excluded from prefixing. Accepts any glob expression supported by minimatch.
var posthtml = require('posthtml');
var posthtmlPrefixClass = require('posthtml-prefix-class');
posthtml()
.use(posthtmlPrefixClass({
prefix: 'prefix-',
ignore: ['selector-*']
}))
.process(
'<div class="selector-1"><div class="selector-2"></div></div>'
)
.then(function (output) {
console.log(output.html);
// <div class="selector-1"><div class="selector-2"></div></div>
});
npm test
FAQs
PostHTML plugin to prefix class names
We found that posthtml-prefix-class 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.