@tsonic/nodejs 0.4.4 → 0.4.6
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 +8 -8
- package/index/bindings.json +86 -86
- package/index/internal/index.d.ts +64 -64
- package/index/internal/metadata.json +43 -43
- package/nodejs.Http/bindings.json +4 -4
- package/nodejs.Http/internal/index.d.ts +2 -2
- package/nodejs.Http/internal/metadata.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ TypeScript type definitions for the Node.js CLR library.
|
|
|
6
6
|
|
|
7
7
|
- **Node.js-like APIs for .NET** - fs, path, events, http, and more
|
|
8
8
|
- **camelCase members** - TypeScript-friendly naming conventions
|
|
9
|
-
- **
|
|
9
|
+
- **Primitive aliases** - `int`, `long`, `decimal`, etc. via `@tsonic/core`
|
|
10
10
|
- **Full type safety** - Complete TypeScript declarations
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
npm install @tsonic/nodejs @tsonic/
|
|
15
|
+
npm install @tsonic/nodejs @tsonic/dotnet @tsonic/core
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -20,7 +20,7 @@ npm install @tsonic/nodejs @tsonic/types
|
|
|
20
20
|
### File System
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
import
|
|
23
|
+
import { fs } from "@tsonic/nodejs/index.js";
|
|
24
24
|
|
|
25
25
|
// Read file
|
|
26
26
|
const content = fs.readFileSync("./package.json", "utf-8");
|
|
@@ -32,9 +32,9 @@ fs.writeFileSync("./output.txt", "Hello from Tsonic!");
|
|
|
32
32
|
### Path Operations
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
|
-
import
|
|
35
|
+
import { path } from "@tsonic/nodejs/index.js";
|
|
36
36
|
|
|
37
|
-
const fullPath = path.join(
|
|
37
|
+
const fullPath = path.join("config", "settings.json");
|
|
38
38
|
const ext = path.extname(fullPath); // ".json"
|
|
39
39
|
const dir = path.dirname(fullPath);
|
|
40
40
|
```
|
|
@@ -42,7 +42,7 @@ const dir = path.dirname(fullPath);
|
|
|
42
42
|
### Events
|
|
43
43
|
|
|
44
44
|
```typescript
|
|
45
|
-
import
|
|
45
|
+
import { EventEmitter } from "@tsonic/nodejs/index.js";
|
|
46
46
|
|
|
47
47
|
class MyEmitter extends EventEmitter {}
|
|
48
48
|
const emitter = new MyEmitter();
|
|
@@ -52,7 +52,7 @@ emitter.on("data", (chunk) => console.log(chunk));
|
|
|
52
52
|
### HTTP
|
|
53
53
|
|
|
54
54
|
```typescript
|
|
55
|
-
import
|
|
55
|
+
import { http } from "@tsonic/nodejs/nodejs.Http.js";
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## Naming Conventions
|
|
@@ -60,7 +60,7 @@ import type { HttpServer, HttpRequest, HttpResponse } from "@tsonic/nodejs/nodej
|
|
|
60
60
|
- **Types**: PascalCase (matches .NET)
|
|
61
61
|
- **Members**: camelCase (TypeScript convention)
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
To generate CLR/PascalCase member names, regenerate with `--naming clr` (or omit `--naming js`).
|
|
64
64
|
|
|
65
65
|
## Development
|
|
66
66
|
|