{"id":39402063,"url":"https://github.com/ozgurg/pad-center","last_synced_at":"2026-01-18T03:25:02.041Z","repository":{"id":41425310,"uuid":"508880835","full_name":"ozgurg/pad-center","owner":"ozgurg","description":"pad-center fills between the start and end characters with character you want while maintaining the length.","archived":false,"fork":false,"pushed_at":"2023-03-08T16:39:12.000Z","size":285,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T14:59:55.878Z","etag":null,"topics":["acikkaynak","barcode","generator","masking","pad","pad-center","pad-middle"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/pad-center","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/ozgurg.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}},"created_at":"2022-06-30T00:10:05.000Z","updated_at":"2023-05-17T11:56:45.000Z","dependencies_parsed_at":"2023-09-27T03:39:26.401Z","dependency_job_id":null,"html_url":"https://github.com/ozgurg/pad-center","commit_stats":{"total_commits":58,"total_committers":1,"mean_commits":58.0,"dds":0.0,"last_synced_commit":"aed08a28625e333f6e03bd2cb9f56b79b0bd37f5"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ozgurg/pad-center","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozgurg%2Fpad-center","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozgurg%2Fpad-center/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozgurg%2Fpad-center/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozgurg%2Fpad-center/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ozgurg","download_url":"https://codeload.github.com/ozgurg/pad-center/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozgurg%2Fpad-center/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["acikkaynak","barcode","generator","masking","pad","pad-center","pad-middle"],"created_at":"2026-01-18T03:25:01.921Z","updated_at":"2026-01-18T03:25:02.016Z","avatar_url":"https://github.com/ozgurg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Downloads](https://img.shields.io/npm/dm/pad-center)\n![Version](https://img.shields.io/github/package-json/v/ozgurg/pad-center)\n\n# pad-center\n\n`pad-center` fills between the start and end characters with character you want while maintaining the length.\nLike [padStart](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart)\nand [padEnd](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) but from\ncenter, padCenter!\n\n## Use cases\n\n- Barcode generation\n- It's not goal of the package, but you can use it for masking strings\n- _Tell me what you are using it for 🙂_\n\n## Install\n\n```shell\nnpm install pad-center\n```\n\n_This package is a [pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)._\n\n## Usage\n\n```javascript\nimport padCenter from \"pad-center\";\n\npadCenter({\n    startWith: \"053\",\n    endWith: \"0\",\n    fillWith: \"*\",\n    length: 11\n});\n// \"053*******0\"\n\npadCenter({\n    startWith: \"GH1\",\n    endWith: \"9\",\n    fillWith: \"0\",\n    length: 10\n});\n// \"GH10000009\"\n\npadCenter({\n    startWith: \"O\",\n    endWith: \"G\",\n    fillWith: \"_\",\n    length: 8\n});\n// \"O______G\"\n```\n\n## API\n\n### padCenter(params) : string\n\n#### params\n\nDefault: \u003ccode\u003e{}\u003c/code\u003e\\\nType: \u003ccode\u003eobject\u003c/code\u003e\\\nRequired: Yes\n\n#### params.startWith\n\nType: \u003ccode\u003estring | number\u003c/code\u003e\\\nRequired: Yes\n\n#### params.endWith\n\nType: \u003ccode\u003estring | number\u003c/code\u003e\\\nRequired: Yes\n\n#### params.fillWith\n\nType: \u003ccode\u003estring | number\u003c/code\u003e\\\nRequired: Yes\n\n#### params.length\n\nType: \u003ccode\u003enumber\u003c/code\u003e\\\nRequired: Yes\n\n## License\n\n[![License](https://img.shields.io/github/license/ozgurg/pad-center)](https://github.com/ozgurg/pad-center/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozgurg%2Fpad-center","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fozgurg%2Fpad-center","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozgurg%2Fpad-center/lists"}