{"id":13428534,"url":"https://github.com/panzerdp/voca","last_synced_at":"2025-05-13T23:10:07.651Z","repository":{"id":37820014,"uuid":"54569744","full_name":"panzerdp/voca","owner":"panzerdp","description":"The ultimate JavaScript string library","archived":false,"fork":false,"pushed_at":"2023-08-01T14:18:16.000Z","size":3236,"stargazers_count":3616,"open_issues_count":15,"forks_count":140,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-05-05T17:38:57.025Z","etag":null,"topics":["case","javascript","javascript-library","pad","slugify","sprintf","string","truncate"],"latest_commit_sha":null,"homepage":"https://vocajs.pages.dev","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/panzerdp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-03-23T15:10:11.000Z","updated_at":"2025-04-29T02:08:54.000Z","dependencies_parsed_at":"2022-07-15T21:48:24.059Z","dependency_job_id":"e14f7620-4185-4312-999e-eb7ab6e4a713","html_url":"https://github.com/panzerdp/voca","commit_stats":{"total_commits":529,"total_committers":8,"mean_commits":66.125,"dds":"0.018903591682419618","last_synced_commit":"d3183a8a7099dae326ae4c6b4eeeab74e2cf4a64"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panzerdp%2Fvoca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panzerdp%2Fvoca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panzerdp%2Fvoca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panzerdp%2Fvoca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panzerdp","download_url":"https://codeload.github.com/panzerdp/voca/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253033623,"owners_count":21843732,"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":["case","javascript","javascript-library","pad","slugify","sprintf","string","truncate"],"created_at":"2024-07-31T01:00:59.832Z","updated_at":"2025-05-13T23:10:02.629Z","avatar_url":"https://github.com/panzerdp.png","language":"JavaScript","readme":"# [![Voca JavaScript library logo][logo]][voca]\n\n[![travis build](https://img.shields.io/travis/panzerdp/voca.svg)](https://travis-ci.org/panzerdp/voca)\n[![code coverage](https://img.shields.io/codecov/c/github/panzerdp/voca.svg)](https://codecov.io/github/panzerdp/voca)\n[![npm package](https://img.shields.io/npm/v/voca.svg)](https://www.npmjs.com/package/voca)\n\nVoca is a JavaScript library for manipulating strings. [https://vocajs.pages.dev][voca]\n\n```javascript\nv.camelCase('bird flight');              // =\u003e 'birdFlight'\nv.sprintf('%s costs $%.2f', 'Tea', 1.5); // =\u003e 'Tea costs $1.50'\nv.slugify('What a wonderful world');     // =\u003e 'what-a-wonderful-world'\n```\n\nThe Voca library offers helpful functions to make string manipulations comfortable: *change case, trim, pad, slugify,\nlatinise, sprintf'y, truncate, escape* and much more.  The *modular design* allows to load the entire library, or\nindividual functions to minimize the application builds. The library is *fully tested*, *well documented* and *long-term supported*.\n\n## Features\n\n*  Provides the complete set of functions to manipulate, chop, format, escape and query strings\n*  Includes detailed, easy to read and searchable [documentation][voca]\n*  [Supports](https://saucelabs.com/u/panzerdp) a wide range of environments: Node.js 0.10+, Chrome, Firefox, Safari 7+, Edge 13+, IE 9+\n*  100% code coverage\n*  No dependencies\n\n## Documentation\n\nSee the complete documentation at [https://vocajs.pages.dev][voca]\n\n## Usage\nVoca can be used in various environments.\n\n### Node.js, Rollup, Webpack, Browserify\n\n![Voca JavaScript library supports Node.js, Rollup, Webpack, Browserify][logo_commonjs]\n\nInstall the library with npm into your local modules directory:\n\n```bash\nnpm install voca\n```\n\n### CommonJS modules\n\nThen in your application require the entire library:\n\n```javascript\nconst v = require('voca');\nv.trim(' Hello World! ');            // =\u003e 'Hello World'\nv.sprintf('%d red %s', 3, 'apples'); // =\u003e '3 red apples'\n```\n\nOr require individual functions:\n\n```javascript\nconst words = require('voca/words');\nconst slugify = require('voca/slugify');\nwords('welcome to Earth'); // =\u003e ['welcome', 'to', 'Earth']\nslugify('caffé latté');    // =\u003e 'caffe-latte'\n```\n\n### ES2015 modules\n\nVoca is compatible with ES2015 modules to import the entire library:\n\n```javascript\nimport voca from 'voca';\nvoca.kebabCase('goodbye blue sky'); // =\u003e 'goodbye-blue-sky'\n```\n\nOr import individual functions:\n\n```javascript\nimport last from 'voca/last';\nlast('sun rises', 5); // =\u003e 'rises'\n```\n\n### Browser\n\n![Voca JavaScript library supports Chrome, Firefox, Safari, Edge, Internet Explorer][logo_browsers]\n\nLoad the UMD builds directly into browser's web page:\n\n* [`dist/voca.min.js`][voca_min_js] minified production-ready, with [source map][source_map] \n* [`dist/voca.js`][voca_js] uncompressed with comments\n\n```html\n\u003cscript src=\"voca.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nThen a global variable `v` is exposed for the entire library:\n\n```html\n\u003cscript type=\"text/javascript\"\u003e\n  v.last('wonderful world', 5); // =\u003e 'world'\n\u003c/script\u003e\n```\n\n## Functions\n\n| Manipulate                           | Query                          | Chop                                 | Case                           | Index                          |\n| :----------------------------------- | :----------------------------- | :----------------------------------- | :----------------------------- | :------------------------------|\n| [v.insert][insert]                   | [v.endsWith][endsWith]         | [v.charAt][charAt]                   | [v.camelCase][camelCase]       | [v.indexOf][indexOf]           |\n| [v.latinise][latinise]               | [v.includes][includes]         | [v.codePointAt][codePointAt]         | [v.capitalize][capitalize]     | [v.lastIndexOf][lastIndexOf]   |\n| [v.pad][pad]                         | [v.isAlpha][isAlpha]           | [v.first][first]                     | [v.decapitalize][decapitalize] | [v.search][search]             |\n| [v.padLeft][padLeft]                 | [v.isAlphaDigit][isAlphaDigit] | [v.graphemeAt][graphemeAt]           | [v.kebabCase][kebabCase]       | **Escape**                     |\n| [v.padRight][padRight]               | [v.isBlank][isBlank]           | [v.last][last]                       | [v.lowerCase][lowerCase]       | [v.escapeHtml][escapeHtml]     |\n| [v.repeat][repeat]                   | [v.isDigit][isDigit]           | [v.prune][prune]                     | [v.snakeCase][snakeCase]       | [v.escapeRegExp][escapeRegExp] |\n| [v.replace][replace]                 | [v.isEmpty][isEmpty]           | [v.slice][slice]                     | [v.swapCase][swapCase]         | [v.unescapeHtml][unescapeHtml] |\n| [v.replaceAll][replaceAll]           | [v.isLowerCase][isLowerCase]   | [v.substr][substr]                   | [v.titleCase][titleCase]       | **Strip**                      | \n| [v.reverse][reverse]                 | [v.isNumeric][isNumeric]       | [v.substring][substring]             | [v.upperCase][upperCase]       |  [v.stripBom][stripBom]        |\n| [v.reverseGrapheme][reverseGrapheme] | [v.isString][isString]         | [v.truncate][truncate]               | **Split**                      |  [v.stripTags][stripTags]      |\n| [v.slugify][slugify]                 | [v.isUpperCase][isUpperCase]   | **Count**                            | [v.chars][chars]               |                                |\n| [v.splice][splice]                   | [v.matches][matches]           | [v.count][count]                     | [v.codePoints][codePoints]     |                                |\n| [v.tr][tr]                           | [v.startsWith][startsWith]     | [v.countGraphemes][countGraphemes]   | [v.graphemes][graphemes]       |                                |\n| [v.trim][trim]                       | **Format**                     | [v.countSubstrings][countSubstrings] | [v.split][split]               |                                |\n| [v.trimLeft][trimLeft]               | [v.sprintf][sprintf]           | [v.countWhere][countWhere]           | [v.words][words]               |                                |\n| [v.trimRight][trimRight]             | [v.vprintf][vprintf]           | [v.countWords][countWords]           |                                |                                |\n| [v.wordWrap][wordWrap]               |                                |                                      |                                |                                |\n\n## Bug reports\n\nFor bug reports, documentation typos or feature requests feel free to create an [issue](https://github.com/panzerdp/voca/issues).  \nPlease make sure that the same problem wasn't reported already.\n\nFor general usage questions please ask on [StackOverflow](http://stackoverflow.com/questions/ask).\n\n## Contributing\n\nContribution is welcome!\n\n* Create a pull request containing bug fixes or new features. Include unit tests and keep the code coverage report near 100% 😎\n* [Propose](https://github.com/panzerdp/voca/issues/new) new functions, improvements, better documentation\n\nSee more details in [Contributing guide][CONTRIBUTING].\n\nPlease note that this project is released with a Contributor [Code of Conduct][CODE_OF_CONDUCT]. By participating in this project you agree to abide by its terms.\n\n## Author\n\n| ![Dmitri Pavlutin](https://s.gravatar.com/avatar/0d57a57d8807ebc70e24b46f6d9e3a36?s=100) |\n| :-: |\n| Dmitri Pavlutin\n| [Personal blog](https://dmitripavlutin.com)\n| [Email](mailto:dmitripavlutin@gmail.com)\n\n## License\n\nLicensed under [MIT](https://github.com/panzerdp/voca/blob/master/LICENSE.md)\n\n[CODE_OF_CONDUCT]: https://github.com/panzerdp/voca/blob/master/CODE_OF_CONDUCT.md\n[CONTRIBUTING]: https://github.com/panzerdp/voca/blob/master/.github/CONTRIBUTING.md\n[voca_min_js]: https://raw.githubusercontent.com/panzerdp/voca/v1.4.0/dist/voca.min.js\n[source_map]: https://raw.githubusercontent.com/panzerdp/voca/v1.4.0/dist/voca.min.js.map\n[voca_js]: https://raw.githubusercontent.com/panzerdp/voca/v1.4.0/dist/voca.js\n[voca]: https://vocajs.pages.dev\n[logo]: https://github.com/panzerdp/voca/raw/master/jsdoc/template/static/images/voca-logo@300px.png\n[logo_commonjs]: https://github.com/panzerdp/voca/raw/master/jsdoc/template/static/images/commonjs@200px.png\n[logo_browsers]: https://github.com/panzerdp/voca/raw/master/jsdoc/template/static/images/browsers@200px.png\n\n[camelCase]: https://vocajs.pages.dev/#camelCase\n[capitalize]: https://vocajs.pages.dev/#capitalize\n[decapitalize]: https://vocajs.pages.dev/#decapitalize\n[kebabCase]: https://vocajs.pages.dev/#kebabCase\n[lowerCase]: https://vocajs.pages.dev/#lowerCase\n[snakeCase]: https://vocajs.pages.dev/#snakeCase\n[swapCase]: https://vocajs.pages.dev/#swapCase\n[titleCase]: https://vocajs.pages.dev/#titleCase\n[upperCase]: https://vocajs.pages.dev/#upperCase\n\n[charAt]: https://vocajs.pages.dev/#charAt\n[codePointAt]: https://vocajs.pages.dev/#codePointAt\n[first]: https://vocajs.pages.dev/#first\n[graphemeAt]: https://vocajs.pages.dev/#graphemeAt\n[last]: https://vocajs.pages.dev/#last\n[prune]: https://vocajs.pages.dev/#prune\n[slice]: https://vocajs.pages.dev/#slice\n[substr]: https://vocajs.pages.dev/#substr\n[substring]: https://vocajs.pages.dev/#substring\n[truncate]: https://vocajs.pages.dev/#truncate\n\n[count]: https://vocajs.pages.dev/#count\n[countGraphemes]: https://vocajs.pages.dev/#countGraphemes\n[countSubstrings]: https://vocajs.pages.dev/#countSubstrings\n[countWhere]: https://vocajs.pages.dev/#countWhere\n[countWords]: https://vocajs.pages.dev/#countWords\n\n[escapeHtml]: https://vocajs.pages.dev/#escapeHtml\n[escapeRegExp]: https://vocajs.pages.dev/#escapeRegExp\n[unescapeHtml]: https://vocajs.pages.dev/#unescapeHtml\n\n[sprintf]: https://vocajs.pages.dev/#sprintf\n[vprintf]: https://vocajs.pages.dev/#vprintf\n\n[indexOf]: https://vocajs.pages.dev/#indexOf\n[lastIndexOf]: https://vocajs.pages.dev/#lastIndexOf\n[search]: https://vocajs.pages.dev/#search\n\n[insert]: https://vocajs.pages.dev/#insert\n[latinise]: https://vocajs.pages.dev/#latinise\n[pad]: https://vocajs.pages.dev/#pad\n[padLeft]: https://vocajs.pages.dev/#padLeft\n[padRight]: https://vocajs.pages.dev/#padRight\n[repeat]: https://vocajs.pages.dev/#repeat\n[replace]: https://vocajs.pages.dev/#replace\n[replaceAll]: https://vocajs.pages.dev/#replaceAll\n[reverse]: https://vocajs.pages.dev/#reverse\n[reverseGrapheme]: https://vocajs.pages.dev/#reverseGrapheme\n[slugify]: https://vocajs.pages.dev/#slugify\n[splice]: https://vocajs.pages.dev/#splice\n[tr]: https://vocajs.pages.dev/#tr\n[trim]: https://vocajs.pages.dev/#trim\n[trimLeft]: https://vocajs.pages.dev/#trimLeft\n[trimRight]: https://vocajs.pages.dev/#trimRight\n[wordWrap]: https://vocajs.pages.dev/#wordWrap\n\n[endsWith]: https://vocajs.pages.dev/#endsWith\n[includes]: https://vocajs.pages.dev/#includes\n[isAlpha]: https://vocajs.pages.dev/#isAlpha\n[isAlphaDigit]: https://vocajs.pages.dev/#isAlphaDigit\n[isBlank]: https://vocajs.pages.dev/#isBlank\n[isDigit]: https://vocajs.pages.dev/#isDigit\n[isEmpty]: https://vocajs.pages.dev/#isEmpty\n[isLowerCase]: https://vocajs.pages.dev/#isLowerCase\n[isNumeric]: https://vocajs.pages.dev/#isNumeric\n[isString]: https://vocajs.pages.dev/#isString\n[isUpperCase]: https://vocajs.pages.dev/#isUpperCase\n[matches]: https://vocajs.pages.dev/#matches\n[startsWith]: https://vocajs.pages.dev/#startsWith\n\n[chars]: https://vocajs.pages.dev/#chars\n[codePoints]: https://vocajs.pages.dev/#codePoints\n[graphemes]: https://vocajs.pages.dev/#graphemes\n[split]: https://vocajs.pages.dev/#split\n[words]: https://vocajs.pages.dev/#words\n\n[stripTags]: https://vocajs.pages.dev/#stripTags\n[stripBom]: https://vocajs.pages.dev/#stripBom","funding_links":[],"categories":["Other","JavaScript","String","GIT 仓库","String [🔝](#readme)","字符串","Components \u0026\u0026 Librarys"],"sub_categories":["Runner","文本/字符串","运行器","Utilities","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanzerdp%2Fvoca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanzerdp%2Fvoca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanzerdp%2Fvoca/lists"}