
Research
Active Supply Chain Attack Compromises @antv Packages on npm
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.
@profullstack/fasting
Advanced tools
A comprehensive CLI and Node.js module for 16:8 intermittent fasting with meal tracking, weight monitoring, and fast history with visual charts
A comprehensive CLI and Node.js module for 16:8 intermittent fasting with meal tracking, weight monitoring, and fast history with visual charts.
pnpm install
pnpm link --global
fasting setup
The setup command will prompt you for your OpenAI API key and save it securely to ~/.config/fasting/config.json.
Alternative: You can also set the OPENAI_API_KEY environment variable if you prefer.
To run the CLI locally during development:
# Option 1: Direct execution
node bin/cli.js summary
node bin/cli.js fast start
node bin/cli.js meal "Chicken salad" --calories 350
# Option 2: After linking globally
pnpm link --global
fasting summary
fasting fast start
# Option 3: Using pnpm exec
pnpm exec fasting summary
# Start a fast (uses current time)
fasting fast start
# Start a fast at a specific time
fasting fast start --time "18:00"
fasting fast start --time "2023-12-01 18:00"
# End a fast (uses current time)
fasting fast end
# End a fast at a specific time
fasting fast end --time "10:00"
# Calories are automatically estimated using AI
fasting meal "Grilled chicken breast with quinoa"
fasting drink "Orange juice"
# Specify portion sizes for more accurate estimates
fasting meal "Pizza" --size "2 slices"
fasting drink "Orange juice" --size "32oz"
fasting meal "Salad" -s "large"
fasting weight 200
fasting summary # Comprehensive dashboard with charts
fasting summary --weight-chart # Show only weight chart
fasting summary --fast-chart # Show only fast duration chart
# Override automatic estimation with manual calories
fasting meal "Chicken Salad" -c 450
fasting drink "Black Coffee" -c 5
# Combine size specification with manual override
fasting drink "Smoothie" --size "16oz" --calories 350
fast <start|end> - Start or end a fast with optional custom timingmeal <description> - Log a meal with automatic calorie estimationdrink <description> - Log a drink with automatic calorie estimationweight <value> - Log weight in poundssummary - Show comprehensive dashboard with current status, charts, and historysetup - Configure OpenAI API key for automatic calorie estimationclean - Delete all stored data (meals, weight, fasts)Fast Command:
-t, --time <time> - Specify start/end time
Meal/Drink Commands:
-c, --calories <number> - Override automatic calorie estimation with manual value-s, --size <size> - Specify portion size for more accurate calorie estimation
Summary Command:
--weight-chart - Show only weight trend chart--fast-chart - Show only fast duration chartClean Command:
--config - Also delete API key configurationfasting-app/
βββ bin/
β βββ cli.js
βββ lib/
β βββ index.js
β βββ fasting.js
β βββ weight.js
β βββ calorie-estimator.js
β βββ config.js
βββ .env.example
βββ README.md
~/.config/fasting/
βββ config.json # API key and settings
βββ meals.json # Meal and drink logs
βββ weight.json # Weight history
βββ fasts.json # Fast tracking history
The app tracks your intermittent fasting periods:
Automatic calorie estimation using OpenAI's GPT-4o model:
--size for more accurate estimates-c flag if neededThe app stores all data in ~/.config/fasting/ for secure, persistent access:
fasting setup to configure or update your API keyOPENAI_API_KEY as an alternative (takes precedence)fasting clean to delete meals/weight datafasting clean --config to delete everything including API key# Delete meals, weight, and fast data (keeps API key)
fasting clean
# Delete everything including API key configuration
fasting clean --config
If the OpenAI API is unavailable, the app falls back to default estimates (200 calories for meals, 50 for drinks).
This package can also be used as a Node.js module in your own applications:
import {
logMeal, logDrink, getTodaysEntries,
logWeight, getWeightHistory,
startFast, endFast, getCurrentFast, getFastHistory, getFastStats
} from 'fasting-app';
// Fast tracking
startFast(); // Start fast now
startFast('2023-12-01 18:00'); // Start fast at specific time
const currentFast = getCurrentFast(); // Get active fast
const completedFast = endFast(); // End current fast
// Log meals and drinks programmatically
logMeal('Grilled chicken breast', 350);
logDrink('Orange juice', 120);
// Get today's entries
const todaysEntries = getTodaysEntries();
console.log(todaysEntries);
// Weight tracking
logWeight(175.5);
const weightHistory = getWeightHistory();
// Fast history and statistics
const fastHistory = getFastHistory(); // Completed fasts only
const fastStats = getFastStats(); // Statistics summary
Fast Tracking:
startFast(startTime?) - Start a new fast (optional custom start time)endFast(endTime?) - End current fast (optional custom end time)getCurrentFast() - Get active fast or nullgetFastHistory() - Get all completed fastsgetFastStats() - Get fast statistics (average, longest, etc.)Meal & Weight Tracking:
logMeal(description, calories) - Log a meal with description and calorie countlogDrink(description, calories) - Log a drink with description and calorie countgetTodaysEntries() - Get all meals and drinks logged todaylogWeight(weight) - Log weight in poundsgetWeightHistory() - Get complete weight history with timestampsNote: When using the module API, you need to provide calorie counts manually. Automatic calorie estimation via OpenAI is only available through the CLI commands.
The project includes comprehensive unit tests for all functionality:
# Run all tests
pnpm test
# Run specific test suites
pnpm test:fast # Fast tracking tests
pnpm test:charts # Chart generation tests
pnpm test:fasting # Meal/drink logging tests
pnpm test:weight # Weight tracking tests
All tests use isolated temporary directories to avoid interfering with real user data.
The project includes example scripts demonstrating usage:
# Run CLI usage example
pnpm example
# Run API usage example
pnpm example:api
Example Files:
examples/basic-usage.js - Demonstrates CLI commands and workflowexamples/api-usage.js - Shows programmatic Node.js module usage# Patch version (bug fixes): 1.0.2 -> 1.0.3
pnpm version patch
# Minor version (new features): 1.0.2 -> 1.1.0
pnpm version minor
# Major version (breaking changes): 1.0.2 -> 2.0.0
pnpm version major
# Specific version
pnpm version 1.2.3
# Complete workflow
pnpm test # Run tests first
pnpm version patch # Bump version
pnpm publish --access public # Publish to npm
git push && git push --tags # Push to git
# Dry run to see what would be published
pnpm publish --dry-run
FAQs
A comprehensive CLI and Node.js module for 16:8 intermittent fasting with meal tracking, weight monitoring, and fast history with visual charts
The npm package @profullstack/fasting receives a total of 33 weekly downloads. As such, @profullstack/fasting popularity was classified as not popular.
We found that @profullstack/fasting demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.