{"id":16197875,"url":"https://github.com/tronghieu60s/vn-str","last_synced_at":"2025-03-19T05:30:31.555Z","repository":{"id":57393557,"uuid":"336746637","full_name":"tronghieu60s/vn-str","owner":"tronghieu60s","description":"A vietnamese string processing library. 🔥","archived":false,"fork":false,"pushed_at":"2022-09-10T04:23:54.000Z","size":325,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T03:51:21.655Z","etag":null,"topics":["javascript-library","npm","npm-package"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/vn-str","language":"TypeScript","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/tronghieu60s.png","metadata":{"files":{"readme":"README-vn.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":"2021-02-07T09:16:06.000Z","updated_at":"2025-03-12T02:32:29.000Z","dependencies_parsed_at":"2022-09-26T16:51:11.142Z","dependency_job_id":null,"html_url":"https://github.com/tronghieu60s/vn-str","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronghieu60s%2Fvn-str","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronghieu60s%2Fvn-str/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronghieu60s%2Fvn-str/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronghieu60s%2Fvn-str/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tronghieu60s","download_url":"https://codeload.github.com/tronghieu60s/vn-str/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244364559,"owners_count":20441457,"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":["javascript-library","npm","npm-package"],"created_at":"2024-10-10T09:09:56.883Z","updated_at":"2025-03-19T05:30:31.205Z","avatar_url":"https://github.com/tronghieu60s.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"*Đọc bằng ngôn ngữ khác: [English](README.md).*\r\n\r\n## Đây là gì?\r\n\r\n✂ Thư viện xử lí chuỗi Tiếng Việt.\r\n\r\n## Cài Đặt\r\n\r\nSử dụng npm:\r\n\r\n```bash\r\n$ npm install --save vn-str\r\n```\r\n\r\nSử dụng yarn:\r\n\r\n```bash\r\n$ yarn add vn-str\r\n```\r\n\r\nSử dụng CDN:\r\n\r\n```html\r\n\u003c!-- Khi sử dụng CDN bạn có thể gọi tất cả function bằng biến vnStr. --\u003e\r\n\u003cscript src=\"https://tronghieu60s.github.io/vn-str/dist/index.js\"\u003e\u003c/script\u003e\r\n```\r\n\r\n## Sử Dụng\r\n\r\n### 1. Chuyển Số Thành Chữ Tiếng Việt\r\n\r\nVí dụ:\r\n\r\n```js\r\nvar vnStr = require(\"vn-str\");\r\nvar str = vnStr.numToText(54);\r\nconsole.log(str); // =\u003e \"năm mươi tư\"\r\n```\r\n\r\n### 2. Xóa Dấu Tiếng Việt\r\n\r\nVí dụ:\r\n\r\n```js\r\nvar vnStr = require(\"vn-str\");\r\nvar str = vnStr.rmVnTones(\"Trường Sa Hoàng Sa là của Việt Nam\");\r\nconsole.log(str); // =\u003e \"Truong Sa Hoang Sa la cua Viet Nam\"\r\n```\r\n\r\n### 3. Xóa Các Ký Tự Không Phải Chữ Và Số Tiếng Việt\r\n\r\nVí dụ:\r\n\r\n```js\r\nvar vnStr = require(\"vn-str\");\r\nvar str = vnStr.rmNonAlphanumeric(\"Anh ta đã sưu tập nhiều các đồ vật kỳ lạ: trứng chim, tem, nắp chai, dây và cúc áo.\");\r\nconsole.log(str); // =\u003e \"Anh ta đã sưu tập nhiều các đồ vật kỳ lạ trứng chim tem nắp chai dây và cúc áo\"\r\n```\r\n\r\n### 4. Chuyển Chuỗi Tiếng Việt Sang Telex / VNI\r\n\r\nVí dụ:\r\n\r\n```js\r\nvar vnStr = require(\"vn-str\");\r\nvar str = \"Trường Sa, Hoàng Sa là của Việt Nam\";\r\n\r\nvar strTelex = vnStr.strToTelex(str);\r\nconsole.log(strTelex); // =\u003e \"Truwowfng Sa, Hoafng Sa laf cura Vieejt Nam\"\r\n\r\nvar strVNI = vnStr.strToVNI(str);\r\nconsole.log(strVNI); // =\u003e \"Tru7o72ng Sa, Hoa2ng Sa la2 cu3a Vie65t Nam\"\r\n```\r\n\r\n### 5. Kiểm Tra Số Điện Thoại Việt Nam\r\n\r\nVí dụ:\r\n\r\n```js\r\nvar vnStr = require(\"vn-str\");\r\nvar isVietnamesePhone = vnStr.isVietnamesePhoneNumber(\"+84957507468\");\r\nconsole.log(isVietnamesePhone); // =\u003e true\r\n```\r\n\r\n### 6. Kiểm Tra Dấu Tiếng Việt\r\n\r\nVí dụ:\r\n\r\n```js\r\nvar vnStr = require(\"vn-str\");\r\nvar isVietnameseTones = vnStr.isVietnameseTones(\"Chào em, anh đứng đây từ chiều\");\r\nconsole.log(isVietnameseTones); // =\u003e true\r\n```\r\n\r\n### 7. Kiểm Tra Câu Văn Có Từ Ngữ Xúc Phạm\r\n\r\nDữ liệu: https://github.com/blue-eyes-vn/vietnamese-offensive-words\r\n\r\nVí dụ:\r\n\r\n```js\r\nvar vnStr = require(\"vn-str\");\r\nvar hasOffensiveWords = vnStr.hasOffensiveWords(\"đây là một câu bình thường, cho đến khi thêm từ chửi bậy, đm.\");\r\nconsole.log(hasOffensiveWords); // =\u003e true\r\n```\r\n\r\n## Contributing\r\n\r\nPull requests và stars rất được hoan nghênh.\r\n\r\nĐối với bug và yêu cầu tính năng, vui lòng tạo issue.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronghieu60s%2Fvn-str","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftronghieu60s%2Fvn-str","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronghieu60s%2Fvn-str/lists"}