{"_id":"@arthur-lobo/timefy","_rev":"4-2bf0eedc746ec0ca169843b12b0a109f","name":"@arthur-lobo/timefy","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@arthur-lobo/timefy","version":"1.0.0","keywords":["time","timefy"],"author":{"name":"Arthur Lobo"},"license":"MIT","_id":"@arthur-lobo/timefy@1.0.0","maintainers":[{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"}],"dist":{"shasum":"15c00407d9a91e7f5c507edbb29c7124bcf15308","tarball":"https://registry.npmjs.org/@arthur-lobo/timefy/-/timefy-1.0.0.tgz","fileCount":6,"integrity":"sha512-58nL77nq1BVx5HxUxuTpG4P3tWtMCa4CHJ+Lf90MY3Mje3VyCe10ewT8ms4YvmVZT5RmEDJNa9mknHaXm0Xvvg==","signatures":[{"sig":"MEUCIHoUSVXes/xvzdxeCpHgQmyRY7dfEa6cIVzJg06R204oAiEA7JWL2OC6DmF3p3KRSI51ob0ymTsJyBkDvJMHDoEW3T4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6211},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"096b32a604c649067375f933c4bf842794e48565","scripts":{"lint":"biome check","test":"vitest --run","build":"tsup","prepack":"tsup","lint:fix":"biome check --write"},"_npmUser":{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"},"_npmVersion":"11.13.0","description":"Easy handle time units.","directories":{},"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.5","lefthook":"^2.1.6","typescript":"^5","@types/node":"^25.6.0","@biomejs/biome":"^2.4.13"},"_npmOperationalInternal":{"tmp":"tmp/timefy_1.0.0_1778797965199_0.26569804506367056","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@arthur-lobo/timefy","version":"1.0.1","keywords":["time","timefy"],"author":{"name":"Arthur Lobo"},"license":"MIT","_id":"@arthur-lobo/timefy@1.0.1","maintainers":[{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"}],"dist":{"shasum":"79502b213da2e6588a76ba9aae0ae5234608af2c","tarball":"https://registry.npmjs.org/@arthur-lobo/timefy/-/timefy-1.0.1.tgz","fileCount":6,"integrity":"sha512-Ho8B7u9+gI+SK57Uc7fWWg0vq2Gc5UTBoJ3oRmRWNhnIxgZ2qqTgT3r/ZKXH0tph8Pxbmpo92qoOPZ4xJmJ1Bg==","signatures":[{"sig":"MEQCIHKFDhydQOSVrIC5bGuUK3L1/W9nz5Kxh0NJoDI0kxBfAiAndoD5CBM+QR9RIEDARvd5RCuN6DzsDlyHhGVg4Kf/ig==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6215},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"9f6d5ae9262a42fc977deb3ee10f5bb07a04d761","scripts":{"lint":"biome check","test":"vitest --run","build":"tsup","prepack":"tsup","lint:fix":"biome check --write"},"_npmUser":{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"},"_npmVersion":"11.13.0","description":"Easy handle time units.","directories":{},"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.5","lefthook":"^2.1.6","typescript":"^5","@types/node":"^25.6.0","@biomejs/biome":"^2.4.13"},"_npmOperationalInternal":{"tmp":"tmp/timefy_1.0.1_1778801203277_0.7386406013313378","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@arthur-lobo/timefy","version":"1.1.0","keywords":["time","timefy"],"author":{"name":"Arthur Lobo"},"license":"MIT","_id":"@arthur-lobo/timefy@1.1.0","maintainers":[{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"}],"dist":{"shasum":"e1fcb0549edaed1920f9c139cfbd93c84c8a102b","tarball":"https://registry.npmjs.org/@arthur-lobo/timefy/-/timefy-1.1.0.tgz","fileCount":6,"integrity":"sha512-QW1tSVnQQSOMCbBlz3cuidXuvGQ2XNrOpwdL5S7KN3gsynWrtWw/4aTVqbbUb/KWSOXC6O3b5YTaP4SFpKar2g==","signatures":[{"sig":"MEUCIFHBXnQUbbJRvpjlx9B61bR960z3hch5uJPqbsbcZPMZAiEAqaXbVXhtKwjmj0KfvjCl+AU8AordMAuQlEAy5dy7Hn0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12493},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"716fefb89113538ab39b99fe5189a3a150c52202","scripts":{"lint":"biome check","test":"vitest --run","build":"tsup","prepack":"tsup","lint:fix":"biome check --write"},"_npmUser":{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"},"_npmVersion":"11.13.0","description":"Easy handle time units.","directories":{},"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.1.5","lefthook":"^2.1.6","typescript":"^5","@types/node":"^25.6.0","@biomejs/biome":"^2.4.13","@vitest/coverage-v8":"4.1.5"},"_npmOperationalInternal":{"tmp":"tmp/timefy_1.1.0_1779055128640_0.06834322367532897","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@arthur-lobo/timefy","version":"1.1.1","description":"A simple and intuitive library for time manipulation, timeouts, and intervals","keywords":["time","timefy","timeout","interval","time manipulation","milliseconds","seconds","minutes","hours"],"license":"MIT","author":{"name":"Arthur Lobo"},"type":"module","publishConfig":{"access":"public"},"exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.js"}},"scripts":{"test":"vitest --run","build":"tsup","prepack":"tsup","lint":"biome check","lint:fix":"biome check --write"},"devDependencies":{"@biomejs/biome":"^2.4.13","@types/node":"^25.6.0","@vitest/coverage-v8":"4.1.5","lefthook":"^2.1.6","tsup":"^8.5.1","typescript":"^5","vitest":"^4.1.5"},"gitHead":"7f75f512d3b827998b60ab2ee05addb16ad9f1b3","_id":"@arthur-lobo/timefy@1.1.1","_nodeVersion":"25.9.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-BtDGwxmTtvGeDO3XzUpznKM/kt2UAWdY4h9Sr/IXMV58P2SnkjZqIuQKUq892l1G9AEMARrD4vwnUz/BcrPaVg==","shasum":"be420e316043330225243819b9911ce41eb1b24a","tarball":"https://registry.npmjs.org/@arthur-lobo/timefy/-/timefy-1.1.1.tgz","fileCount":6,"unpackedSize":19135,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH+IIedPDGNZbR4bJdVkZH6CSeeS68vfSvBqPXLOknN4AiAX7DE4FlKejZ2hSfGzpPVUWQiBC3TPAjwSMnMFQNIZmw=="}]},"_npmUser":{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"},"directories":{},"maintainers":[{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/timefy_1.1.1_1779498191518_0.7858638542056884"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-14T22:32:45.140Z","modified":"2026-05-23T01:03:11.758Z","1.0.0":"2026-05-14T22:32:45.352Z","1.0.1":"2026-05-14T23:26:43.417Z","1.1.0":"2026-05-17T21:58:48.812Z","1.1.1":"2026-05-23T01:03:11.663Z"},"author":{"name":"Arthur Lobo"},"license":"MIT","keywords":["time","timefy","timeout","interval","time manipulation","milliseconds","seconds","minutes","hours"],"description":"A simple and intuitive library for time manipulation, timeouts, and intervals","maintainers":[{"name":"arthur-lobo","email":"arthurciprianolobo@gmail.com"}],"readme":"# timefy\n\nA simple and intuitive library for time manipulation, timeouts, and intervals in TypeScript/JavaScript.\n\n## Installation\n\nYou can install the library using npm or yarn:\n\n```bash\n# npm\nnpm install @arthur-lobo/timefy\n\n# yarn\nyarn add @arthur-lobo/timefy\n```\n\n## How to use\n\n### The `t` function\n\nThe `t` function is a utility to create time objects in a readable way. You can convert values to different units or use them directly in other classes within the library.\n\n```typescript\nimport { t } from '@arthur-lobo/timefy';\n\nconst time = t(5, 'm'); // 5 minutes\n\nconsole.log(time.toMilliseconds()); // 300000\nconsole.log(time.toSeconds());      // 300\n```\n\nSupported units: `ms`, `s`, `m`, `h`, `d`, `w` (and their long forms like `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`).\n\n### Timeout\n\nThe `Timeout` class allows you to execute a function after a specific period. You can pass a number (in milliseconds) or an object created by the `t` function.\n\n```typescript\nimport { Timeout, t } from '@arthur-lobo/timefy';\n\nconst myTimeout = new Timeout(t(2, 's'), () => {\n  console.log('Executed after 2 seconds!');\n});\n\nmyTimeout.start();\n\n// You can also auto-start by passing true as the third parameter\nnew Timeout(500, () => console.log('Fast!'), true);\n```\n\n### Interval\n\nThe `Interval` class allows you to execute a function repeatedly at a defined interval. Just like with `Timeout`, you can use the `t` function to define the interval.\n\n```typescript\nimport { Interval, t } from '@arthur-lobo/timefy';\n\nconst myInterval = new Interval(t(1, 'h'), () => {\n  console.log('Running every 1 hour');\n});\n\nmyInterval.start();\n\n// To stop the interval:\n// myInterval.stop();\n```\n","readmeFilename":"README.md"}