1.0.0 • Published 5 months ago

comed-bills v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

ComEd Electricity Bill Downloader

A Node.js library to bulk download utility bills from the ComEd web portal.

Background

Utility companies often do not provide a way to bulk download bills/invoices. This library allows users to download the utility bills that have been issued by the ComEd (Commonwealth Edison Company) within the last 24 months. Unfortunately ComEd does not appear to provide a method of gathering utility beyond 24 months.

Usage

The ComEdBillDownloader class contains the following methods to for requesting and saving a bill from the Commonwealth Edison Company customer portal:

  • authenticate() - Authenticates and performs the necessary server operations to download bills.
  • tryBulkDownload() - Attempts to download all bills from the last 24 months.
import { sub } from 'date-fns';
import { ComEdBillDownloader } from 'comed-bills';

// Account details:
const ACCOUNT_NUMBER = '12349780000';
const USERNAME = 'JohnDoe';
const PASSWORD = 'FooBaBaz123';

// Download bills from the last 12 months:
const to = new Date();
const from = sub(to, { months: 12 });
const saveDirectory = import.meta.dirname;
const downloader = new ComEdBillDownloader();
await downloader.authenticate(USERNAME, PASSWORD);
await downloader.bulkDownload(ACCOUNT_NUMBER, from, to, saveDirectory);

System Requirements

  • Node v18+
  • x64 Architecture

License

MIT License