@darthcav/ts-utils 0.0.1 → 0.1.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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ts-utils
1
+ # @darthcav/ts-utils
2
2
 
3
3
  ![Node][node-version] ![Version][version-image] ![CI][ci-badge] ![Coverage][coverage-badge]
4
4
 
@@ -15,7 +15,33 @@ A collection of utility functions for TypeScript applications and modules.
15
15
  - TypeDoc for API documentation
16
16
  - GitHub Actions CI/CD workflows
17
17
 
18
- ## Getting Started
18
+ ## Installation
19
+
20
+ ```shell
21
+ npm install @darthcav/ts-utils
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### `main`
27
+
28
+ Bootstraps an application process: logs startup information, registers handlers
29
+ for `SIGINT`, `SIGTERM`, `uncaughtException`, and `unhandledRejection`, then
30
+ delegates to an optional launcher function.
31
+
32
+ ```ts
33
+ import { getLogger } from "@logtape/logtape"
34
+ import { main } from "@darthcav/ts-utils"
35
+
36
+ main("my-app", getLogger(["my-app"]), (name, logger) => {
37
+ logger.info(`${name} is running`)
38
+ // start servers, connect to databases, etc.
39
+ })
40
+ ```
41
+
42
+ For the full API reference see the [API Documentation][pages-url].
43
+
44
+ ## Development
19
45
 
20
46
  ```shell
21
47
  # Install dependencies
package/dist/main.d.ts CHANGED
@@ -21,7 +21,7 @@ export type LauncherFunction = (name: string, logger: Logger, ...parts: unknown[
21
21
  * @example
22
22
  * ```ts
23
23
  * import { getLogger } from "@logtape/logtape"
24
- * import { main } from "ts-utils"
24
+ * import { main } from "@darthcav/ts-utils"
25
25
  *
26
26
  * main("my-app", getLogger(["my-app"]), (name, logger) => {
27
27
  * logger.info(`${name} is running`)
package/dist/main.js CHANGED
@@ -12,7 +12,7 @@ import process, { env, execArgv, pid, title } from "node:process";
12
12
  * @example
13
13
  * ```ts
14
14
  * import { getLogger } from "@logtape/logtape"
15
- * import { main } from "ts-utils"
15
+ * import { main } from "@darthcav/ts-utils"
16
16
  *
17
17
  * main("my-app", getLogger(["my-app"]), (name, logger) => {
18
18
  * logger.info(`${name} is running`)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@darthcav/ts-utils",
3
3
  "description": "A collection of utility functions for TypeScript applications and modules",
4
- "version": "0.0.1",
4
+ "version": "0.1.0",
5
5
  "author": {
6
6
  "name": "darthcav"
7
7
  },
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",
43
- "url": "git@github.com:darthcav/ts-utils.git"
43
+ "url": "git+https://github.com/darthcav/ts-utils.git"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=25"
package/src/main.ts CHANGED
@@ -28,7 +28,7 @@ export type LauncherFunction = (
28
28
  * @example
29
29
  * ```ts
30
30
  * import { getLogger } from "@logtape/logtape"
31
- * import { main } from "ts-utils"
31
+ * import { main } from "@darthcav/ts-utils"
32
32
  *
33
33
  * main("my-app", getLogger(["my-app"]), (name, logger) => {
34
34
  * logger.info(`${name} is running`)