{"_id":"@alfimonth/dfh","_rev":"4-15cbfbc342429cac029e5ec873da94c8","name":"@alfimonth/dfh","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@alfimonth/dfh","version":"1.0.0","license":"MIT","_id":"@alfimonth/dfh@1.0.0","maintainers":[{"name":"alfimonth","email":"alfimonth@gmail.com"}],"dist":{"shasum":"138b12b8023e4e6a3ac3fd5eac11de3c26542aaf","tarball":"https://registry.npmjs.org/@alfimonth/dfh/-/dfh-1.0.0.tgz","fileCount":5,"integrity":"sha512-3umfq/6zrXuscV1aIZHR/5fhZVALyQ/L5ViVIDiCYuWfozQt0yChFA/BWIRa0eKUS4eLP/uPfBYn/4F+WveZEA==","signatures":[{"sig":"MEYCIQDZvTpui5emGa4lbbQ3tpVDIJ5RdfTVlwxFViy5JAWiYgIhAKOcZCdo1Ys919ObEo+N06Dytdn1zxkHk3v3FKN0r/vn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1946},"main":"./dist/index.js","types":"./dist/index.d.ts","private":false,"scripts":{"build":"tsc"},"_npmUser":{"name":"alfimonth","email":"alfimonth@gmail.com"},"_npmVersion":"10.9.2","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dfh_1.0.0_1750049965941_0.12383082960676095","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alfimonth/dfh","version":"1.0.1","keywords":["date","time","human readable","diffForHumans","dfh"],"author":{"name":"Alfi"},"license":"MIT","_id":"@alfimonth/dfh@1.0.1","maintainers":[{"name":"alfimonth","email":"alfimonth@gmail.com"}],"homepage":"https://github.com/alfimonth/dfh#readme","bugs":{"url":"https://github.com/alfimonth/dfh/issues"},"dist":{"shasum":"9ba53da56f32f199b0026a2cde25153f2bc08014","tarball":"https://registry.npmjs.org/@alfimonth/dfh/-/dfh-1.0.1.tgz","fileCount":4,"integrity":"sha512-ChDZdemuCzxZBBCy0W4C8T9HF5f/6zlIoj/uT0agD3/zVZ4GcQVcWaXigVT4UUY7QBgC5opIuHT2FrFSm4QKcQ==","signatures":[{"sig":"MEQCIBW4LLeOZ95ZD0qFQ20B1hpW4iUmbBU6HYI7ogPk4e2UAiBB5+cl5Ru1Z1Hx8zMfOTQWak65629gl1HZQE6PHNtnOQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2707},"main":"dist/index.js","types":"dist/index.d.ts","_npmUser":{"name":"alfimonth","email":"alfimonth@gmail.com"},"repository":{"url":"git+https://github.com/alfimonth/dfh.git","type":"git"},"_npmVersion":"10.9.2","description":"Convert JS Date to human readable format like '2 minutes ago'","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dfh_1.0.1_1750050251451_0.7004397494205294","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@alfimonth/dfh","version":"1.1.0","keywords":["date","time","human readable","diffForHumans","dfh"],"author":{"name":"alfimonth"},"license":"MIT","_id":"@alfimonth/dfh@1.1.0","maintainers":[{"name":"alfimonth","email":"alfimonth@gmail.com"}],"homepage":"https://github.com/alfimonth/dfh#readme","bugs":{"url":"https://github.com/alfimonth/dfh/issues"},"dist":{"shasum":"da9d09d650605710e4317923f3e1504a85728ed7","tarball":"https://registry.npmjs.org/@alfimonth/dfh/-/dfh-1.1.0.tgz","fileCount":4,"integrity":"sha512-CRF940U4bwTEO4QtueEevyEIdDfCEAHCjkP/nK4XLNBWBmAIrswYkm8T7CDRDT+ADLpod0c9T4OPWcRCVbejvg==","signatures":[{"sig":"MEYCIQClR8HE+nLbo609BsBfxqLLPR9UN0Ipxq3WSpdD/8VV4AIhALKyTHzkoC1y7G3CVtVK7P63RqE5LH1cBxr2ebIOXyrI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2873},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"3b642f3a1c3489846d6a6a7e929b975215dc1927","_npmUser":{"name":"alfimonth","actor":{"name":"alfimonth","type":"user","email":"alfimonth@gmail.com"},"email":"alfimonth@gmail.com"},"repository":{"url":"git+https://github.com/alfimonth/dfh.git","type":"git"},"_npmVersion":"10.9.2","description":"Convert JS Date to human readable format like '2 minutes ago'","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dfh_1.1.0_1750651334371_0.37050463924683963","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@alfimonth/dfh","version":"1.2.0","description":"Convert JS Date to human readable format like '2 minutes ago'","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"npm run build && node --test"},"repository":{"type":"git","url":"git+https://github.com/alfimonth/dfh.git"},"keywords":["date","time","human readable","diffForHumans","dfh"],"bugs":{"url":"https://github.com/alfimonth/dfh/issues"},"homepage":"https://github.com/alfimonth/dfh#readme","author":{"name":"alfimonth"},"license":"MIT","devDependencies":{"typescript":"^5.4.5"},"gitHead":"04b6ffef4f92071757381294165d2d3bb273c99f","_id":"@alfimonth/dfh@1.2.0","_nodeVersion":"22.21.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-L5WyKE5rnblqp6vsmf1hdQvupyiIBRKGAJhxxdatX2V2Hb6JULcG03iUsBCQms59QztTuC3OoJcSfuFkC/MOdg==","shasum":"e92136e64687a581a195f75bd62bccbad8b3af93","tarball":"https://registry.npmjs.org/@alfimonth/dfh/-/dfh-1.2.0.tgz","fileCount":4,"unpackedSize":3107,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCxa3/BXpY8TmJZqB9t+i8uFqGEc2ZjHJmhaHGNUFGsHgIhAMuPSyGuKLlzsHcAbxzRwzV1vqr1KY1lDFa31HGtrjQ6"}]},"_npmUser":{"name":"alfimonth","email":"alfimonth@gmail.com"},"directories":{},"maintainers":[{"name":"alfimonth","email":"alfimonth@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dfh_1.2.0_1780027111107_0.12448735019999835"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-16T04:59:25.845Z","modified":"2026-05-29T03:58:31.366Z","1.0.0":"2025-06-16T04:59:26.116Z","1.0.1":"2025-06-16T05:04:11.657Z","1.1.0":"2025-06-23T04:02:14.580Z","1.2.0":"2026-05-29T03:58:31.258Z"},"bugs":{"url":"https://github.com/alfimonth/dfh/issues"},"author":{"name":"alfimonth"},"license":"MIT","homepage":"https://github.com/alfimonth/dfh#readme","keywords":["date","time","human readable","diffForHumans","dfh"],"repository":{"type":"git","url":"git+https://github.com/alfimonth/dfh.git"},"description":"Convert JS Date to human readable format like '2 minutes ago'","maintainers":[{"name":"alfimonth","email":"alfimonth@gmail.com"}],"readme":"# @alfimonth/dfh\n\n📅 A lightweight utility to convert JavaScript dates into human-readable relative time — like `5 minutes ago`, `yesterday`, or `in 2 days`.\n\n## ✨ Features\n\n- Easy to use: `dfh(new Date())`\n- Supports both past and future times\n- Lightweight and dependency-free\n- Written in TypeScript\n\n---\n\n## 🚀 Installation\n\n```bash\nnpm install @alfimonth/dfh\n```\n\nor using Yarn:\n\n```bash\nyarn add @alfimonth/dfh\n```\n\n---\n\n## 🛠 Usage\n\n```ts\nimport { dfh } from '@alfimonth/dfh';\n\nconst result = dfh(new Date(Date.now() - 60 * 1000)); // 1 minute ago\nconsole.log(result);\n```\n\n---\n\n## 📌 Examples\n\n| Input                                   | Output               |\n| --------------------------------------- | -------------------- |\n| `dfh(new Date())`                     | `just now`         |\n| `dfh(new Date(Date.now() - 60000))`   | `1 minute ago`     |\n| `dfh(new Date(Date.now() + 3600000))` | `in 1 hour`        |\n| `dfh(new Date('2020-01-01'))`         | `over 4 years ago` |\n\n---\n\n## 📦 API\n\n### `dfh(date: Date | string | number): string`\n\n**Parameters:**\n\n- `date` — A JavaScript `Date` object, timestamp (`number`), or ISO date `string`.\n\n**Returns:**\n\n- A human-readable string like `\"5 minutes ago\"` or `\"in 3 days\"`.\n\n---\n\n## 🧪 Testing\n\n```bash\nnpm run test\n```\n\n---\n\n## 📄 License\n\nMIT © [@alfimonth](https://www.npmjs.com/~alfimonth)\n","readmeFilename":"README.md"}