Introduction
Setting limits is an essential skill for preserving your energy and mental health. In 2026, professionals must combine introspection with digital tools to maintain sustainable balance. This tutorial offers an advanced methodology with concrete examples and code to automate limit tracking.
Prerequisites
- Basic knowledge of TypeScript
- Node.js 20+ installed
- An editor like VS Code
- Notions of personal development
Initializing the tracking project
mkdir limites-tracker
cd limites-tracker
npm init -y
npm install typescript @types/nodeThis project creates a simple tool to track your daily limits. The installation sets up a functional TypeScript environment.
Limit model definition
export interface Limit {
id: string;
category: 'travail' | 'personnel';
maxHours: number;
currentHours: number;
}
export const defaultLimits: Limit[] = [
{ id: '1', category: 'travail', maxHours: 8, currentHours: 0 },
{ id: '2', category: 'personnel', maxHours: 4, currentHours: 0 }
];This file defines the TypeScript structure for modeling limits. Each limit includes a maximum and real-time tracking.
Limit checking function
import { Limit } from '../models/limits';
export function checkLimits(limits: Limit[]): string[] {
const violations: string[] = [];
limits.forEach(limit => {
if (limit.currentHours > limit.maxHours) {
violations.push(`Limite dépassée pour ${limit.category}: ${limit.currentHours}h`);
}
});
return violations;
}This pure function analyzes current limits and returns violations. It is designed to be called regularly in a tracking loop.
Main tracking script
import { defaultLimits } from './models/limits';
import { checkLimits } from './utils/checkLimits';
function updateLimit(id: string, hours: number) {
const limit = defaultLimits.find(l => l.id === id);
if (limit) limit.currentHours += hours;
}
updateLimit('1', 9);
const violations = checkLimits(defaultLimits);
console.log(violations.length > 0 ? violations : 'Toutes les limites sont respectées.');The main script updates and checks limits. Run it after each day for immediate feedback on any overruns.
JSON limit configuration
{
"dailyWorkLimit": 8,
"weeklyPersonalLimit": 20,
"alertThreshold": 0.9,
"notifications": true
}This external configuration file lets you easily adjust thresholds without modifying source code. Ideal for quick customization.
Best practices
- Re-evaluate your limits each quarter based on your goals
- Use automated reminders to stay on track
- Clearly communicate your limits to your professional circle
- Build safety margins into your calculations
- Document the reasons behind each limit you set
Common mistakes to avoid
- Ignoring early warning signs of fatigue
- Setting limits that are too rigid without flexibility
- Failing to regularly measure progress toward goals
- Forgetting to adjust limits after major life changes
Going further
Deepen these concepts with our training on time management and personal leadership. Discover our resources at https://learni-group.com/formations.