{"id":13605868,"url":"https://github.com/lukeed/fromnow","last_synced_at":"2025-10-09T18:23:38.740Z","repository":{"id":22229605,"uuid":"25562629","full_name":"lukeed/fromnow","owner":"lukeed","description":"A tiny (339B) utility for human-readable time differences between now and past or future dates.","archived":false,"fork":false,"pushed_at":"2019-07-08T19:03:15.000Z","size":38,"stargazers_count":188,"open_issues_count":2,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-09T18:23:32.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukeed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-22T05:02:50.000Z","updated_at":"2025-06-25T16:11:51.000Z","dependencies_parsed_at":"2022-08-20T10:50:16.938Z","dependency_job_id":null,"html_url":"https://github.com/lukeed/fromnow","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/lukeed/fromnow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Ffromnow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Ffromnow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Ffromnow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Ffromnow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/fromnow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Ffromnow/sbom","scorecard":{"id":604467,"data":{"date":"2022-08-15","repo":{"name":"github.com/lukeed/fromnow","commit":"17eedf89d56696f79f0688e06e86db87dcce1b64"},"scorecard":{"version":"v4.5.0-26-g10b6052","commit":"10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93"},"score":4.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) out of 30 and 0 issue activity out of 6 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/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"GitHub code reviews found for 1 commits out of the last 30 -- score normalized to 0","details":["Warn: no reviews found for commit: 17eedf89d56696f79f0688e06e86db87dcce1b64","Warn: no reviews found for commit: d53002e4f87dd7d93124e80b59a05a75087f3a07","Warn: no reviews found for commit: ad6b397a7f5cb597aedb5540d1c0889a125cb9d3","Warn: no reviews found for commit: c2e0fb61f7f93652e89498de75e34b5d10ed6d5d","Warn: no reviews found for commit: 8920bdcd5fad0ab94be634a9479914c7e4af3edd","Warn: no reviews found for commit: a20897a6af9787cdfd63210b25ad4471a6de848d","Warn: no reviews found for commit: 7f994f744bd465af7657d46d6aa20c7511c332ca","Warn: no reviews found for commit: ca9481d1b8e64fef438a379397ac1fb71036ac69","Warn: no reviews found for commit: 86dd307f295e8a96fc8635eeafd28c88c8e95b03","Warn: no reviews found for commit: 87ce2acfd87f9cdfe09563f0059c334f1b3194ca","Warn: no reviews found for commit: 9207ecdeff8dd580780ca2185069714b412095ff","Warn: no reviews found for commit: e3572d629c6981e3ba89a129a99e56b4f82c3107","Warn: no reviews found for commit: 7d4b80fd3cdc40c3daeea52dbdbe2e1b11fde3db","Warn: no reviews found for commit: 3f421a586cd44c2b74fb509af508e8e79afe0aaf","Warn: no reviews found for commit: d2def2a0d50fceeb1ff202d046ccb26027c35d1b","Warn: no reviews found for commit: 05b8b46600703389fcaacd8e5e01ba7b07fa7238","Warn: no reviews found for commit: 03d508c5d2fb8460accfad7d69c43fcca6349c91","Warn: no reviews found for commit: 0b71d6260f3503b9b11e9b41c9464afa3f8daff1","Warn: no reviews found for commit: a069453f9eb79e013dcc78489d86afe3e886c0f0","Warn: no reviews found for commit: baac86e39a14f272134470cca4514961f6a7863f","Warn: no reviews found for commit: 4dca87bda46939c0cb2e4d6d1cd7c1b70a6e2848","Warn: no reviews found for commit: 1cf18d479a8afcb7651754f3c2be21ba35201206","Warn: no reviews found for commit: 54f3d425a344648dcfcc7a1f904bc6371643a824","Warn: no reviews found for commit: 5abaebec2efcfb75824befd52cdc1c20e1cd1844","Warn: no reviews found for commit: 0792b1a00747d7164d706c31f9b4790b72cc7e3e","Warn: no reviews found for commit: ac161340c3450d23198e178f8df3c10485f3d65d","Warn: no reviews found for commit: a96ec59c600074bd5941906b876d7eb37da6add0","Warn: no reviews found for commit: f527287e4cf96ab0efd32aac914d9ef0594be241","Warn: no reviews found for commit: b71297edf29965daf676ff73a815a530aa051f3a"],"documentation":{"short":"Determines if the project requires code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no badge detected","details":null,"documentation":{"short":"Determines if the project has a CII Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":10,"reason":"tokens are read-only in GitHub workflows","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#token-permissions"}},{"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/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"no published package detected","details":["Warn: no GitHub 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/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info: GitHub-owned GitHubActions are pinned","Info: Third-party GitHubActions are pinned","Info: Dockerfile dependencies are pinned","Info: no insecure (not pinned by hash) dependency downloads found in Dockerfiles","Info: no insecure (not pinned by hash) dependency downloads found in shell scripts"],"documentation":{"short":"Determines if the project has declared and pinned its dependencies.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#dangerous-workflow"}},{"name":"License","score":0,"reason":"license file not detected","details":null,"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"no vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":["Warn: no GitHub releases found"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":null,"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#security-policy"}},{"name":"Dependency-Update-Tool","score":0,"reason":"no update tool detected","details":["Warn: dependabot config file not detected in source location.\n\t\t\tWe recommend setting this configuration in code so it can be easily verified by others.","Warn: renovatebot config file not detected in source location.\n\t\t\tWe recommend setting this configuration in code so it can be easily verified by others."],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#dependency-update-tool"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":null,"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#fuzzing"}}]},"last_synced_at":"2025-08-21T01:15:41.064Z","repository_id":22229605,"created_at":"2025-08-21T01:15:41.064Z","updated_at":"2025-08-21T01:15:41.064Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001940,"owners_count":26083226,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-08-01T19:01:03.718Z","updated_at":"2025-10-09T18:23:38.713Z","avatar_url":"https://github.com/lukeed.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Dates and Time"],"sub_categories":["Reactive Programming"],"readme":"# FromNow [![Build Status](https://badgen.now.sh/travis/lukeed/fromnow)](https://travis-ci.org/lukeed/fromnow)\n\n\u003e A tiny (339B) utility for human-readable time differences between now and past or future dates.\n\n## Install\n\n```sh\n$ npm install fromnow --save\n```\n\n## Usage\n\nA valid date string is the only **required** parameter.\n\n```js\nconst fromNow = require('fromnow');\n\nfromNow('12/31/2010');\n//=\u003e \"4 years, 10 months, 8 days, 10 hours, 15 minutes\"\n\nfromNow('2030-05-20');\n//=\u003e \"14 years, 6 months, 21 days, 5 hours, 43 minutes\"\n\nfromNow('2030-05-20 14:02:47');\n//=\u003e \"14 years, 6 months, 22 days, 2 hours, 44 minutes\"\n\nfromNow('Wed, 20 Nov 1912 00:00:00 GMT');\n//=\u003e \"103 years, 23 days, 18 hours, 20 minutes\"\n```\n\n## API\n\n### fromNow(date, options={})\n\nReturns: `String`\n\nA valid date string is the only **required** parameter.\n\n\n#### date\nType: `String`\n\nYou may pass it **any** valid date string.\n\n#### options.max\nType: `Integer`\u003cbr\u003e\nDefault: `null`\n\nIf set, will limits the return to display a *maximum* number of non-null segments.\n\n\u003e **Important:** When `opts.zero = true` then empty segments will count towards your `max` limit!\n\n```js\n// zero=true\n\"2 years, 0 months, 12 hours, 57 minutes\"\n\n// zero=true; max=2\n\"2 years, 0 months\"\n\n// zero=false\n\"2 years, 12 hours, 57 minutes\"\n\n// zero=false; max=2\n\"2 years, 12 hours\"\n```\n\n#### options.suffix\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nAppends `\"ago\"` or `\"from now`\" to the output.\n\n```js\n// NOW = \"Sun Jun 14 2015 15:12:05\"\n\nfromNow(\"Sun Jun 14 2015 14:09:05\", { and:true, suffix:true });\n//=\u003e \"1 hour and 3 minutes ago\"\n\nfromNow(\"Sun Jun 14 2017 14:09:05\", { and:true, suffix:true, max:2 });\n//=\u003e \"2 years and 10 days from now\"\n```\n\n#### options.and\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nJoin the last two segments with `\" and \"`.\n\n```js\n\"1 year, 4 hours, 16 minutes\"\n//=\u003e \"1 year, 4 hours, and 16 minutes\"\n\n\"2 days, 12 hours\"\n//=\u003e \"2 days and 12 hours\"\n```\n\n#### options.zero\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nReturn segments with `0` value.\n\n```js\n// NOW = \"Sun Jun 14 2015 15:12:05\"\n\nfromNow(\"Sun Jun 14 2015 15:14:05\");\n//=\u003e \"2 minutes\"\n\nfromNow(\"Sun Jun 14 2015 15:14:05\", { zero:true });\n//=\u003e \"0 years, 0 months, 0 days, 0 hours, 2 minutes\"\n```\n\n## Examples\n\n#### Limit the Output\n\n```js\nfromNow('12/31/2010', { max:3 });\n//=\u003e \"4 years, 10 months, 8 days\"\n\nfromNow('2030-05-20', { max:2 });\n//=\u003e \"14 years, 6 months\"\n```\n\n#### Indicate Past or Future Tense\n\n```js\nfromNow('12/31/2010', { max:3, suffix:true });\n//=\u003e \"4 years, 10 months, 8 days ago\"\n\nfromNow('12/31/2030', { max:1, suffix:true });\n//=\u003e \"12 years from now\"\n```\n\n#### Include 'and' in the Output\n\n```js\nfromNow('12/31/2010', { max:3, suffix:true, and:true });\n//=\u003e \"4 years, 10 months, and 8 days ago\"\n\nfromNow('Wed, 20 Nov 1912 00:00:00 GMT', { max:2, suffix:true, and:true });\n//=\u003e \"103 years and 23 days ago\"\n\n// Will only apply on 2+ segments\nfromNow('2030-05-20', { max:1, and:true });\n//=\u003e \"14 years\"\n```\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Ffromnow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Ffromnow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Ffromnow/lists"}