# @gemeentenijmegen/utils

> A library of utilities used by the municipality of Nijmegen.

Latest version **0.0.38** (published 2025-10-02) · EUPL-1.2 license · 0 weekly downloads

## Install

```sh
npm install @gemeentenijmegen/utils
pnpm add @gemeentenijmegen/utils
yarn add @gemeentenijmegen/utils
bun add @gemeentenijmegen/utils
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.38 |
| Published | 2025-10-02 |
| First published | 2022-06-14 |
| Weekly downloads | 0 |
| License | EUPL-1.2 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 67.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Maintainers | jvanderborg, martijnvdijk, bramwithaar, marnixdessing, wkremer |

## Links

- npm: https://www.npmjs.com/package/@gemeentenijmegen/utils
- Repository: https://github.com/GemeenteNijmegen/modules-utils
- Homepage: https://github.com/GemeenteNijmegen/modules-utils#readme
- Issues: https://github.com/GemeenteNijmegen/modules-utils/issues
- npm.io page: https://npm.io/package/@gemeentenijmegen/utils

## Dependencies (5)

- [@types/aws-lambda](https://npm.io/package/@types/aws-lambda.md) ^8.10.153
- [@aws-sdk/client-s3](https://npm.io/package/@aws-sdk/client-s3.md) ^3.901.0
- [@aws-sdk/client-ssm](https://npm.io/package/@aws-sdk/client-ssm.md) ^3.901.0
- [@aws-sdk/s3-request-presigner](https://npm.io/package/@aws-sdk/s3-request-presigner.md) ^3.901.0
- [@aws-sdk/client-secrets-manager](https://npm.io/package/@aws-sdk/client-secrets-manager.md) ^3.901.0

## Recent versions

- 0.0.38 (latest) — 2025-10-02
- 0.0.37 — 2025-09-22
- 0.0.36 — 2025-08-19
- 0.0.35 — 2025-07-24
- 0.0.34 — 2025-07-11
- 0.0.33 — 2025-06-18
- 0.0.32 — 2025-05-20
- 0.0.31 — 2025-05-06
- 0.0.30 — 2025-04-17
- 0.0.29 — 2025-04-17
- 0.0.28 — 2025-04-16
- 0.0.27 — 2025-04-03
- 0.0.26 — 2025-03-03
- 0.0.25 — 2025-02-05
- 0.0.24 — 2025-01-27
- … 19 more at https://npm.io/package/@gemeentenijmegen/utils/versions

## README

# Nijmegen Utils

A library of utilities used by the municipality of Nijmegen.

## Available utilities:
- [BSN validator](#bsn)
- [AWS utilities](#aws)

### BSN 
A convenience class wrapping a BSN-number. It validates them on creation, ensuring that further use of the BSN is safe. Useage:

```ts
const { Bsn } = require('@gemeentenijmegen/utils');

try {
    const myBsn = new Bsn('999996708');
    doSomethingWith(myBsn.bsn);
} catch (err) {
    console.error('The BSN wasn't valid');
}
```


### AWS
A utility with two methods `getParameter(name: string)` and `getSecret(arn: string)` for fetching parameters and secret strings from the parameter store or secret manager. Both functions return a promise.

```ts
const { AWS } = require('@gemeentenijmegen/utils');
const param = await AWS.getParameter('/cdk/path/to/ssm/param/');
const secret = await AWS.getSecret('/cdk/path/to/secrets/manager/secret');
```

### Storage
A way to interact with storage. For now only an 'S3' implementation `S3Storage` is available, for working with S3, and S3 compatible API's. It adds methods for storing, copying (between buckets, regions) retrieving and generating presigned URL's.

```ts
import 'S3Storage' from '@gemeentenijmegen/utils';
const storage = new S3Storage('bucketname');
storage.store('somekey', 'somevalue');
storage.get('somekey');`
storage.copy('sourcebucket', 'sourcekey', 'destinationbucket', 'destinationkey');
```

---
_Source: https://npm.io/package/@gemeentenijmegen/utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
