# vue-mask-directive

> Simple input mask lib for vue.js

Latest version **1.0.4** (published 2017-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-mask-directive
pnpm add vue-mask-directive
yarn add vue-mask-directive
bun add vue-mask-directive
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-04-03 |
| First published | 2017-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sergey Lebedev |
| Maintainers | brainkit |
| Keywords | vue.js, vue, vue-mask |

## Links

- npm: https://www.npmjs.com/package/vue-mask-directive
- Repository: https://github.com/brainkit/vue-mask-directive
- Homepage: https://github.com/brainkit/vue-mask-directive#readme
- Issues: https://github.com/brainkit/vue-mask-directive/issues
- npm.io page: https://npm.io/package/vue-mask-directive

## Recent versions

- 1.0.4 (latest) — 2017-04-03
- 1.0.3 — 2017-04-03
- 1.0.2 — 2017-04-03
- 1.0.0 — 2017-04-03

## README

Vue input mask
==============

Simple input mask lib for vue.js based on [PureMask.js](https://github.com/romulobrasil/PureMask.js)

## Installation

This version requires Vue 2.X.

  `npm install vue-mask-directive`

## Usage

```javascript
import Vue     from 'vue'
import VueMaskDirective from 'vue-mask-directive'

/** Activate vue.js plugins **/
Vue.use(VueMaskDirective);
```

Now you are ready to use it in the code!

```html
<input type="text" v-mask="'####-##'" v-model="myInputModel">
<!-- OR -->
<input type="text" v-mask="'##/##/#### ##:##'" v-model="myInputModel">
```
**Notice:** `v-model` is required starting from `v1.1.0`, because [a lot](https://github.com/probil/v-mask/issues/16) [of](https://github.com/probil/v-mask/issues/30) [bugs](https://github.com/probil/v-mask/issues/29) with HTMLElement event listeners and sync with Vue internals.

There is no reason to support using this lib for using without `v-model` but open the door for using on [custom inputs](http://vuejs.org/v2/guide/components.html#Form-Input-Components-using-Custom-Events).

## Format description

List of supported placeholders:

| Value | Format                       |
|-------|------------------------------|
| #     | Number (0-9)                 |
| A     | Letter in any case (a-z,A-Z) |
| N     | Number or letter             |
| X     | Any symbol                   |

## Tests

[Jest](https://github.com/facebook/jest) is used for unit-tests.

You can run tests by typing this command in your console:

```bash
npm test
```

## Contributing

PR is welcome!

**Notice:** You should make your changes only in `src` folder, don't try to edit files from `dist` as it compiled from `src` by babel and shouldn't be changes manually.

---
_Source: https://npm.io/package/vue-mask-directive · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
