# @rdfjs/term-map

> Map for RDF/JS Terms keys

Latest version **2.0.2** (published 2024-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rdfjs/term-map
pnpm add @rdfjs/term-map
yarn add @rdfjs/term-map
bun add @rdfjs/term-map
```

## Health

**Score 43/100 (D)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2024-06-02 |
| First published | 2020-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/rdfjs__term-map) |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 16.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Thomas Bergwinkl |
| Maintainers | bergos |
| Keywords | map, rdf, rdfjs, term |

## Links

- npm: https://www.npmjs.com/package/@rdfjs/term-map
- Repository: https://github.com/rdfjs-base/term-map
- Issues: https://github.com/rdfjs-base/term-map/issues
- npm.io page: https://npm.io/package/@rdfjs/term-map

## Dependencies (1)

- [@rdfjs/to-ntriples](https://npm.io/package/@rdfjs/to-ntriples.md) ^3.0.1

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2024-06-02
- 2.0.1 — 2024-02-09
- 2.0.0 — 2021-12-23
- 1.1.0 — 2021-07-01
- 1.0.1 — 2021-05-11
- 1.0.0 — 2020-05-07

## README

# @rdfjs/term-map
[![build status](https://img.shields.io/github/actions/workflow/status/rdfjs-base/term-map/test.yaml?branch=master)](https://github.com/rdfjs-base/term-map/actions/workflows/test.yaml)
[![npm version](https://img.shields.io/npm/v/@rdfjs/term-map.svg)](https://www.npmjs.com/package/@rdfjs/term-map)

A Map for RDF/JS Terms keys.

This package implements the JavaScript Map interface exclusively for RDF/JS Terms keys and treats Terms with the same N-Triples representation as they are the same object.

## Usage

The package exports the constructor of the Term-Map.
New instances can be created just like JavaScript Maps:

```js
import rdf from '@rdfjs/data-model'
import TermMap from '@rdfjs/term-map'

const terms = new TermMap([
  [rdf.namedNode('http://example.org/'), { data: 1 }],
  [rdf.literal('test'), { data: 2 }]
])

// The rdf factory will return a new instance of the literal,
// but the TermMap will check for the N-Triple representation.
// That's why the output will be: "true"
console.log(terms.has(rdf.literal('test')))
```

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