Registry / web-framework / vue-pluralize

vue-pluralize

JSON →
library0.0.2jsnpmunverified

vue-pluralize is a lightweight utility that integrates the popular `pluralize` library as filters for Vue.js 2 projects. It enables developers to easily convert words between singular and plural forms directly within Vue templates using a custom filter, or programmatically via `this.$pluralize` within components. The package is currently at version `0.0.2` and has not received updates since its initial releases in 2018, indicating an abandoned status. It is specifically designed for Vue 2 and is not compatible with Vue 3, which significantly limits its applicability in modern Vue development. Its primary differentiator was its straightforward integration as a Vue 2 plugin and filter, making pluralization functionality readily available within the Vue 2 ecosystem without manual setup of the underlying `pluralize` library.

npm install vue-pluralize
INSTALL
IMPORT
SIG · VUE-PLURALIZE
V
vue-pluralize
web-frameworkjavascriptv0.0.2
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.

VuePluralize
import VuePluralize from 'vue-pluralize'
const VuePluralize = require('vue-pluralize')
Primarily intended for use as a Vue plugin via `Vue.use(VuePluralize)`. The package exports as a UMD module.

This quickstart demonstrates how to install `vue-pluralize` as a Vue 2 plugin and use its `pluralize` filter in templates, along with accessing `$pluralize` directly from the component instance.

<div id="app"></div> <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script> <script src="https://unpkg.com/vue-pluralize@0.0.2/dist/vue-pluralize.umd.js"></script> <script> Vue.use(VuePluralize); new Vue({ el: '#app', data: { itemsCount: 1, anotherCount: 5, }, template: ` <div> <h1>Vue Pluralize Demo</h1> <p>You have {{ itemsCount }} {{ 'item' | pluralize(itemsCount) }}.</p> <p>We found {{ anotherCount }} {{ 'photo' | pluralize(anotherCount) }}.</p> <button @click="itemsCount++">Add Item</button> <button @click="anotherCount++">Add Photo</button> <p>Using $pluralize directly: {{ $pluralize('sheep', 1) }} vs {{ $pluralize('sheep', 2) }}</p> </div> ` }); </script>
Debug
Known issues
breakingThis package is explicitly designed for Vue 2 (peer dependency `vue: >=2.x.x`) and is incompatible with Vue 3. Attempting to use it in a Vue 3 project will result in errors.
fix
For Vue 3, directly install the `pluralize` package (`npm install pluralize`) and implement a custom global property or composable for similar functionality, as filters are deprecated in Vue 3.
affects: >=0.0.1
deprecatedVue 2 filters, which `vue-pluralize` heavily relies on, are deprecated in Vue 3. While they work in Vue 2, they represent an outdated pattern for data transformation in templates.
fix
In Vue 3, prefer computed properties, methods, or custom composables for data transformation logic.
affects: >=0.0.1
gotchaThe package is abandoned, with the last commit over six years ago. This means there will be no updates for security vulnerabilities, bug fixes, or compatibility with newer JavaScript/TypeScript versions or build tooling.
fix
Consider using the standalone `pluralize` library directly (`npm install pluralize`) and integrating it manually into your Vue 2 project or migrating to a more modern solution if using Vue 3.
affects: >=0.0.1
Errors
Common errors & fixes
[Vue warn]: Failed to resolve filter: pluralize
Attempting to use `vue-pluralize` in a Vue 3 project, where filters are deprecated and the plugin cannot be correctly registered.
fix
This package is for Vue 2 only. For Vue 3, use the underlying `pluralize` package directly and wrap it in a custom method or composable.
TypeError: Vue.use is not a function
This error occurs if `Vue` is not correctly imported or exposed globally when trying to register the plugin, or if you are running in a Vue 3 context where the `Vue` global object behaves differently.
fix
Ensure you are using Vue 2 and that `import Vue from 'vue'` is present at the top of your main JavaScript file before calling `Vue.use(VuePluralize)`.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
vuerequiredRequired as a peer dependency for plugin registration and Vue 2 compatibility.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
vue-pluralize — npm install vue-pluralize · libregistry