@tsonic/nodejs 0.4.5 → 10.0.1

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
@@ -2,6 +2,14 @@
2
2
 
3
3
  TypeScript type definitions for the Node.js CLR library.
4
4
 
5
+ ## Versioning
6
+
7
+ This repo is versioned by **.NET major**:
8
+
9
+ - **.NET 10** → `versions/10/` → npm: `@tsonic/nodejs@10.x`
10
+
11
+ When publishing, run: `npm publish versions/10 --access public`
12
+
5
13
  ## Features
6
14
 
7
15
  - **Node.js-like APIs for .NET** - fs, path, events, http, and more
@@ -20,7 +28,7 @@ npm install @tsonic/nodejs @tsonic/dotnet @tsonic/core
20
28
  ### File System
21
29
 
22
30
  ```typescript
23
- import { fs } from "@tsonic/nodejs";
31
+ import { fs } from "@tsonic/nodejs/index.js";
24
32
 
25
33
  // Read file
26
34
  const content = fs.readFileSync("./package.json", "utf-8");
@@ -32,9 +40,9 @@ fs.writeFileSync("./output.txt", "Hello from Tsonic!");
32
40
  ### Path Operations
33
41
 
34
42
  ```typescript
35
- import { path } from "@tsonic/nodejs";
43
+ import { path } from "@tsonic/nodejs/index.js";
36
44
 
37
- const fullPath = path.join(__dirname, "config", "settings.json");
45
+ const fullPath = path.join("config", "settings.json");
38
46
  const ext = path.extname(fullPath); // ".json"
39
47
  const dir = path.dirname(fullPath);
40
48
  ```
@@ -42,7 +50,7 @@ const dir = path.dirname(fullPath);
42
50
  ### Events
43
51
 
44
52
  ```typescript
45
- import { EventEmitter } from "@tsonic/nodejs";
53
+ import { EventEmitter } from "@tsonic/nodejs/index.js";
46
54
 
47
55
  class MyEmitter extends EventEmitter {}
48
56
  const emitter = new MyEmitter();