@nldoc/api-client
TypeScript icon, indicating that this package has built-in type declarations

2.0.102 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @nldoc/api-client

Weekly Downloads

481

Version

2.0.102

License

EUPL-1.2

Unpacked Size

40.6 kB

Total Files

21

Last publish

Collaborators

  • stephanmeijer
  • dthoek
  • rawodo