{"id":16976935,"url":"https://github.com/johndatserakis/vue-countable","last_synced_at":"2025-03-22T14:31:53.778Z","repository":{"id":57395401,"uuid":"135964076","full_name":"johndatserakis/vue-countable","owner":"johndatserakis","description":"✍️ Vue binding for countable.js. Provides real-time paragraph, sentence, word, and character counting.","archived":false,"fork":false,"pushed_at":"2019-10-20T13:51:50.000Z","size":1407,"stargazers_count":26,"open_issues_count":6,"forks_count":4,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-04-25T07:41:47.702Z","etag":null,"topics":["characters","count","countable","counter","paragraphs","vue","words"],"latest_commit_sha":null,"homepage":"https://johndatserakis.github.io/vue-countable/","language":"Vue","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/johndatserakis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-06-04T03:06:18.000Z","updated_at":"2023-12-31T22:40:16.000Z","dependencies_parsed_at":"2022-09-05T05:50:12.307Z","dependency_job_id":null,"html_url":"https://github.com/johndatserakis/vue-countable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johndatserakis%2Fvue-countable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johndatserakis%2Fvue-countable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johndatserakis%2Fvue-countable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johndatserakis%2Fvue-countable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johndatserakis","download_url":"https://codeload.github.com/johndatserakis/vue-countable/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244972328,"owners_count":20540962,"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":["characters","count","countable","counter","paragraphs","vue","words"],"created_at":"2024-10-14T01:27:38.041Z","updated_at":"2025-03-22T14:31:53.412Z","avatar_url":"https://github.com/johndatserakis.png","language":"Vue","funding_links":[],"categories":["UI组件","Components \u0026 Libraries","UI Components","UI Components [🔝](#readme)"],"sub_categories":["杂","UI Components","Miscellaneous"],"readme":"# vue-countable\n\nVue binding for [countable.js](https://sacha.me/Countable/). Provides real-time paragraph, sentence, word, and character counting.\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vue-countable\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/vue-countable.svg\" alt=\"NPM Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vue-countable\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/vue-countable.svg\" alt=\"NPM Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Fjohndatserakis%2Fvue-countable\u0026text=Check%20out%20vue-countable%20on%20GitHub\u0026via=johndatserakis\"\u003e\n  \u003cimg src=\"https://img.shields.io/twitter/url/https/github.com/johndatserakis/vue-countable.svg?style=social\" alt=\"Tweet\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### Demo\n\n[View Demo](https://johndatserakis.github.io/vue-countable/) | [View on NPM](https://www.npmjs.com/package/vue-countable) | [View on GitHub](https://github.com/johndatserakis/vue-countable)\n\n### Install\n\n```\n# npm\nnpm i vue-countable\n\n# yarn\nyarn add vue-countable\n```\n\nOr you can include it through the browser at the bottom of your page:\n\n`\u003cscript src=\"https://unpkg.com/vue-countable/dist/vue-countable.min.js\"\u003e\u003c/script\u003e`\n\n### About\n\nSimple way to count characters, words, sentences, and paragraphs in your Vue apps.\n\nPass your `text` as a prop to the provided component, along with a unique `elementId`, and register for the `change` event to get real-time count updates.\n\n### Usage Example\n\n```html\nimport VueCountable from 'vue-countable'\nVue.component('vue-countable', VueCountable)\n```\n\n```html\n\u003c!-- In your html - Make sure the elementId prop is unique on your page. --\u003e\n\u003cvue-countable\n    :text=\"myText\" // Your text variable\n    :elementId=\"'myId'\" // A unique string id\n    @change=\"change\" // Register for the change event\n\u003e\u003c/vue-countable\u003e\n\n\u003c!-- The @change function --\u003e\nchange (event) {\n    console.log(event)\n    // event.words to get word count, etc.\n}\n```\n\nNow, anytime (and on component initialization) your `myText` variable changes, `vue-countable` will emit an event containing the details of your text. Register for this event as shown above to get your real-time counts.\n\n### Props\n\n| prop    | type  | description                    |\n|---------|-------|--------------------------------|\n| text | String | Text you want to track. |\n| elementId | String | A unique id for your tracking instance. This allows you to have multiple different counts on the same page.|\n| hardReturns | Boolean (Optional, defaults to false) | Require two returns to count paragraphs |\n| stripTags | Boolean (Optional, defaults to false) | Remove HTML before counting |\n| ignore | Array of Strings (Optional, defaults to empty) | Characters to be ignored. |\n\n### Events\n\n| event    | value  | description                    |\n|---------|-------|--------------------------------|\n| change | Object | Provides `character`, `word`, `sentence`, `paragraph`, and `all` values. |\n\n### Development\n\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot reload\nnpm run watch\n\n# run the tests\nnpm run test\n\n# build demo page\nnpm run build:example\n\n# build library\nnpm run build:library\n\n# build everything and run tests\nnpm run build\n```\n\n### Other\n\nGo ahead and fork the project! Submit an issue if needed. Have fun!\n\n### Thank You\n\n[Sacha Schmid](https://sacha.me/) for [countable.js](https://sacha.me/Countable/).\n\n### License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nPackaged with a mixture of [vue-lib-template](https://github.com/biigpongsatorn/vue-lib-template) and [vue-sfc-rollup](https://github.com/team-innovation/vue-sfc-rollup). Using [webpack 4](https://webpack.js.org/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohndatserakis%2Fvue-countable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohndatserakis%2Fvue-countable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohndatserakis%2Fvue-countable/lists"}