{"id":18488408,"url":"https://github.com/arvindkumarbadwal/calculate-age","last_synced_at":"2026-04-29T19:31:33.159Z","repository":{"id":57192800,"uuid":"332999769","full_name":"arvindkumarbadwal/calculate-age","owner":"arvindkumarbadwal","description":"This package is use to calculate age of a given date of birth.","archived":false,"fork":false,"pushed_at":"2023-04-08T18:29:20.000Z","size":92,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T05:05:21.093Z","etag":null,"topics":["age","calculate","calculate-age","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/calculate-age","language":"TypeScript","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/arvindkumarbadwal.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-26T07:02:38.000Z","updated_at":"2023-04-08T18:29:06.000Z","dependencies_parsed_at":"2024-11-06T12:57:32.242Z","dependency_job_id":"517b23f8-09eb-4283-bc03-cd039edea98a","html_url":"https://github.com/arvindkumarbadwal/calculate-age","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/arvindkumarbadwal/calculate-age","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvindkumarbadwal%2Fcalculate-age","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvindkumarbadwal%2Fcalculate-age/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvindkumarbadwal%2Fcalculate-age/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvindkumarbadwal%2Fcalculate-age/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arvindkumarbadwal","download_url":"https://codeload.github.com/arvindkumarbadwal/calculate-age/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arvindkumarbadwal%2Fcalculate-age/sbom","scorecard":{"id":210315,"data":{"date":"2025-08-11","repo":{"name":"github.com/arvindkumarbadwal/calculate-age","commit":"c5244b951b14c4d5400d26623efe5f439c92e455"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T00:39:15.554Z","repository_id":57192800,"created_at":"2025-08-17T00:39:15.554Z","updated_at":"2025-08-17T00:39:15.554Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32440845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["age","calculate","calculate-age","nodejs"],"created_at":"2024-11-06T12:51:41.971Z","updated_at":"2026-04-29T19:31:33.142Z","avatar_url":"https://github.com/arvindkumarbadwal.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# calculate-age\n\nThis package is use to calculate age of a given date of birth.\n\n![npm](https://img.shields.io/npm/v/calculate-age?style=for-the-badge)\n![npm](https://img.shields.io/npm/dt/calculate-age?style=for-the-badge)\n\n## Installation\n\n```sh\nnpm install calculate-age\n```\n\n## Using \n\nFunction Parameter\n```js\n    calculateAge(dateOfBirth: string | Date, compareDate?: string | Date)\n```\n\nExample\n```js\nimport calculateAge from 'calculate-age'\n// OR const calculateAge = require('calculate-age').default\n\nconst output = calculateAge('1988-10-26', '2021-01-26').getObject()\n// output: { years: 32, months: 3, days: 10 }\n\nconst output = calculateAge('1988-10-26', '2021-01-26').getString()\n// output: 32 years 3 months\n```\n\n## Output\n```js\ngetObject() --\u003e getString()\n// { years: 5, months: 3, days: 2 } --\u003e 5 years 3 months\n// { years: 5, months: 0, days: 0 } --\u003e 5 years\n// { years: 0, months: 3, days: 2 } --\u003e 3 months 2 days\n// { years: 0, months: 3, days: 0 } --\u003e 3 months\n// { years: 0, months: 0, days: 2 } --\u003e 2 days\n\n// { years: 1, months: 2, days: 0 } --\u003e 1 year 2 months\n// { years: 1, months: 0, days: 0 } --\u003e 1 year\n// { years: 0, months: 1, days: 2 } --\u003e 1 month 2 days\n// { years: 0, months: 1, days: 0 } --\u003e 1 month\n// { years: 0, months: 0, days: 1 } --\u003e 1 day\n```\n## Release Notes - Version 1.0.0\n\n### Features\n\n- Added TypeScript support to the package.\n- Changed from class-based to function-based implementation for `calculateAge` method, removing the need for `new` keyword.\n- Made `compareDate` optional in `calculateAge` method, defaulting it to today's date.\n\n\n## Contributing\n\nIf you find a bug or willing to add some enhancement, pull requests are very welcome\n\n## :copyright: License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farvindkumarbadwal%2Fcalculate-age","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farvindkumarbadwal%2Fcalculate-age","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farvindkumarbadwal%2Fcalculate-age/lists"}