
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
postxml-beml
Advanced tools
Postxml plugin which extend HTML syntax for comfortable working with bem html.
npm i postxml-beml --save-dev
var fs = require('fs'),
postxml = require('postxml'),
plugin = require('postxml-beml');
var html = fs.readFileSync('input.html', 'utf8');
var opts = {
elemPrefix: '__',
modPrefix: '_',
modDlmtr: '_'
};
var output = postxml(
html,
[
plugin(opts)
]
);
<div block="b-animals">
<div elem="cat" mod="size:big, color:red"></div>
</div>
translated to
<div class="b-animals">
<div class="b-animals__cat b-animals__cat_size_big b-animals__cat_color_red"></div>
</div>
<div block="animals">
<div block="unicorn"></div>
</div>
<div class="animals">
<div class="unicorn"></div>
</div>
<div block="animals">
<div elem="item">
<div elem="item-name"></div>
</div>
</div>
<div class="animals">
<div class="animals__item">
<div class="animals__item-name"></div>
</div>
</div>
<div block="animals">
<div block="unicorn" mod="size:large, female"></div>
</div>
<div class="animals">
<div class="unicorn inicorn_size_large unicorn_female"></div>
</div>
<div block="animals">
<div elem="item" mix="block:unicorn, mod: [large, female]">
<div block="unicorn" elem="photo"></div>
<div elem="item-name"></div>
</div>
</div>
<div class="animals">
<div class="animals__item unicorn unicorn_large unicorn_female">
<div class="unicorn__photo"></div>
<div class="animals__item-name"></div>
</div>
</div>
For complex values you can use pseudo JSON syntax:
<div block="unicorn" mix="block:animals, elem:item, mod:{size:large,gender:female}"></div>
<div block="unicorn" mix="{block:b-mix-1}, {block:b-mix-2, mod:[mod1, mod2]}"></div>
<div class="unicorn animals__item animals__item_size_large animals__item_gender_female"></div>
<div class="unicorn b-mix-1 b-mix-2 b-mix-2_mod1 b-mix-2_mod_2"></div>
MIT
FAQs
Postxml plugin which extend HTML syntax for comfortable working with bem html.
The npm package postxml-beml receives a total of 1 weekly downloads. As such, postxml-beml popularity was classified as not popular.
We found that postxml-beml 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.