{"id":13424202,"url":"https://github.com/Haixing-Hu/vue-titlecase","last_synced_at":"2025-03-15T18:34:13.139Z","repository":{"id":58230938,"uuid":"43634673","full_name":"Haixing-Hu/vue-titlecase","owner":"Haixing-Hu","description":"A Vue.js filter used to make a string titlecased.","archived":false,"fork":false,"pushed_at":"2016-11-01T15:13:58.000Z","size":22,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-03T08:11:21.592Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Haixing-Hu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-04T11:48:12.000Z","updated_at":"2022-08-03T20:52:04.000Z","dependencies_parsed_at":"2022-08-30T20:01:43.905Z","dependency_job_id":null,"html_url":"https://github.com/Haixing-Hu/vue-titlecase","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haixing-Hu%2Fvue-titlecase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haixing-Hu%2Fvue-titlecase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haixing-Hu%2Fvue-titlecase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haixing-Hu%2Fvue-titlecase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Haixing-Hu","download_url":"https://codeload.github.com/Haixing-Hu/vue-titlecase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243775781,"owners_count":20346260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T00:00:50.108Z","updated_at":"2025-03-15T18:34:08.115Z","avatar_url":"https://github.com/Haixing-Hu.png","language":"JavaScript","funding_links":[],"categories":["Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","实用库","Awesome Vue.js"],"sub_categories":["Libraries \u0026 Plugins"],"readme":"# vue-titlecase\r\n\r\n[![Build Status](https://circleci.com/gh/Haixing-Hu/vue-titlecase/tree/master.svg?style=shield)](https://circleci.com/gh/Haixing-Hu/vue-titlecase/tree/master)\r\n[![Coverage Status](https://coveralls.io/repos/Haixing-Hu/vue-titlecase/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/Haixing-Hu/vue-titlecase?branch=master)\r\n[![bitHound Score](https://www.bithound.io/github/Haixing-Hu/vue-titlecase/badges/score.svg)](https://www.bithound.io/github/Haixing-Hu/vue-titlecase)\r\n[![Dependency Status](https://david-dm.org/Haixing-Hu/vue-titlecase.svg)](https://david-dm.org/Haixing-Hu/vue-titlecase)\r\n[![devDependency Status](https://david-dm.org/Haixing-Hu/vue-titlecase/dev-status.svg)](https://david-dm.org/Haixing-Hu/vue-titlecase#info=devDependencies)\r\n\r\nA Vue.js plugin provides a filter and a function to titlecase a string.\r\n\r\n# Requirements\r\n- [Vue.js](https://github.com/yyx990803/vue) `^1.0.24`\r\n\r\n# Algorithm\r\n\r\nThe algorithm is based on the gamma rule described as follows:\r\n\r\n[Glossary of Grammatical and Rhetorical Terms: title case (capitalization)](http://grammar.about.com/od/tz/g/Title-Case.htm)\r\n\r\n# Instllation\r\n\r\n## npm\r\n\r\n```shell\r\n$ npm install vue-titlecase\r\n```\r\n\r\n## bower\r\n\r\n```shell\r\n$ bower install vue-titlecase\r\n```\r\n\r\n# Usage\r\n\r\n```javascript\r\nvar Vue = require('vue')\r\nvar Titlecase = require('vue-titlecase')\r\n\r\n// set plugin\r\nVue.use(Titlecase)\r\n\r\n// create instance\r\nnew Vue({\r\n  el: '#test-titlecase',\r\n  data: {\r\n    msg: \"hello world! my id is starfish. I LOVE WATCHing tv.\",\r\n  }\r\n})\r\n```\r\n\r\nTemplate the following:\r\n\r\n```html\r\n\u003cdiv id=\"test-titlecase\" class=\"message\"\u003e\r\n  \u003cp\u003e{{ msg | titlecase }}\u003c/p\u003e\r\n  \u003cp\u003e{{ msg.toTitleCase() }}\u003c/p\u003e\r\n\u003c/div\u003e\r\n```\r\n\r\nOutput the following:\r\n\r\n```html\r\n\u003cdiv id=\"test-titlecase\" class=\"message\"\u003e\r\n  \u003cp\u003eHello World! My ID is Starfish. I Love Watching TV.\u003c/p\u003e\r\n  \u003cp\u003eHello World! My ID is Starfish. I Love Watching TV.\u003c/p\u003e\r\n\u003c/div\u003e\r\n```\r\n\r\n# API\r\n\r\n## `String.prototype.toTitleCase()`\r\n\r\nConverts a string instance to the titlecase form. Returns a new string.\r\n\r\n## `titlecase`\r\n\r\nThis is a customized Vue filter used to converts the string representation of\r\nan object to the titlecase form.\r\n\r\n# Contributing\r\n- Fork it !\r\n- Create your top branch from `dev`: `git branch my-new-topic origin/dev`\r\n- Commit your changes: `git commit -am 'Add some topic'`\r\n- Push to the branch: `git push origin my-new-topic`\r\n- Submit a pull request to `dev` branch of `Haixing-Hu/vue-titlecase` repository !\r\n\r\n# Building and Testing\r\n\r\nFirst you should install all depended NPM packages. The NPM packages are used\r\nfor building and testing this package.\r\n\r\n```shell\r\n$ npm install\r\n```\r\n\r\nThen install all depended bower packages. The bower packages are depended by\r\nthis packages.\r\n\r\n```shell\r\n$ bower install\r\n```\r\n\r\nNow you can build the project.\r\n```shell\r\n$ gulp build\r\n```\r\n\r\nThe following command will test the project.\r\n```shell\r\n$ gulp test\r\n```\r\n\r\nThe following command will perform the test and generate a coverage report.\r\n```shell\r\n$ gulp test:coverage\r\n```\r\n\r\nThe following command will perform the test, generate a coverage report, and\r\nupload the coverage report to [coveralls.io](https://coveralls.io/).\r\n```shell\r\n$ gulp test:coveralls\r\n```\r\n\r\nYou can also run `bower install` and `gulp build` together with the following\r\ncommand:\r\n```shell\r\nnpm run build\r\n```\r\n\r\nOr run `bower install` and `gulp test:coveralls` together with the following\r\ncommand:\r\n```shell\r\nnpm run test\r\n```\r\n\r\n# License\r\n\r\n[The MIT License](http://opensource.org/licenses/MIT)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHaixing-Hu%2Fvue-titlecase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHaixing-Hu%2Fvue-titlecase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHaixing-Hu%2Fvue-titlecase/lists"}