{"id":22865546,"url":"https://github.com/tecfu/breakword","last_synced_at":"2025-05-05T15:18:14.539Z","repository":{"id":20863900,"uuid":"91137814","full_name":"tecfu/breakword","owner":"tecfu","description":"Get index of character after which variable 'word' must be broken given variable 'length' (accounts for wide characters). https://www.npmjs.com/package/breakword","archived":false,"fork":false,"pushed_at":"2023-05-30T07:49:38.000Z","size":491,"stargazers_count":0,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-28T22:15:28.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/tecfu.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-12T23:58:17.000Z","updated_at":"2023-05-30T07:49:43.000Z","dependencies_parsed_at":"2024-06-18T23:59:59.703Z","dependency_job_id":"701a7709-7ea3-4074-a7e3-51f19fb5b8d8","html_url":"https://github.com/tecfu/breakword","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":"0.11764705882352944","last_synced_commit":"ca0500fa17ac3bc1ddb90a05908a0b5bf27e2a4e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecfu%2Fbreakword","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecfu%2Fbreakword/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecfu%2Fbreakword/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecfu%2Fbreakword/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tecfu","download_url":"https://codeload.github.com/tecfu/breakword/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229538525,"owners_count":18088898,"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-12-13T11:37:35.577Z","updated_at":"2024-12-13T11:37:36.287Z","avatar_url":"https://github.com/tecfu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# breakword\n\nGet index i.e. 0,1,2,... of the character where a word must be broken given it must\nbe wrapped within a certain length of spaces. \n\nUseful because javascript's String.length does not reflect the true width of emojis and wide characters.\n\n## Installation\n\n```\nnpm install breakword \n```\n\n## Examples\n\n1. To find the index of the character to break after if we want to limit our characters fit on a line 3 spaces wide.\n\n```js\nconst Breakword = require (\"breakword\");\nconst word = \"打破我的角色三\";\nconst breakIndex = Breakword(word,3); \nconsole.log(breakIndex) //0\n```\nThe result here - 0 - means all the characters before index 0 (in this case only the character 打) can fit in a line 3 spaces long.\n\n## Test\n\n```bash\nnpm test\n```\n\n- Save new test results to test/test.json\n\n```bash\nnpm --save run test\n```\n\n- Display test outputs only\n\n```bash\nnpm --display run test\n```\n\n## Build\n\n```bash\nnpm run-script build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecfu%2Fbreakword","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftecfu%2Fbreakword","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecfu%2Fbreakword/lists"}