Releases: mu373/epiweek
Releases · mu373/epiweek
Release list
v2.0.2
v2.0.1
v2.0.0
Major Release
epiweek is an epidemiological week conversion tool for TypeScript/JavaScript, originally forked from reichlab/mmwr-week.
This release modernizes the package with a new stack and additional features inspired by dralshehri/epiweeks.
Highlights
- ISO week system support: Choose between MMWR (CDC) and ISO 8601 week systems
- Modern stack:TypeScript 5.x, dual ESM/CJS, Vitest, ESLint 9
- Migration from moment.js: Replaced with date-fns for smaller bundle size
- Full test coverage: The results are fully validated against Python
dralshehri/epiweeksimplementation
Breaking Changes
| Change | v1.x | v2.0 |
|---|---|---|
| Package name | mmwr-week |
epiweek |
| Class name | MMWRDate |
EpiWeek |
| Date conversion | toMomentDate() |
toJSDate() |
| Module format | CommonJS only | ESM + CommonJS |
| Node.js version | ≥7 | ≥18 |
New Features
- ISO week support -
new EpiWeek(2025, 48, { system: 'iso' }) - Comparison methods -
equals(),isBefore(),isAfter() - Date iteration -
iterDates()generator for week dates - Lightweight deps -
date-fns+micro-memoize
Migration Guide
// v1.x (mmwr-week)
import { MMWRDate } from 'mmwr-week'
const date = new MMWRDate(2025, 48)
const moment = date.toMomentDate()
// v2.0 (epiweek) - MMWR system (same behavior)
import { EpiWeek } from 'epiweek'
const date = new EpiWeek(2025, 48)
const jsDate = date.toJSDate()
// v2.0 (epiweek) - ISO week system
const isoDate = new EpiWeek(2025, 48, { system: 'iso' })Installation
npm install epiweek
pnpm add epiweekFull Changelog
- Renamed package and class (
mmwr-week→epiweek,MMWRDate→EpiWeek) - Added ISO 8601 week system support
- Modernized to dual ESM/CJS with TypeScript 5.x
- Replaced moment.js with date-fns
- Replaced moize with micro-memoize
- Added comparison and iteration methods
- CI with GitHub Actions (tests + epiweeks comparison)
- Updated tooling (ESLint 9, Prettier, Vitest)