{"library":"ms","title":"ms - Millisecond Conversion Utility","description":"The `ms` package is a small, focused utility designed for converting various time formats to milliseconds and vice versa. It parses human-readable strings (e.g., '2 days', '10h', '5s') into their millisecond equivalents and formats millisecond values back into concise, human-readable strings (e.g., 3600000 becomes '1h'). The current stable version is 2.1.3, though version 3.0.0 is actively in canary, introducing significant changes including full TypeScript support and a transition to an ESM-only distribution. This makes `ms` a reliable, lightweight choice for common duration parsing and formatting tasks in both Node.js and browser environments, distinguished by its minimal API and broad adoption in the Vercel ecosystem.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install ms"],"cli":null},"imports":["import ms from 'ms';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import ms from 'ms';\n\n// Convert human-readable strings to milliseconds\nconsole.log(`'2 days' -> ${ms('2 days')}ms`);     // 172800000\nconsole.log(`'10h' -> ${ms('10h')}ms`);           // 36000000\nconsole.log(`'1.5h' -> ${ms('1.5h')}ms`);         // 5400000\nconsole.log(`'-30m' -> ${ms('-30m')}ms`);         // -1800000\n\n// Convert milliseconds to human-readable strings\nconsole.log(`3600000ms -> '${ms(3600000)}'`);       // '1h'\nconsole.log(`172800000ms -> '${ms(172800000)}'`);   // '2d'\nconsole.log(`-600000ms -> '${ms(-600000)}'`);     // '-10m'\n\n// Usage with options (e.g., long format)\nconsole.log(`ms(60000, { long: true }) -> '${ms(60000, { long: true })}'`); // '1 minute'\n","lang":"typescript","description":"Demonstrates basic conversion from human-readable strings to milliseconds and vice versa, including negative durations and the 'long' option.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}