@teakit/month
@teakit/month is a TypeScript year-month calculation package for ESM and
browser environments.
Guide
Use this page as the short human entrypoint. Keep detailed API behavior in the method reference pages.
Installation & Usage
Always create values with Month.from(...). Use diff for month differences
and add or sub for month offsets.
Package Contract
- Import
Monthfrom@teakit/month. - Create values with
Month.from(...); do not usenew Month(...)or callMonth(...). - Use canonical
YYYY-MMstrings with exactly four year digits and a zero-padded month. - Accept date-like strings and native
Dateobjects at the input boundary when callers already have them;Dateobjects use local calendar fields, so prefer strings when timezone-free behavior matters. - Use
toString({ precision: "year" | "month" | "day" })only when explicit output precision is needed; defaulttoString()remainsYYYY-MM. - Read
month.yearandmonth.monthas strings;month.monthis zero-padded. - Treat
Monthinstances as immutable. - Use Month methods instead of JavaScript date arithmetic.
- The package is browser-safe ESM and has no Node runtime imports.
Reference Map
LLMs
AI agents should start with LLMs, then open only the relevant method reference file. Reference pages keep human usage first and AI-specific contracts near the end.