A thin wrapper around `openapi-fetch` for use with the CTAN API
npm install ctan-openapi-fetch> A thin wrapper around openapi-fetch for use with the CTAN API
[![npm][npm-badge]](https://www.npmjs.com/package/ctan-openapi-fetch)
This package re-exports [openapi-fetch]'s factory functions
with some defaults for use with the CTAN API,
along with types pre-generated by [openapi-typescript],
allowing for easy use of type-safe CTAN clients.
[npm-badge]: https://img.shields.io/npm/v/ctan-openapi-fetch?logo=npm&logoColor=959da5&labelColor=2e353b&color=c40000
[openapi-fetch]: https://www.npmjs.com/package/openapi-fetch
[openapi-typescript]: https://www.npmjs.com/package/openapi-typescript
``console`
$ npm install ctan-openapi-fetch
`typescript
import { createClient } from 'ctan-openapi-fetch/json-2.0';
const ctan = createClient();
const { data } = await ctan.GET('/pkg/{key}', {
params: {
path: {
key: 'texlive',
},
},
});
console.dir(data);
// {
// id: 'texlive',
// name: 'texlive',
// aliases: [],
// caption: 'A comprehensive distribution of TeX and friends',
// ...
``
For detailed usage of the factory functions and clients, please refer
to the openapi-fetch documentation.