Installations
npm install babel-plugin-mithril-add-data-attribute
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
12.20.1
NPM Version
6.14.10
Score
72.2
Supply Chain
97.4
Quality
75.7
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (77.64%)
JavaScript (22.36%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
magnuslang
Download Statistics
Total Downloads
9,314
Last Day
3
Last Week
13
Last Month
38
Last Year
216
GitHub Statistics
20 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
3.52 kB
Minified
1.29 kB
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
9,314
Last day
0%
3
Compared to previous day
Last week
18.2%
13
Compared to previous week
Last month
137.5%
38
Compared to previous month
Last year
-80.4%
216
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
20
babel-plugin-mithril-add-data-attribute
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.
- tries to figure out component name from function, class or variable def
- if no name found it tries to use the file name, so you'll know where to start
- when not resolvable: assumes
attrs
to be an object andgetAttrs
to be a function returning anattrs
object
Needs 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.
Examples
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
Installation
1# yarn 2yarn add --dev babel-plugin-mithril-add-data-attribute 3 4# npm 5npm install --save-dev babel-plugin-mithril-add-data-attribute
Usage
Via .babelrc
.babelrc
1{ 2 "env": { 3 "development": { 4 "plugins": ["mithril-add-data-attribute"] 5 } 6 } 7}
(since it's not intended for production code)
Via CLI
1babel --plugins mithril-add-data-attribute script.js
Via Node API
1require("babel-core").transform("code", { 2 plugins: ["mithril-add-data-attribute"], 3});
Options
Under development.
Contribute
Please do. Add an issue or PR.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
23 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
1.3
/10
Last Scanned on 2025-01-27
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