Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
docs: blockquote, avoid scroll & add defs links
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken committed Jul 31, 2024
1 parent 25ecd7f commit ff7fcd0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,27 @@ assert.deepEqual(configurationPayload, memoizedPayload);
## API

> If `undefined` the location will be assigned to `process.cwd()`.
> [!NOTE]
> If `undefined`, the location will be assigned to `process.cwd()`.
### read(location?: string, options?: readOptions): Promise< Result< RC, NodeJS.ErrnoException > >

```ts
interface createReadOptions {
/**
* If enabled the file will be created if it does not exist on the disk.
* If enabled, the file will be created if it does not exist on disk.
*
* @default false
*/
createIfDoesNotExist?: boolean;
/**
* RC Generation mode. This option allows to generate a more or less complete configuration for some NodeSecure tools.
* Generate a more or less complete configuration.
*
* @default `minimal`
*/
createMode?: RCGenerationMode | RCGenerationMode[];
/**
* RC automatic caching option. This option allows to cache a configuration passed in parameter.
* Automatically cache the configuration when enabled.
*
* @default false
*/
Expand Down Expand Up @@ -220,16 +221,25 @@ await RC.read(void 0, { createMode: ["ci", "report"] });

## JSON Schema

The runtime configuration is validated with a JSON Schema: `./src/schema/nodesecurerc.json`.
The runtime configuration is validated using a JSON Schema: `./src/schema/nodesecurerc.json`.

It can be retrieved by API if required:
It can be retrieved via API if needed:

```ts
import * as RC from "@nodesecure/rc";

console.log(RC.JSONSchema);
```

The JSON schema is a composition of multiple definitions for each tool:

- [ci](./src/schema/defs/ci.json)
- [ciWarnings](./src/schema/defs/ciWarnings.json)
- [contact](./src/schema/defs/contact.json)
- [report](./src/schema/defs/report.json)
- [reportChart](./src/schema/defs/reportChart.json)
- [scanner](./src/schema/defs/scanner.json)

## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
Expand Down

0 comments on commit ff7fcd0

Please sign in to comment.