Package Exports
- cardamon
- cardamon/dist/cli.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cardamon) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
🌱 Cardamon CLI
A simple command-line tool for measuring the carbon footprint and energy consumption of web pages during development.
Installation
npm install -g cardamonUsage
Basic Usage
cardamon http://localhost:3000Quick Mode (Fast Scrolling)
For rapid testing during development:
cardamon -q http://localhost:3000With Custom Carbon Intensity
cardamon http://localhost:3000 --carbon-intensity 400Combining Options
cardamon -q -c 350 http://localhost:3000Options
<url>- URL to measure (required)-c, --carbon-intensity <value>- Carbon intensity in g CO2/kWh (default: 494)-q, --quick- Quick mode: scroll to bottom quickly without waiting for full duration
Measurement Modes
Normal Mode (Default)
- Takes ~10 seconds to complete
- Scrolls slowly with 1-second delays between scrolls
- Provides comprehensive measurements
- Best for final assessments
Quick Mode (-q)
- Completes as soon as page bottom is reached
- Scrolls rapidly with 100ms delays
- Perfect for quick feedback during development
Examples
# Development testing - quick feedback
cardamon -q http://localhost:3000
# Production assessment - full measurement
cardamon https://mywebsite.com
# Quick test with EU carbon intensity
cardamon -q -c 350 http://localhost:8080
# Full measurement with custom carbon intensity
cardamon -c 500 https://example.comDevelopment
# Install dependencies
npm install
# Run in development mode (normal)
npm run dev http://localhost:3000
# Run in development mode (quick)
npm run dev -- -q http://localhost:3000
# Build for production
npm run build
# Run built version
npm start http://localhost:3000License
Cardamon is distributed under the terms of the PolyForm Shield License (Version 1.0).
See LICENSE for details.
Copyright © 2023 Root & Branch ltd