# @odata2ts/converter-api

> The converter API establishes a contract between odata2ts and converter implementations

Latest version **0.3.0** (published 2026-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @odata2ts/converter-api
pnpm add @odata2ts/converter-api
yarn add @odata2ts/converter-api
bun add @odata2ts/converter-api
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2026-08-06 |
| First published | 2022-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | texttechne |
| Maintainers | texttechne |
| Keywords | odata2ts, odata, converter, api, typescript, ts, javascript, js, types, data types |

## Links

- npm: https://www.npmjs.com/package/@odata2ts/converter-api
- Repository: git@github.com:odata2ts/converter.git
- npm.io page: https://npm.io/package/@odata2ts/converter-api

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.3.0 (latest) — 2026-08-06
- 0.2.6 — 2025-02-08
- 0.2.5 — 2025-02-08
- 0.2.3 — 2024-12-18
- 0.2.2 — 2024-08-25
- 0.2.1 — 2024-08-24
- 0.2.0 — 2024-08-13
- 0.1.2 — 2023-04-08
- 0.1.1 — 2023-01-07
- 0.1.0 — 2022-12-18

## README

[![npm (scoped)](https://img.shields.io/npm/v/@odata2ts/converter-api?style=for-the-badge)](https://www.npmjs.com/package/@odata2ts/converter-api)

# odata2ts Converter API

Defines the API of converters and converter packages as they are used in
[`@odata2ts`](https://github.com/odata2ts/odata2ts).

As an API this module only consists of interfaces, which you should implement when writing your own converters.

Additionally, converter modules need to follow certain conventions, which are listed here.

## Introduction

Consumers of an OData service need to handle the data types known to OData and in this regard
also need to take into account which OData version is used, because there are quite some
differences between V2 and V4.

Converters allow to use a different representation for a given data type by converting
from and to the OData type. For example, the type `Edm.DateTimeOffset` represents a certain
point in time by using the ISO 8601 DateTime format; we might want to use a JS Date object
instead. So the converter would do the following conversions:

- convert from the OData type to JS Date
- convert from JS Date to the OData type

With the help of converters the consumer then only needs to handle JS date objects.
Furthermore, converters can also remedy the different representations of V2 and V4
(see [@odata2ts/v2-to-v4-converter](https://www.npmjs.com/package/@odata2ts/converter-v2-to-v4)).

## Documentation

[Converter Documentation](https://odata2ts.github.io/docs/generator/converters)

Main Documentation of odata2ts: [https://odata2ts.github.io/](https://odata2ts.github.io/)

## Support, Feedback, Contributing

This project is open to feature requests, suggestions, bug reports, usage questions etc.
via [GitHub issues](https://github.com/odata2ts/converter/issues).

Contributions and feedback are encouraged and always welcome.

See the [contribution guidelines](https://github.com/odata2ts/converter/blob/main/CONTRIBUTING.md) for further information.

## Spirit

This project has been created and is maintained in the following spirit:

- adhere to the **OData specification** as much as possible
  - support any OData service implementation which conforms to the spec
  - allow to work around faulty implementations if possible
- stability matters
  - exercise Test Driven Development
  - bomb the place with unit tests (code coverage > 95%)
  - ensure that assumptions & understanding are correct by creating integration tests

## License

MIT - see [License](./LICENSE).

---
_Source: https://npm.io/package/@odata2ts/converter-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
