Skip to content

Commit

Permalink
Merge pull request #2 from ianacaburian/develop
Browse files Browse the repository at this point in the history
Improved readme.
  • Loading branch information
ianacaburian authored Oct 3, 2024
2 parents 5ed2286 + 0beb7f6 commit cb76518
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

Ports juce_KeyGeneration::generateKeyFile() to node.

# Installation
![master build status](https://github.com/ianacaburian/generate-key-file/actions/workflows/build.yml/badge.svg?branch=master)
[![npm version](https://badge.fury.io/js/@ianacaburian%2Fgenerate-key-file.svg)](https://badge.fury.io/js/@ianacaburian%2Fgenerate-key-file)
![GitHub License](https://img.shields.io/github/license/ianacaburian/generate-key-file)
![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ianacaburian)

## Installation

```
npm i @ianacaburian/generate-key-file
```

# Usage
## Usage

### `generateKeyFile(params: GenerateKeyFileParams, date: Date = new Date()) => string`
- `generateKeyFile(params: GenerateKeyFileParams, date: Date = new Date()) => string`

```
import { generateKeyFile } from '@ianacaburian/generate-key-file'
Expand All @@ -24,6 +29,10 @@ const keyFileContent = generateKeyFile({
})
```

- Returns the <key> string value to be used in the XML response for decryption
by the client.
- Throws ZodError for invalid params -- see
[zod](https://github.com/colinhacks/zod).
- From juce_KeyFileGeneration.h:

```
Expand All @@ -45,12 +54,7 @@ const keyFileContent = generateKeyFile({
*/
```

- Returns the <key> string value to be used in the XML response for decryption
by the client.
- Throws ZodError for invalid params -- see
[zod](https://github.com/colinhacks/zod).

### `generateExpiringKeyFile(params: GenerateExpiringKeyFileParams, date: Date = new Date()) => string`
- `generateExpiringKeyFile(params: GenerateExpiringKeyFileParams, date: Date = new Date()) => string`

```
import { generateExpiringKeyFile } from '@ianacaburian/generate-key-file'
Expand All @@ -66,6 +70,10 @@ const expiringKeyFileContent = generateExpiringKeyFile({
})
```

- Returns the <key> string value to be used in the XML response for decryption
by the client.
- Throws ZodError for invalid params -- see
[zod](https://github.com/colinhacks/zod).
- From juce_KeyFileGeneration.h:

```
Expand All @@ -80,20 +88,15 @@ const expiringKeyFileContent = generateExpiringKeyFile({
*/
```

- Returns the <key> string value to be used in the XML response for decryption
by the client.
- Throws ZodError for invalid params -- see
[zod](https://github.com/colinhacks/zod).

# Development
## Development

```
npm run clean # Clean dist and test builds (inc test bins).
npm run lint # Lint the src dir.
npm run build # Lint, install tests, and build package.
```

## Testing
### Testing

```
npm run test # Start vitest to run all tests.
Expand Down

0 comments on commit cb76518

Please sign in to comment.