Gathering detailed insights and metrics for babel-plugin-jsx-event-modifiers
Gathering detailed insights and metrics for babel-plugin-jsx-event-modifiers
Gathering detailed insights and metrics for babel-plugin-jsx-event-modifiers
Gathering detailed insights and metrics for babel-plugin-jsx-event-modifiers
npm install babel-plugin-jsx-event-modifiers
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
44 Stars
23 Commits
7 Forks
2 Watchers
2 Branches
2 Contributors
Updated on Aug 15, 2023
Latest Version
2.0.5
Package Id
babel-plugin-jsx-event-modifiers@2.0.5
Size
8.63 kB
NPM Version
5.3.0
Node Version
8.2.1
Published on
Aug 27, 2017
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
This babel plugin adds some syntactic sugar to JSX.
1npm i babel-plugin-jsx-event-modifiers -D
or
1yarn add babel-plugin-jsx-event-modifiers -D
Then add jsx-event-modifiers
to your .babelrc
file under plugins
example .babelrc:
1{ 2 "presets": ["es2015"], 3 "plugins": ["jsx-event-modifiers", "transform-vue-jsx"] 4}
Example:
1export default { 2 render () { 3 return ( 4 <input 5 onKeyup:up={this.methodForPressingUp} 6 onKeyup:down={this.methodForPressingDown} 7 onKeyup:bare-shift-enter={this.methodOnlyOnShiftEnter} 8 onKeyup:bare-alt-enter={this.methodOnlyOnAltEnter} 9 /> 10 ) 11 } 12}
will be transpiled into:
1export default { 2 render() { 3 return ( 4 <input 5 {...{ 6 on: { 7 keyup: [ 8 $event => { 9 if (!('button' in $event) && this._k($event.keyCode, 'up', 38)) return null 10 11 this.methodForPressingUp($event) 12 }, 13 $event => { 14 if (!('button' in $event) && this._k($event.keyCode, 'down', 40)) return null 15 16 this.methodForPressingDown($event) 17 }, 18 $event => { 19 if ( 20 ($event.ctrlKey && $event.altKey && $event.metaKey) || 21 !$event.shiftKey || 22 (!('button' in $event) && this._k($event.keyCode, 'enter', 13)) 23 ) 24 return null 25 26 this.methodOnlyOnShiftEnter($event) 27 }, 28 $event => { 29 if ( 30 ($event.ctrlKey && $event.shiftKey && $event.metaKey) || 31 !$event.altKey || 32 (!('button' in $event) && this._k($event.keyCode, 'enter', 13)) 33 ) 34 return null 35 36 this.methodOnlyOnAltEnter($event) 37 }, 38 ], 39 }, 40 }} 41 /> 42 ) 43 }, 44} 45 46
Vue template:
1<input 2 @keyup.up="methodForPressingUp" 3 @keyup.down="methodForPressingDown" 4 @keyup.bare.shift.enter="methodOnlyOnShiftEnter" 5 @keyup.bare.alt.enter="methodOnlyOnAltEnter" 6 @keyup.120="onPressKey120('some', 'arguments')" 7>
JSX:
1<input 2 onKeyup:up={this.methodForPressingUp} 3 onKeyup:down={this.methodForPressingDown} 4 onKeyup:bare-shift-enter={this.methodOnlyOnShiftEnter} 5 onKeyup:bare-alt-enter={this.methodOnlyOnAltEnter} 6 onKeyup:k120={() => this.onPressKey120('some', 'arguments')} 7/>
:
and separated by -
(in vue: prefixed by .
and separated by .
)k
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/23 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
51 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