Skip to content

Releases: mu373/epiweek

v2.0.2

Choose a tag to compare

@mu373 mu373 released this 07 Dec 23:31
d0581ff

Changes

  • Add comprehensive Features section to README
  • Link test validation workflow in documentation

v2.0.1

Choose a tag to compare

@mu373 mu373 released this 07 Dec 23:31
55e9b23

Changes

  • Add npm keywords for better discoverability (epiweek, epiweeks, flusight, mmwr, epidemiology, cdc)
  • Update README with npm version badge and improved package description
  • Fix repository URL format in package.json

v2.0.0

Choose a tag to compare

@mu373 mu373 released this 07 Dec 23:31
70d9bef

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/epiweeks implementation

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 epiweek

Full Changelog

  • Renamed package and class (mmwr-weekepiweek, MMWRDateEpiWeek)
  • 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)