This repository contains the API client for the NLdoc API.
Run:
npm install @nldoc/api-client
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) => {
// ...
})
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.
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
See LICENSE.txt for the license of this repository.