@dotsec/core 5.0.0-feat-napi-bindings.19663d1 → 5.0.0-feat-napi-bindings.1696479
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 +60 -0
- package/package.json +13 -8
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @dotsec/core
|
|
2
|
+
|
|
3
|
+
Native Node.js bindings for [dotsec](https://github.com/jpwesselink/dotsec-rs) — parse, validate, and format `.env` files with directive support.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @dotsec/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { parse, validate, toJson, format } from '@dotsec/core';
|
|
15
|
+
|
|
16
|
+
// Parse .env content into structured entries
|
|
17
|
+
const entries = parse(`
|
|
18
|
+
# @encrypt
|
|
19
|
+
DB_URL="postgres://localhost"
|
|
20
|
+
DEBUG=true
|
|
21
|
+
`);
|
|
22
|
+
// [
|
|
23
|
+
// { key: "DB_URL", value: "postgres://localhost", quoteType: "Double", directives: [{ name: "encrypt" }] },
|
|
24
|
+
// { key: "DEBUG", value: "true", quoteType: "None", directives: [] }
|
|
25
|
+
// ]
|
|
26
|
+
|
|
27
|
+
// Validate directives and values
|
|
28
|
+
const errors = validate('# @bogus\nFOO="bar"\n');
|
|
29
|
+
// [{ key: "FOO", message: "unknown directive @bogus..." }]
|
|
30
|
+
|
|
31
|
+
// Convert to JSON
|
|
32
|
+
const json = toJson('FOO=bar\nPORT=3000\n');
|
|
33
|
+
// '[{"FOO":"bar"},{"PORT":"3000"}]'
|
|
34
|
+
|
|
35
|
+
// Roundtrip format
|
|
36
|
+
const formatted = format('FOO=bar\n');
|
|
37
|
+
// 'FOO=bar\n'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Supported directives
|
|
41
|
+
|
|
42
|
+
- `@encrypt` / `@plaintext` — mark variables for encryption
|
|
43
|
+
- `@default-encrypt` / `@default-plaintext` — file-level defaults
|
|
44
|
+
- `@type=string|number|boolean|enum("a","b")` — value type validation
|
|
45
|
+
- `@push=aws-ssm|aws-secrets-manager` — push targets with options
|
|
46
|
+
- `@provider`, `@key-id`, `@region` — file-level encryption config
|
|
47
|
+
|
|
48
|
+
See the [full documentation](https://jpwesselink.github.io/dotsec-rs/beta/guide/directives.html) for details.
|
|
49
|
+
|
|
50
|
+
## Platforms
|
|
51
|
+
|
|
52
|
+
Pre-built binaries are available for:
|
|
53
|
+
|
|
54
|
+
- macOS (ARM64, x64)
|
|
55
|
+
- Linux (ARM64, x64, glibc)
|
|
56
|
+
- Windows (ARM64, x64)
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT — [github.com/jpwesselink/dotsec-rs](https://github.com/jpwesselink/dotsec-rs)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotsec/core",
|
|
3
|
-
"version": "5.0.0-feat-napi-bindings.
|
|
3
|
+
"version": "5.0.0-feat-napi-bindings.1696479",
|
|
4
4
|
"description": "Native Node.js bindings for dotsec — parse, validate, and format .env files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -18,15 +18,20 @@
|
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"index.js",
|
|
21
|
-
"index.d.ts"
|
|
21
|
+
"index.d.ts",
|
|
22
|
+
"README.md"
|
|
22
23
|
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/jpwesselink/dotsec-rs"
|
|
27
|
+
},
|
|
23
28
|
"optionalDependencies": {
|
|
24
|
-
"@dotsec/core-darwin-arm64": "5.0.0-feat-napi-bindings.
|
|
25
|
-
"@dotsec/core-darwin-x64": "5.0.0-feat-napi-bindings.
|
|
26
|
-
"@dotsec/core-linux-x64-gnu": "5.0.0-feat-napi-bindings.
|
|
27
|
-
"@dotsec/core-linux-arm64-gnu": "5.0.0-feat-napi-bindings.
|
|
28
|
-
"@dotsec/core-win32-x64-msvc": "5.0.0-feat-napi-bindings.
|
|
29
|
-
"@dotsec/core-win32-arm64-msvc": "5.0.0-feat-napi-bindings.
|
|
29
|
+
"@dotsec/core-darwin-arm64": "5.0.0-feat-napi-bindings.1696479",
|
|
30
|
+
"@dotsec/core-darwin-x64": "5.0.0-feat-napi-bindings.1696479",
|
|
31
|
+
"@dotsec/core-linux-x64-gnu": "5.0.0-feat-napi-bindings.1696479",
|
|
32
|
+
"@dotsec/core-linux-arm64-gnu": "5.0.0-feat-napi-bindings.1696479",
|
|
33
|
+
"@dotsec/core-win32-x64-msvc": "5.0.0-feat-napi-bindings.1696479",
|
|
34
|
+
"@dotsec/core-win32-arm64-msvc": "5.0.0-feat-napi-bindings.1696479"
|
|
30
35
|
},
|
|
31
36
|
"publishConfig": {
|
|
32
37
|
"access": "public"
|