Gathering detailed insights and metrics for babel-plugin-mithril-add-data-attribute
Gathering detailed insights and metrics for babel-plugin-mithril-add-data-attribute
Gathering detailed insights and metrics for babel-plugin-mithril-add-data-attribute
Gathering detailed insights and metrics for babel-plugin-mithril-add-data-attribute
Babel plugin adds attributes to m() components - intended for development. 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 HTML.
npm install babel-plugin-mithril-add-data-attribute
Typescript
Module System
Node Version
NPM Version
TypeScript (77.64%)
JavaScript (22.36%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
20 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Apr 12, 2021
Latest Version
1.0.8
Package Id
babel-plugin-mithril-add-data-attribute@1.0.8
Unpacked Size
21.01 kB
Size
4.17 kB
File Count
5
NPM Version
6.14.10
Node Version
12.20.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
20
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
1const Comp2 = () => m("div"); 2 3const MyComponent = () => { 4 return m("div", m(Comp2)); 5};
Out
1const Comp2 = () => 2 m("div", { 3 "data-component": "Comp2", 4 }); 5 6const MyComponent = () => { 7 return m( 8 "div", 9 { 10 "data-component": "MyComponent", 11 }, 12 m(Comp2) 13 ); 14};
For many more examples se test/index.test.js
1# yarn 2yarn add --dev babel-plugin-mithril-add-data-attribute 3 4# npm 5npm install --save-dev babel-plugin-mithril-add-data-attribute
.babelrc
.babelrc
1{ 2 "env": { 3 "development": { 4 "plugins": ["mithril-add-data-attribute"] 5 } 6 } 7}
(since it's not intended for production code)
1babel --plugins mithril-add-data-attribute script.js
1require("babel-core").transform("code", { 2 plugins: ["mithril-add-data-attribute"], 3});
Under development.
Please do. Add an issue or PR.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no SAST tool detected
Details
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
25 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More