{"_id":"@cafeine-software/padcenter","_rev":"8-beb6857770862205478cc9b808a0599a","name":"@cafeine-software/padcenter","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@cafeine-software/padcenter","version":"1.0.0","author":"","license":"ISC","_id":"@cafeine-software/padcenter@1.0.0","maintainers":[{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"}],"homepage":"https://github.com/Cafeine-Software/padCenter#readme","bugs":{"url":"https://github.com/Cafeine-Software/padCenter/issues"},"dist":{"shasum":"64219570dff633db5bc4cc6da374aac2e118a853","tarball":"https://registry.npmjs.org/@cafeine-software/padcenter/-/padcenter-1.0.0.tgz","fileCount":3,"integrity":"sha512-b2r91p++DSU+YqCIVZptFlUMmN+nOWiSIbqS3GTCLwUEOw0/yDIrnX0rR4i+3QyQBIDV2sk+R3+Jhuskg7b57w==","signatures":[{"sig":"MEUCIQC6O/mlYV7yGzKwwsVl4sXXGQGatupMBHagAWVoy0fazwIgbCgOEZqIMQJGmDubIqDYsYYRQnr5LDRYz4QYn5njKaE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3781},"main":"index.js","type":"module","gitHead":"7cdee60ee6ea05df6d01feefbfa38772c74d2be4","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"},"repository":{"url":"git+https://github.com/Cafeine-Software/padCenter.git","type":"git"},"_npmVersion":"11.7.0","description":"Npm package padCenter","directories":{},"_nodeVersion":"25.2.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/padcenter_1.0.0_1769371329859_0.7892313513563618","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@cafeine-software/padcenter","version":"1.0.1","keywords":["pad","center","string","utility","cafeine-software"],"author":{"name":"Quentin Lamamy","email":"contact@quentin-lamamy.fr"},"license":"CC_BY-SA 4.0","_id":"@cafeine-software/padcenter@1.0.1","maintainers":[{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"}],"homepage":"https://github.com/Cafeine-Software/padCenter#readme","bugs":{"url":"https://github.com/Cafeine-Software/padCenter/issues"},"dist":{"shasum":"44ba7759b665d82a45956001c3cc87699973bd76","tarball":"https://registry.npmjs.org/@cafeine-software/padcenter/-/padcenter-1.0.1.tgz","fileCount":3,"integrity":"sha512-uc9yc6wyWGTQg1k9h3Z7yrt+PT5c+6fYBnTayiTmMc1QEDJenzpHmV71tul+863vFUWSuyn5GcVevVP3OPDgbg==","signatures":[{"sig":"MEYCIQCdotyBl4Of1Eo4cxh0puLf6x2AMdu9hcakFkOCpPF/PQIhALTf75wvvQueIou0t+leIjCAkkDisbyDh9VKB36zqsbZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4271},"main":"index.js","type":"module","gitHead":"777c0e19d45594f71ee50d32578d5cad06cdc398","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"},"repository":{"url":"git+https://github.com/Cafeine-Software/padCenter.git","type":"git"},"_npmVersion":"11.7.0","description":"A lightweight utility to pad and center strings within a given width","directories":{},"_nodeVersion":"25.2.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/padcenter_1.0.1_1769372158868_0.42850976099146276","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@cafeine-software/padcenter","version":"1.0.2","keywords":["pad","center","string","utility","cafeine-software"],"author":{"name":"Quentin Lamamy","email":"contact@quentin-lamamy.fr"},"license":"CC_BY-SA 4.0","_id":"@cafeine-software/padcenter@1.0.2","maintainers":[{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"}],"homepage":"https://github.com/Cafeine-Software/padCenter#readme","bugs":{"url":"https://github.com/Cafeine-Software/padCenter/issues"},"dist":{"shasum":"f434e70302d852ed47647a5ad2b79f7b9f4f076d","tarball":"https://registry.npmjs.org/@cafeine-software/padcenter/-/padcenter-1.0.2.tgz","fileCount":3,"integrity":"sha512-gGFjAdw9si2CcJx8oIm1kzgGE9fCdDHAx8qS9oVLKp36kc6yb4yDRTE4dKFUkKqzvfNKUTtBqfaEDs1jw1+A/w==","signatures":[{"sig":"MEQCIH2tr5LGjk1feCljtxt3mb3DwybMoD6pG/EJvET/yv1CAiBq/81PKwVyNez+lm2M8A+ee7OLOag331vyEiH9WGHr9A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4287},"main":"index.js","type":"module","gitHead":"63360416abef21112b196d266889848b27417d98","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"},"repository":{"url":"git+https://github.com/Cafeine-Software/padCenter.git","type":"git"},"_npmVersion":"11.7.0","description":"A lightweight utility to pad and center strings within a given width","directories":{},"_nodeVersion":"25.2.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/padcenter_1.0.2_1769372672586_0.3121565335003831","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@cafeine-software/padcenter","version":"1.0.3","keywords":["pad","center","string","utility","cafeine-software"],"author":{"name":"Quentin Lamamy","email":"contact@quentin-lamamy.fr"},"license":"CC_BY-SA 4.0","_id":"@cafeine-software/padcenter@1.0.3","maintainers":[{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"}],"homepage":"https://github.com/Cafeine-Software/padCenter#readme","bugs":{"url":"https://github.com/Cafeine-Software/padCenter/issues"},"dist":{"shasum":"df70ccb84a74d2ef94a201700a3e97b554b48452","tarball":"https://registry.npmjs.org/@cafeine-software/padcenter/-/padcenter-1.0.3.tgz","fileCount":5,"integrity":"sha512-3O/wqya+0PaVi8dCzhYpO3NL1LVwKB/RGR1IEEy8DFnP1FOq10EiLY0KQ8YY8QBMB4cIDq0xAt9x8eT90Vwpgw==","signatures":[{"sig":"MEQCIFuscd6kqDLcOgK/dhzSen2u5q1W9g5jRcRHqHSxvQzbAiAo0yjJyUrVGZWftTWCULzv9Atdho8V5Sn+XlTj3l7xlA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68482},"main":"src/index.js","type":"module","gitHead":"a7866e0ef9f69822a8e2b8b6b670729c101b6793","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"},"repository":{"url":"git+https://github.com/Cafeine-Software/padCenter.git","type":"git"},"_npmVersion":"11.7.0","description":"A lightweight utility to pad and center strings within a given width","directories":{},"_nodeVersion":"25.2.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/padcenter_1.0.3_1771824349198_0.06982821189962274","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@cafeine-software/padcenter","version":"1.0.4","keywords":["pad","center","string","utility","cafeine-software"],"author":{"name":"Quentin Lamamy","email":"contact@quentin-lamamy.fr"},"license":"CC_BY-SA 4.0","_id":"@cafeine-software/padcenter@1.0.4","maintainers":[{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"}],"homepage":"https://github.com/Cafeine-Software/padCenter#readme","bugs":{"url":"https://github.com/Cafeine-Software/padCenter/issues"},"dist":{"shasum":"a4af73b664cb7ccaac264bbff10e91ce09b0edac","tarball":"https://registry.npmjs.org/@cafeine-software/padcenter/-/padcenter-1.0.4.tgz","fileCount":5,"integrity":"sha512-xucf8wVHAZCK9wtkdP7Rvo1HxHhSXLu6vC2ITRUX551RBsJ/iGPDg90lUCTThYy9IYT3JmCqGSahXv3j6lF7FQ==","signatures":[{"sig":"MEYCIQDleWSHaJfmTXByCIXVOJc1UT7qSrAhh4UWJaKS+RdYGgIhALIRYslV7GYeQSdcnnuP5mcAgEOfupUxlfLuua3ouNtE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68380},"main":"src/index.js","type":"module","gitHead":"160a1df25e90fc17f0ebd684f298a09c1ff4bb5f","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"},"repository":{"url":"git+https://github.com/Cafeine-Software/padCenter.git","type":"git"},"_npmVersion":"11.7.0","description":"A lightweight utility to pad and center strings within a given width","directories":{},"_nodeVersion":"25.2.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/padcenter_1.0.4_1771824531279_0.10723523057719109","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@cafeine-software/padcenter","version":"1.0.5","keywords":["pad","center","string","utility","cafeine-software"],"author":{"name":"Quentin Lamamy","email":"contact@quentin-lamamy.fr"},"license":"MPL-2.0","_id":"@cafeine-software/padcenter@1.0.5","maintainers":[{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"}],"homepage":"https://github.com/Cafeine-Software/padCenter#readme","bugs":{"url":"https://github.com/Cafeine-Software/padCenter/issues"},"dist":{"shasum":"e28098b4f27d158badc2b286c7d04d9c7309479e","tarball":"https://registry.npmjs.org/@cafeine-software/padcenter/-/padcenter-1.0.5.tgz","fileCount":4,"integrity":"sha512-zON/2jzmOgy75r7wQnDpoSjuLcb0EmOq3LpBCT7/i30HPcL+VP8/ktnc5tZWR2SSvrrsqNi/sBaAl5EBr4UsFg==","signatures":[{"sig":"MEUCIC48oTCuDnpwEs592V0qrQFMt8zc1JkjxZ/ZwXWrg985AiEA6mP16t5NuvU8O8LLXVnTl+GuIOFXKVlw2uinQsEosVw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21670},"main":"index.js","type":"module","gitHead":"d0c63c0ab262746f92a84319c11013218dbb12c8","scripts":{"test":"node --test"},"_npmUser":{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"},"repository":{"url":"git+https://github.com/Cafeine-Software/padCenter.git","type":"git"},"_npmVersion":"11.12.1","description":"A lightweight utility to pad and center strings within a given width","directories":{},"_nodeVersion":"25.9.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/padcenter_1.0.5_1787017905762_0.021494703748099697","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@cafeine-software/padcenter","version":"1.0.6","description":"A lightweight utility to pad and center strings within a given width","homepage":"https://github.com/Cafeine-Software/padCenter#readme","bugs":{"url":"https://github.com/Cafeine-Software/padCenter/issues"},"repository":{"type":"git","url":"git+https://github.com/Cafeine-Software/padCenter.git"},"license":"MPL-2.0","author":{"name":"Quentin Lamamy","email":"contact@quentin-lamamy.fr"},"type":"module","main":"index.js","scripts":{"test":"node --test"},"keywords":["pad","center","string","utility","cafeine-software"],"gitHead":"d1d850e7fe2ee870de76444b847e2ff89309e1a2","_id":"@cafeine-software/padcenter@1.0.6","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-s12saWuCeKH4K8CI/Lo5XeEEjnmRyDlw7vafDekePBAEPrxkHfJf5t6ieiH+PvsG3EllCiAATHMPqi3x8F/NZA==","shasum":"1fbf5a1b71e0aa46e3e114a823d3925359b89e2e","tarball":"https://registry.npmjs.org/@cafeine-software/padcenter/-/padcenter-1.0.6.tgz","fileCount":4,"unpackedSize":21726,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCNgVMxqiQ/fql5lqxHSb1Czc0aLwQPExBHFl8jy07CKAIhAI85ZNX1fuEQY+Q23OCTArb2W4lCyq/0beujH3yOonvQ"}]},"_npmUser":{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"},"directories":{},"maintainers":[{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/padcenter_1.0.6_1787019098022_0.7123552702231102"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-25T20:02:09.858Z","modified":"2026-08-18T02:11:38.345Z","1.0.0":"2026-01-25T20:02:09.993Z","1.0.1":"2026-01-25T20:15:59.028Z","1.0.2":"2026-01-25T20:24:32.730Z","1.0.3":"2026-02-23T05:25:49.382Z","1.0.4":"2026-02-23T05:28:51.458Z","1.0.5":"2026-08-18T01:51:45.908Z","1.0.6":"2026-08-18T02:11:38.182Z"},"bugs":{"url":"https://github.com/Cafeine-Software/padCenter/issues"},"author":{"name":"Quentin Lamamy","email":"contact@quentin-lamamy.fr"},"license":"MPL-2.0","homepage":"https://github.com/Cafeine-Software/padCenter#readme","keywords":["pad","center","string","utility","cafeine-software"],"repository":{"type":"git","url":"git+https://github.com/Cafeine-Software/padCenter.git"},"description":"A lightweight utility to pad and center strings within a given width","maintainers":[{"name":"quentin_lamamy","email":"contact@quentin-lamamy.fr"}],"readme":"<div align=\"center\">\n\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"media/wideLogo_white.webp\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"media/wideLogo_dark.webp\">\n  <img alt=\"PadCenter\" src=\"media/wideLogo_dark.webp\">\n</picture>\n\n[![NodeJS Badge](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en)[![Npm Badge](https://img.shields.io/badge/npm-red?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cafeine-software/padcenter)\n\n<hr/>\n\n[Introduction](#Introduction) • [Installation](#Installation) • [Usage](#Usage) • [License](#License) • [Author](#Author)<hr/>\n\n</div>\n\n<br/>\n\n# Introduction\n\nA lightweight utility to pad and center strings within a given width\n\n# Installation\n\n```bash\nnpm install @cafeine-software/padcenter\n```\n\n# Usage\n\n```javascript\nimport { padCenter } from '@cafeine-software/padcenter';\n\n// Basic centering with spaces\npadCenter('hello', 11);\n// => '   hello   '\n\n// Custom padding character\npadCenter('hello', 11, '*');\n// => '***hello***'\n\n// Odd width distribution\npadCenter('test', 9);\n// => '  test   '\n```\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `str` | `string` | - | The string to pad (required) |\n| `width` | `number` | - | The final width (required) |\n| `char` | `string` | `' '` | The padding character (optional) |\n\n## Returns\n\n- `string` - The padded and centered string\n\n## Throws\n\n- `Error` - If `str` is not a valid string\n- `Error` - If `width` is not a finite number\n- `Error` - If `width` is not an integer\n- `Error` - If `char` is not a string\n- `Error` - If `char` is not a single character\n\n## Edge Cases\n\n- If the string length is greater than or equal to the width, the original string is returned unchanged\n- When padding is odd, the extra character is added to the end\n\n# Changelog\n\n- 18/08/2026 : v1.0.5 — Fixed validation order, added integer check for width, aligned license to MPL-2.0, flattened project structure, and expanded test coverage\n\n# License\n\n[![Licence](https://img.shields.io/badge/MPL%202.0-00d230?style=for-the-badge&logo=mozilla&logoColor=white)](https://www.mozilla.org/en-US/MPL/2.0/)\n\n# Author\n\n[<img src=\"https://raw.githubusercontent.com/quentinlamamy/quentinlamamy/b88fe446526c98aac889c6b21611a59c41bcbc3d/media/quentinDino_opti.svg\" height=80/>](https://github.com/quentinlamamy)","readmeFilename":"README.md"}