{"id":23091560,"url":"https://github.com/chopinsky/pad-string","last_synced_at":"2025-04-03T18:18:25.511Z","repository":{"id":57317915,"uuid":"101527628","full_name":"Chopinsky/pad-string","owner":"Chopinsky","description":"NPM module to adding padding to a string to a certain length.","archived":false,"fork":false,"pushed_at":"2017-10-06T00:02:20.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T14:49:35.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Chopinsky.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}},"created_at":"2017-08-27T03:35:27.000Z","updated_at":"2017-08-27T03:43:02.000Z","dependencies_parsed_at":"2022-08-25T20:40:27.620Z","dependency_job_id":null,"html_url":"https://github.com/Chopinsky/pad-string","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/Chopinsky%2Fpad-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chopinsky%2Fpad-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chopinsky%2Fpad-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chopinsky%2Fpad-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chopinsky","download_url":"https://codeload.github.com/Chopinsky/pad-string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247052620,"owners_count":20875685,"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-16T21:18:39.559Z","updated_at":"2025-04-03T18:18:25.480Z","avatar_url":"https://github.com/Chopinsky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pad String\nThis project creates a NPM module to help faciliting addition of string paddings to extend a string to a certain length.\n\n## Install\n```\nnpm install pad-string --save\n```\nThen in your code, import the function you would like to use:\n```\nimport { padStart, padEnd, padBothEnds } from 'pad-string'\nvar str1 = padStart('test', 10)         // str1 = '      test'\nvar str2 = padEnd('test', 10, 'er')     // str2 = 'testererer'\nvar str3 = padBothEnds('test', 10, 'a') // str3 = 'aaatestaaa'\n```\n\n## How to use it\nThe package provides 3 functions: `padStart(targetString, targetLength[, fillerString])`, `padEnd(targetString, targetLength[, fillerString])`, and `padBothEnds(targetString, targetLength[, fillerString])`.\n\n- targetString: input string to add padding to.\n- targetLength: the final length the string will be padded to. If this length is smaller or equal to the target string length, then we will return the target string.\n- fillerString (optional): the string to fill the padding. If provided, the filler string will repeat itself until padding the target string to the target length; if not provided, the padding will be filled with white space. \n\n## PR Welcome\nPlease feel free to submit PR. Let's make the string padding great again!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchopinsky%2Fpad-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchopinsky%2Fpad-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchopinsky%2Fpad-string/lists"}