Gathering detailed insights and metrics for vue-imask
Gathering detailed insights and metrics for vue-imask
Gathering detailed insights and metrics for vue-imask
Gathering detailed insights and metrics for vue-imask
npm install vue-imask
Typescript
Module System
Node Version
NPM Version
TypeScript (93.31%)
JavaScript (3.67%)
HTML (2.96%)
Ruby (0.05%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
5,102 Stars
956 Commits
268 Forks
30 Watchers
9 Branches
29 Contributors
Updated on Jul 15, 2025
Latest Version
7.6.1
Package Id
vue-imask@7.6.1
Unpacked Size
142.65 kB
Size
27.39 kB
File Count
34
NPM Version
lerna/8.1.2/node@v21.7.3+arm64 (darwin)
Node Version
21.7.3
Published on
May 21, 2024
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
vue-imask
npm i vue-imask
for Vue 2 also do:
npm i -D @vue/composition-api
If you are using NuxtJS with Vue 2 you also need to install:
npm i -D @nuxtjs/composition-api
And then add @nuxtjs/composition-api/module
in the buildModules option in your nuxt.config.js
.
1<template> 2 <imask-input 3 v-model="numberModel" 4 :mask="Number" 5 radix="." 6 :unmask="true" 7 <!-- depending on prop above first argument of 'accept' callback is 8 `value` if `unmask=false`, 9 `unmaskedValue` if `unmask=true`, 10 `typedValue` if `unmask='typed'` --> 11 @accept="onAccept" 12 13 <!-- ...see more mask props in a guide --> 14 15 <!-- other input props --> 16 placeholder='Enter number here' 17 /> 18</template> 19 20<script> 21 import { IMaskComponent } from 'vue-imask'; 22 23 export default { 24 data () { 25 return { 26 numberModel: '', 27 onAccept (value) { 28 console.log(value); 29 } 30 } 31 }, 32 components: { 33 'imask-input': IMaskComponent 34 } 35 } 36</script>
1<template> 2 <imask-input 3 <!-- possible to use 'v-model' = 'v-model:value' = 'v-model:masked' and 'v-model:unmasked' --> 4 v-model:typed="numberModel" 5 :mask="Number" 6 radix="." 7 @accept:masked="onAccept" <!-- accept value (same as '@accept:value' or just '@accept') --> 8 @accept:unmasked="onAcceptUnmasked" 9 <!-- 10 @accept:typed="onAccepttyped" 11 @complete:typed="onCompleteTyped" 12 --> 13 14 <!-- ...see more mask props in a guide --> 15 16 <!-- other input props --> 17 placeholder='Enter number here' 18 /> 19</template> 20 21<script> 22 import { IMaskComponent } from 'vue-imask'; 23 24 export default { 25 data () { 26 return { 27 numberModel: '', 28 onAccept (value) { 29 console.log({ value }); 30 }, 31 onAcceptUnmasked (unmaskedValue) { 32 console.log({ unmaskedValue }); 33 } 34 } 35 }, 36 components: { 37 'imask-input': IMaskComponent 38 } 39 } 40</script>
In some cases value bindings (v-model
) might not work for directive, you can use @accept
or @complete
events to update the value.
1<template> 2 <input 3 :value="value" 4 v-imask="mask" 5 @accept="onAccept" 6 @complete="onComplete"> 7</template> 8 9<script> 10 import { IMaskDirective } from 'vue-imask'; 11 12 export default { 13 data () { 14 return { 15 value: '', 16 mask: { 17 mask: '{8}000000', 18 lazy: false 19 }, 20 }, 21 }, 22 methods: { 23 onAccept (e) { 24 const maskRef = e.detail; 25 this.value = maskRef.value; 26 console.log('accept', maskRef.value); 27 }, 28 onComplete (e) { 29 const maskRef = e.detail; 30 console.log('complete', maskRef.unmaskedValue); 31 }, 32 }, 33 directives: { 34 imask: IMaskDirective 35 } 36 } 37</script>
More options see in a guide.
1<template> 2 <input ref="el"> 3</template> 4 5<script> 6 import { useIMask } from 'vue-imask'; 7 8 export default { 9 setup (props) { 10 const { el, masked } = useIMask({ 11 mask: Number, 12 radix: '.', 13 }, /* optional { 14 emit, 15 onAccept, 16 onComplete, 17 defaultValue, 18 defaultUnmaskedValue, 19 defaultTypedValue, 20 } */); 21 22 return { el }; 23 } 24 } 25</script>
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 2/27 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
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
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