1
1
# rc
2
- ![ version] ( https://img.shields.io/badge/dynamic/json.svg?url=https://raw.githubusercontent.com/NodeSecure/rc/master/package.json&query=$.version&label=Version )
3
- [ ![ Maintenance] ( https://img.shields.io/badge/Maintained%3F-yes-green.svg )] ( https://github.com/NodeSecure/rc/commit-activity )
4
- [ ![ mit] ( https://img.shields.io/github/license/Naereen/StrapDown.js.svg )] ( https://github.com/NodeSecure/rc/blob/master/LICENSE )
2
+
3
+ ![ version] ( https://img.shields.io/badge/dynamic/json.svg?style=for-the-badge&url=https://raw.githubusercontent.com/NodeSecure/rc/master/package.json&query=$.version&label=Version )
4
+ [ ![ Maintenance] ( https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge )] ( https://github.com/NodeSecure/rc/commit-activity )
5
+ [ ![ mit] ( https://img.shields.io/github/license/Naereen/StrapDown.js.svg?style=for-the-badge )] ( https://github.com/NodeSecure/rc/blob/master/LICENSE )
5
6
[ ![ OpenSSF
6
- Scorecard] ( https://api.securityscorecards.dev/projects/github.com/NodeSecure/rc/badge )] ( https://api.securityscorecards.dev/projects/github.com/NodeSecure/rc )
7
- ![ build] ( https://img.shields.io/github/actions/workflow/status/NodeSecure/rc/main.yml )
7
+ Scorecard] ( https://api.securityscorecards.dev/projects/github.com/NodeSecure/rc/badge?style=for-the-badge )] ( https://api.securityscorecards.dev/projects/github.com/NodeSecure/rc )
8
+ ![ build] ( https://img.shields.io/github/actions/workflow/status/NodeSecure/rc/main.yml?style=for-the-badge )
8
9
9
10
NodeSecure runtime configuration.
10
11
11
12
## Requirements
13
+
12
14
- [ Node.js] ( https://nodejs.org/en/ ) v16 or higher
13
15
14
16
## Getting Started
@@ -35,18 +37,17 @@ console.log(configurationPayload);
35
37
```
36
38
37
39
Write:
40
+
38
41
``` ts
39
42
import assert from " node:assert/strict" ;
40
43
import * as RC from " @nodesecure/rc" ;
41
44
42
45
const writeOpts: RC .writeOptions = {
43
46
payload: { version: " 2.0.0" },
44
- partialUpdate: true
47
+ partialUpdate: true ,
45
48
};
46
49
47
- const result = (
48
- await RC .write (void 0 , writeOpts )
49
- ).unwrap ();
50
+ const result = (await RC .write (void 0 , writeOpts )).unwrap ();
50
51
assert .strictEqual (result , void 0 );
51
52
```
52
53
@@ -74,7 +75,10 @@ interface createReadOptions {
74
75
createMode? : RCGenerationMode | RCGenerationMode [];
75
76
}
76
77
77
- export type readOptions = RequireAtLeastOne <createReadOptions , " createIfDoesNotExist" | " createMode" >;
78
+ export type readOptions = RequireAtLeastOne <
79
+ createReadOptions ,
80
+ " createIfDoesNotExist" | " createMode"
81
+ >;
78
82
```
79
83
80
84
The ` createIfDoesNotExist ` argument can be ignored if ` createMode ` is provided.
@@ -146,14 +150,15 @@ Note that you can combine several modes:
146
150
``` ts
147
151
import * as RC from " @nodesecure/rc" ;
148
152
149
- await RC .read (void 0 , { createMode: [" ci" , " report" ] })
153
+ await RC .read (void 0 , { createMode: [" ci" , " report" ] });
150
154
```
151
155
152
156
## JSON Schema
153
157
154
158
The runtime configuration is validated with a JSON Schema: ` ./src/schema/nodesecurerc.json ` .
155
159
156
160
It can be retrieved by API if required:
161
+
157
162
``` ts
158
163
import * as RC from " @nodesecure/rc" ;
159
164
@@ -163,7 +168,9 @@ console.log(RC.JSONSchema);
163
168
## Contributors ✨
164
169
165
170
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
171
+
166
172
[ ![ All Contributors] ( https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square )] ( #contributors- )
173
+
167
174
<!-- ALL-CONTRIBUTORS-BADGE:END -->
168
175
169
176
Thanks goes to these wonderful people ([ emoji key] ( https://allcontributors.org/docs/en/emoji-key ) ):
@@ -185,4 +192,5 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
185
192
<!-- ALL-CONTRIBUTORS-LIST:END -->
186
193
187
194
## License
195
+
188
196
MIT
0 commit comments