• TypeScript 99%
  • JavaScript 1%
Find a file
DigiToegankelijk NLdoc baf52dfe18 chore: set .editorconfig
2025-11-19 09:38:19 +00:00
.vscode feat: api client code 2025-05-06 20:28:32 +02:00
src chore: add type annotation 2025-07-30 15:18:46 +02:00
.dockerignore feat: api client code 2025-05-06 20:28:32 +02:00
.editorconfig chore: set .editorconfig 2025-11-19 09:38:19 +00:00
.gitignore feat: api client code 2025-05-06 20:28:32 +02:00
.gitlab-ci.yml feat: api client code 2025-05-06 20:28:32 +02:00
.npmignore feat: api client code 2025-05-06 20:28:32 +02:00
.npmrc feat: api client code 2025-05-06 20:28:32 +02:00
.prettierignore chore: fix compatibility issue 2025-07-30 14:48:35 +02:00
CHANGELOG.md chore(release): 2.0.118 2025-09-20 23:41:16 +00:00
CODEOWNERS feat: api client code 2025-05-06 20:28:32 +02:00
eslint.config.mjs feat: api client code 2025-05-06 20:28:32 +02:00
LICENSE chore: initial commit 2025-05-06 20:27:44 +02:00
package-lock.json chore(deps): update dependency @nldoc/configs to v1.4.57 2025-09-23 22:44:02 +00:00
package.json chore(release): 2.0.118 2025-09-20 23:41:16 +00:00
prettier.config.mjs feat: api client code 2025-05-06 20:28:32 +02:00
README.md feat: api client code 2025-05-06 20:28:32 +02:00
renovate.json chore: npm install twice 2025-11-05 14:08:56 +00:00
tsconfig.dist.json feat: api client code 2025-05-06 20:28:32 +02:00
tsconfig.json fix: import of event source 2025-05-08 11:21:21 +02:00
vitest.config.ts feat: api client code 2025-05-06 20:28:32 +02:00
vitest.setup.ts feat: api client code 2025-05-06 20:28:32 +02:00

NLdoc API Client

This repository contains the API client for the NLdoc API.

Installation

Run:

npm install @nldoc/api-client

Usage

import { Client } from '@nldoc/api-client'
import { type Event } from '@nldoc/event-types'

const client = new Client('https://some-api-endpoint.nldoc.nl')

const blob = // ...

const results = await client.convert(blob, 'text/html')
const firstResult = results[0]

const stream = client.createEventStream(firstResult)
stream.subscribe((event: Event) => {
  // ...
})

Development

Project structure

The project is structured as follows:

  • src/: Contains the TypeScript source files.
    • src/**/*.spec.ts: Contains the tests for the TypeScript source files.
    • src/**/*.ts: Contains the actual code.
  • dist/: Contains the compiled JavaScript files.

Testing

The types in this package are tested against the collection of examples (valid and invalid) that were provided in the NLdoc event specification. These examples will be downloaded to the local filesystem on first run of the tests.

To run the tests, run:

$ npm test

License

See LICENSE.txt for the license of this repository.