Registry / web-framework / v-money

v-money

JSON →
library0.8.1jsnpmunverified

v-money is a lightweight, dependency-free Vue.js library that provides currency input masking capabilities, functioning both as a component (`<money>`) and a directive (`v-money`). It enables users to format currency inputs with specified decimal, thousands separators, prefixes, and suffixes, and supports features like copy/paste and mobile compatibility. The current and final stable version is 0.8.1, published over 9 years ago, and the library is no longer actively maintained. For Vue 3 applications, developers should use `v-money3`, which is a direct successor designed to address Vue 3 compatibility and continues active development. v-money was a popular choice for Vue 2 projects needing simple, flexible currency formatting without external dependencies.

npm install v-money
INSTALL
IMPORT
SIG · V-MONEY
V
v-money
web-frameworkjavascriptv0.8.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Money
import { Money } from 'v-money'
import Money from 'v-money'
Used when registering the component locally. This package is for Vue 2 only.
VMoney
import { VMoney } from 'v-money'
import VMoneyDirective from 'v-money'
Used when registering the directive locally. Note the 'V' prefix to denote a directive. This package is for Vue 2 only.
money
import money from 'v-money' Vue.use(money, { precision: 4 })
const money = require('v-money') Vue.use(money)
Used for global plugin registration with Vue.use(). This package is for Vue 2 only and does not fully support CommonJS `require` for global use.

Demonstrates how to use the `money` component to create a currency input field with custom formatting, binding it to a reactive `price` value in a Vue 2 (or composition API compatible) setup.

<template> <div> <money v-model="price" v-bind="moneyConfig"></money> {{ price }} </div> </template> <script lang="ts"> import { Money } from 'v-money'; import { defineComponent, ref } from 'vue'; export default defineComponent({ components: { Money }, setup() { const price = ref(123456.78); const moneyConfig = { decimal: ',', thousands: '.', prefix: 'R$ ', suffix: ' #', precision: 2, masked: false }; return { price, moneyConfig }; } }); </script>
Debug
Known issues
breakingThe `v-money` library is designed for Vue 2 and is not compatible with Vue 3. Attempting to use it in a Vue 3 project will result in runtime errors and unexpected behavior. The original maintainers have abandoned this project.
fix
Migrate to `v-money3` (https://github.com/jonathanpmartins/v-money3) which is the spiritual successor built specifically for Vue 3 applications. `v-money3` is actively maintained.
affects: >=0.8.1
gotchaWhen using `v-money` as a directive (e.g., on a native `<input>` element), you must use the `v-model.lazy` modifier for proper two-way data binding. Standard `v-model` may lead to inconsistencies or incorrect updates.
fix
Change `v-model="price"` to `v-model.lazy="price"` on the input element where the `v-money` directive is applied.
affects: >=0.1.0
gotchaThe `masked` property, which controls whether the output value includes the mask characters, does not work when `v-money` is used as a directive. It only functions correctly when `v-money` is used as a component (`<money>`).
fix
If you require the `masked` property functionality (i.e., having the raw unmasked number in your model), use the `<money>` component instead of the `v-money` directive.
affects: >=0.1.0
deprecatedThe `v-money` library is no longer actively maintained and has not seen updates in over 9 years. While functional for Vue 2, it will not receive bug fixes, security patches, or new features.
fix
For new projects or existing projects considering a Vue 3 migration, transition to `v-money3`. For legacy Vue 2 projects, be aware of the lack of ongoing support and consider potential long-term risks.
affects: >=0.8.1
Upgrade
Version history
0.8.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
v-money — npm install v-money · libregistry