Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
babel-plugin-mithril-add-data-attribute
Advanced tools
Babel plugin adds attributes to m() components - intended for development - do not used in production. Helps debug - find your components in a large repo. Adds component name and file to component data attributes which will be visible in the generated HTM
This plugin adds a data-component
attribute to top-level DOM elements rendered by mithril component function m
. Intended for development - bloats HTML. Helps debug: find your components in a large repo from generated HTML. Adds component name or file name to component data attributes which will be visible in the generated HTML.
attrs
to be an object and getAttrs
to be a function returning an attrs
objectNeeds more tests and better support, feel free to add issues with failing test code or commit a PR. Written in TypeScript. Not tested or used in production.
In
const Comp2 = () => m("div");
const MyComponent = () => {
return m("div", m(Comp2));
};
Out
const Comp2 = () =>
m("div", {
"data-component": "Comp2",
});
const MyComponent = () => {
return m(
"div",
{
"data-component": "MyComponent",
},
m(Comp2)
);
};
For many more examples se test/index.test.js
# yarn
yarn add --dev babel-plugin-mithril-add-data-attribute
# npm
npm install --save-dev babel-plugin-mithril-add-data-attribute
.babelrc
.babelrc
{
"env": {
"development": {
"plugins": ["mithril-add-data-attribute"]
}
}
}
(since it's not intended for production code)
babel --plugins mithril-add-data-attribute script.js
require("babel-core").transform("code", {
plugins: ["mithril-add-data-attribute"],
});
Under development.
Please do. Add an issue or PR.
FAQs
Babel plugin adds attributes to m() components - intended for development - do not used in production. Helps debug - find your components in a large repo. Adds component name and file to component data attributes which will be visible in the generated HTM
The npm package babel-plugin-mithril-add-data-attribute receives a total of 13 weekly downloads. As such, babel-plugin-mithril-add-data-attribute popularity was classified as not popular.
We found that babel-plugin-mithril-add-data-attribute 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.