npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-case

v1.0.7

Published

A collection of Vue.js case filters

Downloads

31

Readme

vue-case Build Status

A collection of Vue.js case filters

Installation

Direct include

Simply include vue-case after Vue and it will install itself automatically:

<script src="vue.js"></script>
<script src="vue-case.min.js"></script>

CDN jsDelivr Hits

<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-case"></script>

NPM npm

npm install vue-case

When used with a module system, you must explicitly install the filters via Vue.use():

import Vue from 'vue'
import VueCase from 'vue-case'

Vue.use(VueCase)

You don't need to do this when using global script tags.

Nuxt.js

npm install vue-case

When create file plugins/vue-case.js:

import Vue from 'vue'
import VueCase from 'vue-case'

Vue.use(VueCase)

Then, add the file inside the plugins key of nuxt.config.js:

module.exports = {
  //...
  plugins: [
    '~/plugins/vue-case'
  ],
  //...
}

Available Filters

Usage

camelCase

  • Example:

    {{ msg | camelCase }} // 'I LOVE vue-case' => 'iLoveVueCase'

pascalCase

  • Example:

    {{ msg | pascalCase }} // 'I LOVE vue-case' => 'ILoveVueCase'

capitalCase

  • Example:

    {{ msg | capitalCase }} // 'I LOVE vue-case' => '	I Love Vue Case'

headerCase

  • Example:

    {{ msg | headerCase }} // 'I LOVE vue-case' => 'I-Love-Vue-Case'

titleCase

  • Example:

    {{ msg | titleCase }} // 'I LOVE vue-case' => 'I LOVE Vue-Case'

pathCase

  • Example:

    {{ msg | pathCase }} // 'I LOVE vue-case' => 'i/love/vue/case'

paramCase

  • Example:

    {{ msg | paramCase }} // 'I LOVE vue-case' => 'i-love-vue-case'

dotCase

  • Example:

    {{ msg | dotCase }} // 'I LOVE vue-case' => 'i.love.vue.case'

snakeCase

  • Example:

    {{ msg | snakeCase }} // 'I LOVE vue-case' => 'i_love_vue_case'

constantCase

  • Example:

    {{ msg | constantCase }} // 'I LOVE vue-case' => 'I_LOVE_VUE_CASE'

lowerCase

  • Example:

    {{ msg | lowerCase }} // 'I LOVE vue-case' => 'i love vue-case'

lowerCaseFirst

  • Example:

    {{ msg | lowerCaseFirst }} // 'I LOVE vue-case' => 'i LOVE vue-case'

upperCase

  • Example:

    {{ msg | upperCase }} // 'I LOVE vue-case' => 'I LOVE VUE-CASE'

upperCaseFirst

  • Example:

    {{ msg | upperCaseFirst }} // 'I LOVE vue-case' => 'I LOVE vue-case'

swapCase

  • Example:

    {{ msg | swapCase }} // 'I LOVE vue-case' => 'i love VUE-CASE'

sentenceCase

  • Example:

    {{ msg | sentenceCase }} // 'I LOVE vue-case' => 'I love vue case'

noCase

  • Example:

    {{ msg | noCase }} // 'I LOVE vue-case' => 'i love vue case'

isLowerCase

  • Example:

    {{ msg | isLowerCase }} // 'I LOVE vue-case' => 'false'

isUpperCase

  • Example:

    {{ msg | isUpperCase }} // 'I LOVE vue-case' => 'false'

truncate

  • Example:

    {{ msg | truncate(10) }} // 'I LOVE vue-case' => 'I LOVE vue...'

Programmatic Usage

Aside from using filters inside templates you can do this programmatically using default filters object:

this.$options.filters.filterName(value)

For example, here's how you can use the truncate filter:

this.$options.filters.truncate('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 17) // => Lorem ipsum dolor...

Contribution

If you find a bug or want to contribute to the code or documentation, you can help by submitting an issue or a pull request.

License

MIT