# @rdfjs/types

> Authoritative TypeScript typings for all RDF/JS specifications

Latest version **2.0.1** (published 2025-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rdfjs/types
pnpm add @rdfjs/types
yarn add @rdfjs/types
bun add @rdfjs/types
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2025-01-14 |
| First published | 2021-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 40.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | RDF/JS Representation Task Force |
| Maintainers | rdfjsbot |
| Keywords | rdf, rdf/js, rdfjs, typescript |

## Links

- npm: https://www.npmjs.com/package/@rdfjs/types
- Repository: https://github.com/rdfjs/types
- Homepage: http://rdf.js.org/
- Issues: https://github.com/rdfjs/types/issues
- npm.io page: https://npm.io/package/@rdfjs/types

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2025-01-14
- 1.1.0-next.1 (next) — 2022-02-04
- 2.0.0 — 2025-01-08
- 1.1.2 — 2024-09-18
- 1.1.1 — 2024-09-17
- 1.1.0 — 2022-02-17
- 1.1.0-next.0 — 2022-02-03
- 1.0.1 — 2021-06-03
- 1.0.0 — 2021-05-31

## README

# RDF/JS Types

Authoritative TypeScript typings for all RDF/JS specifications

The types should match the RDF/JS specifications ([Data Model](https://rdf.js.org/data-model-spec/), [Dataset](https://rdf.js.org/dataset-spec/) and [Stream](https://rdf.js.org/stream-spec/)). However, because they also take advantage of TypecScript-specific syntax features, some differences are inevitable. If something does not add up, please open an [issue](#contributing).

## Usage

Installed as usual using your favourite package manager.

```
yarn add @rdfjs/types
```

This package does not provide code, only interafces for the RDF/JS specifications. Import them to strong-type your RDF/JS code.

```typescript
import type { NamedNode, DatasetCore, Stream } from '@rdfjs/types'
```

Or import separately from type modules corresponding the specifications.

```typescript
import type { NamedNode } from '@rdfjs/types/data-model'
import type { DatasetCore } from '@rdfjs/types/dataset'
import type { Stream } from '@rdfjs/types/stream'
``````

## Additional Types

Note that some helper types exist that do not exist within the RDF/JS specifications. These include:

```typescript
import type { TripleTermName, QuadTermName } from '@rdfjs/types'
```

## Contributing

Everyone is invited to open issues and pull requests. When you create a PR, please add or update the `rdf-js-tests.ts` file to reflect your changes.

You may also create a [changeset](https://github.com/atlassian/changesets) file by running `npx run changeset` and following the simple wizard. If you don't do that, such as in the case when editing from your browser, do not worry. A maintainer can also create it for you when you open a PR.

## What about @types/rdf-js?

This package replaces typings previously managed in the [DefinitelyTyped repository](https://npm.im/@types/rdf-js) and a later proxy package [rdf-js](https://npm.im/rdf-js).

Both these old packages are deprecated. They will continue to work for backwards compatibility but library maintainers are encouraged to use `@rdfjs/types` instead.

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