{"_id":"@avenue3-dev/format-age","_rev":"5-a2d961df1c8bab7fd24282a577f7c9bf","name":"@avenue3-dev/format-age","dist-tags":{"latest":"0.2.4"},"versions":{"0.1.1":{"name":"@avenue3-dev/format-age","version":"0.1.1","author":{"url":"https://github.com/Avenue3-dev","name":"Avenue3"},"license":"MIT","_id":"@avenue3-dev/format-age@0.1.1","maintainers":[{"name":"amcn41r","email":"alex.mcnair@hotmail.co.uk"},{"name":"rowell.a3","email":"rowell@avenue3.com"},{"name":"graham-a3","email":"graham@avenue3.com"}],"homepage":"https://github.com/Avenue3-dev/format-age#readme","bugs":{"url":"https://github.com/Avenue3-dev/format-age/issues"},"dist":{"shasum":"ff002d0d3ed8bc6a68ac67e41bb185e793bfd9cc","tarball":"https://registry.npmjs.org/@avenue3-dev/format-age/-/format-age-0.1.1.tgz","fileCount":19,"integrity":"sha512-+s7UqXRmGGZguWZeFCipEj0/i9jt8fi2fFTYPrBjJRntUWYc3pK4F4o9Hrnv5soSIPvIT+mA/+m7+tUkLObASQ==","signatures":[{"sig":"MEYCIQDIKStc8nxyh+Itlb+1cbnJLTCCFrAvdUlVa4qvGAVu6wIhAKAByVxpZG6sOEvonrF/nj1Wp6fcOlTry9ZzC2BxzOhr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13825},"main":"index.js","_from":"file:avenue3-dev-format-age-0.1.1.tgz","private":false,"scripts":{"lint":"eslint src --ext ts,tsx,js --report-unused-disable-directives --fix","test":"vitest run","build":"rimraf dist/ && tsc --project tsconfig.build.json","format":"prettier src --write","release":"standard-version","lint:check":"eslint src --ext ts,tsx,js --report-unused-disable-directives","format:check":"prettier src --check"},"_npmUser":{"name":"graham-a3","email":"graham@avenue3.com"},"_resolved":"/tmp/f4eda198b38583f074ba8f754c1964ed/avenue3-dev-format-age-0.1.1.tgz","_integrity":"sha512-+s7UqXRmGGZguWZeFCipEj0/i9jt8fi2fFTYPrBjJRntUWYc3pK4F4o9Hrnv5soSIPvIT+mA/+m7+tUkLObASQ==","repository":{"url":"git+https://github.com/Avenue3-dev/format-age.git","type":"git"},"_npmVersion":"10.8.2","description":"A utility for formatting age","directories":{},"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","vitest":"^3.1.3","typescript":"^5.8.3","standard-version":"^9.5.0","@typescript-eslint/parser":"^7.2.0","@avenue3-dev/eslint-config":"^1.1.4","@typescript-eslint/eslint-plugin":"^7.2.0"},"_npmOperationalInternal":{"tmp":"tmp/format-age_0.1.1_1746800197624_0.9437039017447444","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@avenue3-dev/format-age","version":"0.1.0","author":{"url":"https://github.com/Avenue3-dev","name":"Avenue3"},"license":"MIT","_id":"@avenue3-dev/format-age@0.1.0","maintainers":[{"name":"amcn41r","email":"alex.mcnair@hotmail.co.uk"},{"name":"rowell.a3","email":"rowell@avenue3.com"},{"name":"graham-a3","email":"graham@avenue3.com"}],"homepage":"https://github.com/Avenue3-dev/format-age#readme","bugs":{"url":"https://github.com/Avenue3-dev/format-age/issues"},"dist":{"shasum":"5cbadfb3e56691e3dab07ca645355a014a7d8a6e","tarball":"https://registry.npmjs.org/@avenue3-dev/format-age/-/format-age-0.1.0.tgz","fileCount":13,"integrity":"sha512-9K+bciB+W+8bSD980z0kwA6EI3lPsHwD2NtsYhoT+Nyd4uVenubSwANmXmITgUAacZNBK73RX2S4D9D4L6uzvg==","signatures":[{"sig":"MEUCIGZ+Mx7gcl0FGvKrM1vkf1zAGxeVmcYoorr6kTxTx3SVAiEA8VdIimIvBVHREB5JAnSlDkznwuR8P+h/C+8kYpICc38=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9498},"main":"index.js","_from":"file:avenue3-dev-format-age-0.1.0.tgz","private":false,"scripts":{"lint":"eslint src --ext ts,tsx,js --report-unused-disable-directives --fix","test":"vitest run","build":"rimraf dist/ && tsc --project tsconfig.build.json","format":"prettier src --write","release":"standard-version","lint:check":"eslint src --ext ts,tsx,js --report-unused-disable-directives","format:check":"prettier src --check"},"_npmUser":{"name":"graham-a3","email":"graham@avenue3.com"},"_resolved":"/tmp/b925105d5b3dd31c6bd9e16ec3276142/avenue3-dev-format-age-0.1.0.tgz","_integrity":"sha512-9K+bciB+W+8bSD980z0kwA6EI3lPsHwD2NtsYhoT+Nyd4uVenubSwANmXmITgUAacZNBK73RX2S4D9D4L6uzvg==","repository":{"url":"git+https://github.com/Avenue3-dev/format-age.git","type":"git"},"_npmVersion":"10.8.2","description":"A utility for formatting age","directories":{},"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","vitest":"^3.1.3","typescript":"^5.8.3","standard-version":"^9.5.0","@typescript-eslint/parser":"^7.2.0","@avenue3-dev/eslint-config":"^1.1.4","@typescript-eslint/eslint-plugin":"^7.2.0"},"_npmOperationalInternal":{"tmp":"tmp/format-age_0.1.0_1746804505469_0.3258802371879701","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@avenue3-dev/format-age","version":"0.2.2","author":{"url":"https://github.com/Avenue3-dev","name":"Avenue3"},"license":"MIT","_id":"@avenue3-dev/format-age@0.2.2","maintainers":[{"name":"amcn41r","email":"alex.mcnair@hotmail.co.uk"},{"name":"rowell.a3","email":"rowell@avenue3.com"},{"name":"graham-a3","email":"graham@avenue3.com"}],"homepage":"https://github.com/Avenue3-dev/format-age#readme","bugs":{"url":"https://github.com/Avenue3-dev/format-age/issues"},"dist":{"shasum":"bbaf479297e8e0b87d2ec5c5756216a08aa3675a","tarball":"https://registry.npmjs.org/@avenue3-dev/format-age/-/format-age-0.2.2.tgz","fileCount":14,"integrity":"sha512-maCH6VqkMlL67NUHgVMUXA3Swf4Uhxbk8McQqEMAtXIO8WavqMr6cn6evffm47nKvnosbF7G2nbRdStNON7d+A==","signatures":[{"sig":"MEUCIQDpgGe//6KOWQIpfXx02iZ1aWVllpBTJs0oeOr9rIX32AIgXotHi/1G4Jce+61ngnYwDr5ZbRsKXdzXM5DJTB2t9Ts=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11863},"main":"index.js","_from":"file:avenue3-dev-format-age-0.2.2.tgz","private":false,"scripts":{"lint":"eslint src --ext ts,tsx,js --report-unused-disable-directives --fix","test":"vitest run","build":"rimraf dist/ && tsc --project tsconfig.build.json","format":"prettier src --write","release":"standard-version","lint:check":"eslint src --ext ts,tsx,js --report-unused-disable-directives","format:check":"prettier src --check"},"_npmUser":{"name":"graham-a3","email":"graham@avenue3.com"},"_resolved":"/tmp/066c16ed68ec41e039c4bdc00ebeefb9/avenue3-dev-format-age-0.2.2.tgz","_integrity":"sha512-maCH6VqkMlL67NUHgVMUXA3Swf4Uhxbk8McQqEMAtXIO8WavqMr6cn6evffm47nKvnosbF7G2nbRdStNON7d+A==","repository":{"url":"git+https://github.com/Avenue3-dev/format-age.git","type":"git"},"_npmVersion":"10.8.2","description":"A utility for formatting age","directories":{},"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","rimraf":"^6.0.1","vitest":"^3.1.3","typescript":"^5.8.3","@commitlint/cli":"^19.8.1","standard-version":"^9.5.0","@typescript-eslint/parser":"^7.2.0","@avenue3-dev/eslint-config":"^1.1.4","@commitlint/config-conventional":"^19.8.1","@typescript-eslint/eslint-plugin":"^7.2.0"},"_npmOperationalInternal":{"tmp":"tmp/format-age_0.2.2_1746810989883_0.6455961758855402","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@avenue3-dev/format-age","version":"0.2.3","author":{"url":"https://github.com/Avenue3-dev","name":"Avenue3"},"license":"MIT","_id":"@avenue3-dev/format-age@0.2.3","maintainers":[{"name":"amcn41r","email":"alex.mcnair@hotmail.co.uk"},{"name":"rowell.a3","email":"rowell@avenue3.com"},{"name":"graham-a3","email":"graham@avenue3.com"}],"homepage":"https://github.com/Avenue3-dev/format-age#readme","bugs":{"url":"https://github.com/Avenue3-dev/format-age/issues"},"dist":{"shasum":"54e49c344926d57f4705e0cbf730f2d72128ff4a","tarball":"https://registry.npmjs.org/@avenue3-dev/format-age/-/format-age-0.2.3.tgz","fileCount":14,"integrity":"sha512-99i13dN3wOHP7df1edj8WJbKgHrX3xvTUbCVgJUfOsIs9FmkDenMsHY0RGaS42qG9N3i0x+dioNEY1wbIUdIKg==","signatures":[{"sig":"MEQCIEcx0OlbMQZxm2wN8k51yW6VVlPn/z3iJ81rY8BdmvovAiAD2TWY1CcjKL8A+E0lP8zLzHFPBTs30+Uev3EwW+aibA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11956},"main":"index.js","_from":"file:avenue3-dev-format-age-0.2.3.tgz","private":false,"scripts":{"lint":"eslint src --ext ts,tsx,js --report-unused-disable-directives --fix","test":"vitest run","build":"rimraf dist/ && tsc --project tsconfig.build.json","format":"prettier src --write","release":"standard-version","lint:check":"eslint src --ext ts,tsx,js --report-unused-disable-directives","format:check":"prettier src --check"},"_npmUser":{"name":"graham-a3","email":"graham@avenue3.com"},"_resolved":"/tmp/31795fef34ee549308bf33c9daba3113/avenue3-dev-format-age-0.2.3.tgz","_integrity":"sha512-99i13dN3wOHP7df1edj8WJbKgHrX3xvTUbCVgJUfOsIs9FmkDenMsHY0RGaS42qG9N3i0x+dioNEY1wbIUdIKg==","repository":{"url":"git+https://github.com/Avenue3-dev/format-age.git","type":"git"},"_npmVersion":"10.8.2","description":"A utility for formatting age","directories":{},"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","rimraf":"^6.0.1","vitest":"^3.1.3","typescript":"^5.8.3","@commitlint/cli":"^19.8.1","standard-version":"^9.5.0","@typescript-eslint/parser":"^7.2.0","@avenue3-dev/eslint-config":"^1.1.4","@commitlint/config-conventional":"^19.8.1","@typescript-eslint/eslint-plugin":"^7.2.0"},"_npmOperationalInternal":{"tmp":"tmp/format-age_0.2.3_1746811249151_0.6348594379828292","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@avenue3-dev/format-age","version":"0.2.4","main":"dist/index.js","author":{"name":"Avenue3","url":"https://github.com/Avenue3-dev"},"repository":{"type":"git","url":"git+https://github.com/Avenue3-dev/format-age.git"},"license":"MIT","description":"A utility for formatting age","private":false,"devDependencies":{"@avenue3-dev/eslint-config":"^1.1.4","@commitlint/cli":"^19.8.1","@commitlint/config-conventional":"^19.8.1","@typescript-eslint/eslint-plugin":"^7.2.0","@typescript-eslint/parser":"^7.2.0","husky":"^9.1.7","rimraf":"^6.0.1","standard-version":"^9.5.0","typescript":"^5.8.3","vitest":"^3.1.3"},"scripts":{"release":"standard-version","build":"rimraf dist/ && tsc --project tsconfig.build.json","test":"vitest run","lint":"eslint src --ext ts,tsx,js --report-unused-disable-directives --fix","lint:check":"eslint src --ext ts,tsx,js --report-unused-disable-directives","format":"prettier src --write","format:check":"prettier src --check"},"_id":"@avenue3-dev/format-age@0.2.4","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/Avenue3-dev/format-age/issues"},"homepage":"https://github.com/Avenue3-dev/format-age#readme","_integrity":"sha512-Ae8TF14pbCYbKE5lNk2dZl+GH8ZYOiR9sD7VHUV5LGLx73tgHxCglNqblj0E2jsF+kuMmjR0bDn2dIm12SRRmg==","_resolved":"/tmp/9977a6341b8173b029e6e8748889925c/avenue3-dev-format-age-0.2.4.tgz","_from":"file:avenue3-dev-format-age-0.2.4.tgz","_nodeVersion":"20.19.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Ae8TF14pbCYbKE5lNk2dZl+GH8ZYOiR9sD7VHUV5LGLx73tgHxCglNqblj0E2jsF+kuMmjR0bDn2dIm12SRRmg==","shasum":"4fb33d2290e6d25fc41d83091750a4fc8aea4d46","tarball":"https://registry.npmjs.org/@avenue3-dev/format-age/-/format-age-0.2.4.tgz","fileCount":14,"unpackedSize":12215,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFrFX+Ka6zmZ5NBkfaImAFzBO3lCwqCSOjKeDydRgS+1AiEA8RCyD8qY4i4Kl/b4JuodYdzlpII/h0Zplgdmxxdfvi0="}]},"_npmUser":{"name":"graham-a3","email":"graham@avenue3.com"},"directories":{},"maintainers":[{"name":"amcn41r","email":"alex.mcnair@hotmail.co.uk"},{"name":"rowell.a3","email":"rowell@avenue3.com"},{"name":"graham-a3","email":"graham@avenue3.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/format-age_0.2.4_1746811496606_0.7076602437603317"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-09T14:16:37.548Z","modified":"2025-05-09T17:24:57.025Z","0.1.1":"2025-05-09T14:16:37.805Z","0.1.0":"2025-05-09T15:28:25.695Z","0.2.2":"2025-05-09T17:16:30.127Z","0.2.3":"2025-05-09T17:20:49.376Z","0.2.4":"2025-05-09T17:24:56.786Z"},"bugs":{"url":"https://github.com/Avenue3-dev/format-age/issues"},"author":{"name":"Avenue3","url":"https://github.com/Avenue3-dev"},"license":"MIT","homepage":"https://github.com/Avenue3-dev/format-age#readme","repository":{"type":"git","url":"git+https://github.com/Avenue3-dev/format-age.git"},"description":"A utility for formatting age","maintainers":[{"name":"amcn41r","email":"alex.mcnair@hotmail.co.uk"},{"name":"rowell.a3","email":"rowell@avenue3.com"},{"name":"graham-a3","email":"graham@avenue3.com"}],"readme":"<p align=\"center\"><img alt=\"ESLint logo\" src=\"https://avatars.githubusercontent.com/u/132620081?s=200&v=4\" width=\"60\" /></p>\n\n<h1 align=\"center\">@avenue3-dev/format-age</h1>\n<p align=\"center\">   \n  <a href=\"https://github.com/@avenue3-dev/format-age/blob/master/LICENSE\">\n    <img src=\"https://img.shields.io/npm/l/@avenue3-dev/format-age?style=flat-square\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/@avenue3-dev/format-age\">\n    <img src=\"https://img.shields.io/npm/v/@avenue3-dev/format-age?style=flat-square\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/eslint-config-gbx\">\n    <img src=\"https://img.shields.io/npm/dw/@avenue3-dev/format-age?style=flat-square\" />\n  </a>\n</p>\n\n`format-age` is a tiny, dependency-free package for formatting age in clinical or health-related contexts. It displays age with appropriate granularity for different life stages—down to minutes for newborns and more concise formats for older individuals.\n\n### Examples\n\n- `21y` – 21 years\n- `2y 2m` – 2 years, 2 months\n- `21m 29d` – 21 months, 29 days\n- `30w 4d` – 30 weeks, 4 days\n- `26d` – 26 days\n- `30mins` – 30 minutes\n\n## Install\n\n`format-age` is available as an npm package can be installed with one of the following commands:\n\n<details> \n  <summary>\n    <strong>npm</strong>\n  </summary>\n\n```bash\nnpm install @avenue3-dev/format-age\n```\n\n</details>\n\n<details>\n  <summary>\n    <strong>pnpm</strong>\n  </summary>\n\n```bash\npnpm add @avenue3-dev/format-age\n```\n\n</details>\n\n## Example\n\n```js\n// Birth date as a Date object\nformatAge(new Date('2003-05-09'));\n// → '21y'\n\n// Birth date ISO 8601 string input\nformatAge('2022-03-01');\n// → '2y 2m'\n\n// Calculating relative age or age of death\nformatAge(new Date('2002-03-01'), new Date('2022-03-01'));\n// → '20y'\n```\n\n## Changelog\n\nCheck out our [changelog](./CHANGELOG.md) for key highlights, performance improvements, new features, and notable bugfixes.\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md"}