{"id":25414042,"url":"https://github.com/daiz/zpad","last_synced_at":"2025-04-22T14:26:52.228Z","repository":{"id":13475799,"uuid":"16165896","full_name":"Daiz/zpad","owner":"Daiz","description":"A Node.js module for zero padding numbers and strings, because I got tired of copypasting this function everywhere.","archived":false,"fork":false,"pushed_at":"2014-01-23T13:15:24.000Z","size":204,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T10:07:14.876Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"LiveScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Daiz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-23T07:49:46.000Z","updated_at":"2019-07-30T11:34:26.000Z","dependencies_parsed_at":"2022-09-10T13:40:59.770Z","dependency_job_id":null,"html_url":"https://github.com/Daiz/zpad","commit_stats":null,"previous_names":["daiz-/zpad"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daiz%2Fzpad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daiz%2Fzpad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daiz%2Fzpad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daiz%2Fzpad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daiz","download_url":"https://codeload.github.com/Daiz/zpad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250257809,"owners_count":21400801,"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":"2025-02-16T14:35:08.755Z","updated_at":"2025-04-22T14:26:52.207Z","avatar_url":"https://github.com/Daiz.png","language":"LiveScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zpad - Zero padding for Node.js\n\n*zpad* is a tiny Node.js module for zero padding strings and numbers, because I got tired of copypasting a function for this in every other thing I've been writing.\n\n## Installation\n\n*zpad* is available via npm:\n\n```bash\n$ npm install zpad\n```\n\n## Usage\n\n```javascript\nvar zpad = require('zpad');\nzpad(5);             // -\u003e \"05\", zpad pads to 2 digits by default\nzpad(5, 3);          // -\u003e \"005\", you can pass a second parameter to specify the amount of digits\nzpad.amount(3);      // change the default padding amount by calling zpad.amount with a number\nzpad.amount();       // -\u003e 3, returns the padding amount with no arguments\nzpad(5);             // -\u003e \"005\"\nzpad.character('X'); // change what is used for padding by calling zpad.character with a string\nzpad.character();    // -\u003e \"X\", returns the padding character with no arguments\nzpad(5);             // -\u003e \"XX5\"\nzpad(5, 3, 'Z');     // -\u003e \"ZZ5\", you can also pass custom pad character as third parameter\n\n// .amount and .character can also be chained, allowing you to define them when loading the module\nvar pad = require('zpad').amount(4).character('Y');\npad(5);              // -\u003e \"YYY5\"\n```\n\n## Legalese\n\nNo Rights Reserved, *zpad* has been released under [CC0](http://creativecommons.org/publicdomain/zero/1.0/). Feel free to use it in any manner you want.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaiz%2Fzpad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaiz%2Fzpad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaiz%2Fzpad/lists"}