Building a Free, Open-Source Dividend Calculator Suite
说明与用途
作者构建了一个无需注册、完全在浏览器中运行的免费股息计算器套件。其核心是一个使用纯函数的开源 TypeScript 库,确保了透明度并消除了服务器端数据处理。
问题
Existing free dividend calculators typically require email signups, trials, or hide their logic behind paywalls, creating friction and lack of transparency for users.
结果
A suite of focused dividend calculators (yield, DRIP, monthly income, ETF specific) that runs entirely in the browser with no signup, backed by an open-source, tested TypeScript library.
工作流
- Identify standard financial formulas (yield, payout ratio, DRIP) as commodity knowledge.
- Create a zero-dependency TypeScript library (
dividend-math) containing pure functions for each calculation. - Implement strict input validation to fail loudly on bad inputs (e.g., NaN) rather than returning plausible nonsense.
- Write unit tests to cover edge cases like zero price or zero earnings.
- Build a static site that imports the library and performs all computations in the browser.
- Publish the library to npm and the source code to GitHub under an MIT license.
- Deploy the static site to ensure no backend data collection is required.
证据
Every 'free' dividend calculator I tried wanted an email, a signup, or a trial.
I pulled every formula into one zero-dependency TypeScript library: dividend-math.
It's a statically-generated site — all computation happens in your browser, nothing is sent anywhere.
- 记录日期: 2026-09-05T12:49:05.735Z