[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-75176":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":9,"languages":9,"totalLinesOfCode":9,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":13,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":13,"lastSyncTime":27,"discoverSource":28},75176,"whenwords","dbreunig\u002Fwhenwords","dbreunig","A relative time formatting library, with no code.",null,1289,80,10,2,0,4,13,6,61.03,"MIT License",false,"main",true,[],"2026-06-12 04:01:18","# whenwords: An Open Source Library Without Code\n\nToday I'm releasing [`whenwords`](https:\u002F\u002Fgithub.com\u002Fdbreunig\u002Fwhenwords), a relative time formatting library that contains _no code_.\n\n`whenwords` delivers the following functions:\n\n- **timeago** — Converts a timestamp to a relative time string like \"3 hours ago\" or \"in 2 days\" based on a reference time.\n- **duration** — Formats a number of seconds as a human-readable duration like \"2 hours, 30 minutes\" or \"2h 30m\" in compact mode.\n- **parse_duration** — The inverse of duration—parses strings like \"2h 30m\" or \"2 hours and 30 minutes\" into seconds.\n- **human_date** — Returns contextual date strings like \"Today\", \"Yesterday\", \"Last Tuesday\", or \"March 5\" depending on how far the date is from a reference point.\n- **date_range** — Formats a start and end timestamp as a smart date range, collapsing redundant information: \"March 5–7, 2024\" instead of \"March 5, 2024 – March 7, 2024\".\n\nThere are _many_ libraries that perform similar functions. But none of them are language agnostic.\n\n`whenwords` supports Ruby, Python, Rust, Elixir, Swift, PHP, and Bash. I'm sure it works in other languages, too. [Those are just the languages I've tried and tested](https:\u002F\u002Fgithub.com\u002Fdbreunig\u002Fwhenwords-examples).\n\n(I even implemented it as Excel formulas. Though that one requires a bit of work to install.)\n\nBut like I said: the `whenwords` library _contains no code_. Instead, `whenwords` contains specs and tests, specifically:\n\n- **SPEC.md**: A detailed description of how the library should behave and how it should be implemented.\n- **tests.yaml**: A list of language-agnostic test cases, defined as input\u002Foutput pairs, that any implementation must pass.\n- **INSTALL.md**: Instructions for building `whenwords`, for you, the human.\n\nThe installation instructions are comically simple, just a prompt to paste into Claude, Codex, Cursor, whatever. It's short enough to print here in its entirety:\n\n``` markdown\nImplement the whenwords library in [LANGUAGE].\n\n1. Read SPEC.md for complete behavior specification\n2. Parse tests.yaml and generate a test file\n3. Implement all five functions: timeago, duration, parse_duration, \n   human_date, date_range\n4. Run tests until all pass\n5. Place implementation in [LOCATION]\n\nAll tests.yaml test cases must pass. See SPEC.md \"Testing\" section \nfor test generation examples.\n```\n\nPick your language, pick your location, copy, paste, and go.\n\n[I've written about `whenwords` here](https:\u002F\u002Fwww.dbreunig.com\u002F2026\u002F01\u002F08\u002Fa-software-library-with-no-code.html).\n","`whenwords` 是一个用于相对时间格式化的开源库，其独特之处在于不包含任何代码。该项目提供了包括将时间戳转换为相对时间字符串（如“3小时前”或“2天后”）、格式化秒数为易读的持续时间、解析持续时间字符串、生成上下文相关的日期字符串以及智能格式化日期范围等核心功能。`whenwords` 的设计支持多种编程语言，包括但不限于 Ruby、Python、Rust、Elixir、Swift、PHP 和 Bash，通过提供详尽的行为规范(SPEC.md)与跨语言测试用例(tests.yaml)，使得开发者可以轻松地在自己选择的语言环境中实现这些功能。适用于需要灵活处理多语言环境下的时间表示且追求轻量级解决方案的应用场景。","2026-06-11 03:52:35","high_star"]