@sapphire/timer-manager 1.0.1-next.ef08c69.0 → 1.0.1-next.ef27abe.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +22 -0
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -37,6 +37,28 @@ You can use the following command to install this package, or replace `npm insta
37
37
  npm install @sapphire/timer-manager
38
38
  ```
39
39
 
40
+ ## Usage
41
+
42
+ **Note:** While this section uses `require`, the imports match 1:1 with ESM imports. For example `const { TimerManager } = require('@sapphire/timer-manager')` equals `import { TimerManager } from '@sapphire/timer-manager'`.
43
+
44
+ ### Basic Usage
45
+
46
+ ```typescript
47
+ // Import the TimerManager class
48
+ const { TimerManager } = require('@sapphire/timer-manager');
49
+
50
+ // Use the class for timeouts
51
+ const timeout = TimerManager.setTimeout(() => console.log('Hello, world!'), 1000);
52
+ TimerManager.clearTimeout(timeout);
53
+
54
+ // Use the class for intervals
55
+ const interval = TimerManager.setInterval(() => console.log('Hello, world!'), 1000);
56
+ TimerManager.clearInterval(interval);
57
+
58
+ // Destroy all running timeouts and intervals so that NodeJS can gracefully exit
59
+ TimerManager.destroy();
60
+ ```
61
+
40
62
  ## Buy us some doughnuts
41
63
 
42
64
  Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire/timer-manager",
3
- "version": "1.0.1-next.ef08c69.0",
3
+ "version": "1.0.1-next.ef27abe.0",
4
4
  "description": "A timer manager utility library for JavaScript.",
5
5
  "author": "@sapphire",
6
6
  "license": "MIT",
@@ -58,11 +58,11 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@favware/cliff-jumper": "^1.8.8",
61
- "@vitest/coverage-c8": "^0.23.4",
62
- "tsup": "^6.2.3",
63
- "typedoc": "^0.23.15",
64
- "typedoc-json-parser": "^5.0.1",
61
+ "@vitest/coverage-c8": "^0.24.3",
62
+ "tsup": "^6.3.0",
63
+ "typedoc": "^0.23.17",
64
+ "typedoc-json-parser": "^6.0.2",
65
65
  "typescript": "^4.8.4",
66
- "vitest": "^0.23.4"
66
+ "vitest": "^0.24.3"
67
67
  }
68
68
  }