unix-socket-address 0.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/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luolapeikko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# unix-socket-address
|
|
2
|
+
|
|
3
|
+
## Runtime agnostic core Unix Socket IpAddr class base on Rust implementation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
```bash
|
|
7
|
+
npm i unix-socket-address
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Examples
|
|
11
|
+
```typescript
|
|
12
|
+
const socketAddress = new SocketAddrUnix('/tmp/app.sock');
|
|
13
|
+
const windowsNamedPipeAddress = new SocketAddrUnix('\\\\.\\pipe\\app');
|
|
14
|
+
|
|
15
|
+
server.listen(socketAddress.asNodeListenerOptions())
|
|
16
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/SocketAddrUnix.ts"],"sourcesContent":["/**\n * Represents a Unix domain socket address, consisting of a file system path.\n * @example\n * const socketAddress = new SocketAddrUnix('/tmp/app.sock');\n * const windowsNamedPipeAddress = new SocketAddrUnix('\\\\\\\\.\\\\pipe\\\\app');\n */\nexport class SocketAddrUnix {\n\tpublic readonly family = 'unix';\n\tpublic readonly path: string;\n\n\tpublic constructor(path: string) {\n\t\tthis.path = path;\n\t}\n\n\tpublic asNodeListenerOptions(): {path: string} {\n\t\treturn {\n\t\t\tpath: this.path,\n\t\t};\n\t}\n\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n}\n"],"mappings":"mEAMA,IAAa,EAAb,KAA4B,CAC3B,OAAyB,OACzB,KAEA,YAAmB,EAAc,CAChC,KAAK,KAAO,EAGb,uBAA+C,CAC9C,MAAO,CACN,KAAM,KAAK,KACX,CAGF,UAA0B,CACzB,OAAO,KAAK"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/SocketAddrUnix.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Represents a Unix domain socket address, consisting of a file system path.
|
|
4
|
+
* @example
|
|
5
|
+
* const socketAddress = new SocketAddrUnix('/tmp/app.sock');
|
|
6
|
+
* const windowsNamedPipeAddress = new SocketAddrUnix('\\\\.\\pipe\\app');
|
|
7
|
+
*/
|
|
8
|
+
declare class SocketAddrUnix {
|
|
9
|
+
readonly family = "unix";
|
|
10
|
+
readonly path: string;
|
|
11
|
+
constructor(path: string);
|
|
12
|
+
asNodeListenerOptions(): {
|
|
13
|
+
path: string;
|
|
14
|
+
};
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { SocketAddrUnix };
|
|
19
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/SocketAddrUnix.ts"],"mappings":";;AAMA;;;;;cAAa,cAAA;EAAA,SACI,MAAA;EAAA,SACA,IAAA;EAEhB,WAAA,CAAmB,IAAA;EAInB,qBAAA,CAAA;IAAiC,IAAA;EAAA;EAMjC,QAAA,CAAA;AAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/SocketAddrUnix.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Represents a Unix domain socket address, consisting of a file system path.
|
|
4
|
+
* @example
|
|
5
|
+
* const socketAddress = new SocketAddrUnix('/tmp/app.sock');
|
|
6
|
+
* const windowsNamedPipeAddress = new SocketAddrUnix('\\\\.\\pipe\\app');
|
|
7
|
+
*/
|
|
8
|
+
declare class SocketAddrUnix {
|
|
9
|
+
readonly family = "unix";
|
|
10
|
+
readonly path: string;
|
|
11
|
+
constructor(path: string);
|
|
12
|
+
asNodeListenerOptions(): {
|
|
13
|
+
path: string;
|
|
14
|
+
};
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { SocketAddrUnix };
|
|
19
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/SocketAddrUnix.ts"],"mappings":";;AAMA;;;;;cAAa,cAAA;EAAA,SACI,MAAA;EAAA,SACA,IAAA;EAEhB,WAAA,CAAmB,IAAA;EAInB,qBAAA,CAAA;IAAiC,IAAA;EAAA;EAMjC,QAAA,CAAA;AAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/SocketAddrUnix.ts"],"sourcesContent":["/**\n * Represents a Unix domain socket address, consisting of a file system path.\n * @example\n * const socketAddress = new SocketAddrUnix('/tmp/app.sock');\n * const windowsNamedPipeAddress = new SocketAddrUnix('\\\\\\\\.\\\\pipe\\\\app');\n */\nexport class SocketAddrUnix {\n\tpublic readonly family = 'unix';\n\tpublic readonly path: string;\n\n\tpublic constructor(path: string) {\n\t\tthis.path = path;\n\t}\n\n\tpublic asNodeListenerOptions(): {path: string} {\n\t\treturn {\n\t\t\tpath: this.path,\n\t\t};\n\t}\n\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n}\n"],"mappings":"AAMA,IAAa,EAAb,KAA4B,CAC3B,OAAyB,OACzB,KAEA,YAAmB,EAAc,CAChC,KAAK,KAAO,EAGb,uBAA+C,CAC9C,MAAO,CACN,KAAM,KAAK,KACX,CAGF,UAA0B,CACzB,OAAO,KAAK"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "unix-socket-address",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Unix domain socket address instances",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.mts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"import": {
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
|
+
"default": "./dist/index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"require": {
|
|
14
|
+
"types": "./dist/index.d.cts",
|
|
15
|
+
"default": "./dist/index.cjs"
|
|
16
|
+
},
|
|
17
|
+
"default": "./dist/index.mjs"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsdown src/index.ts --sourcemap --minify --format cjs,esm --dts --clean -c tsconfig.build.json",
|
|
21
|
+
"validate": "tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"repository": "github:luolapeikko/net-address-base",
|
|
27
|
+
"keywords": [
|
|
28
|
+
"network",
|
|
29
|
+
"address",
|
|
30
|
+
"socket"
|
|
31
|
+
],
|
|
32
|
+
"author": "mharj",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/luolapeikko/net-address-base/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/luolapeikko/net-address-base#readme"
|
|
38
|
+
}
|