@nldoc/api-client
v2.0.118
Published
Client for NLdoc's API
Downloads
246
Readme
NLdoc API Client
This repository contains the API client for the NLdoc API.
Installation
Run:
npm install @nldoc/api-clientUsage
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 testLicense
See LICENSE.txt for the license of this repository.
