# @internetarchive/iaux-item-metadata

> Item metadata models for the Internet Archive

Latest version **1.5.0** (published 2026-08-20) · AGPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install @internetarchive/iaux-item-metadata
pnpm add @internetarchive/iaux-item-metadata
yarn add @internetarchive/iaux-item-metadata
bun add @internetarchive/iaux-item-metadata
```

## Health

**Score 70/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2026-08-20 |
| First published | 2025-01-13 |
| Weekly downloads | 0 |
| License | AGPL-3.0-only |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 679.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Internet Archive |
| Maintainers | bfalling, mitraardron, vbanos, kngenie, iisa, cdrini, nsharma123, dualcnhq, latonv, ibnesayeed, tracey.pooh, jim-at-ia, jeffwklein, rebecca-shoptaw, jbuckner, dhallia |

## Links

- npm: https://www.npmjs.com/package/@internetarchive/iaux-item-metadata
- Repository: https://github.com/internetarchive/iaux-item-metadata
- Homepage: https://github.com/internetarchive/iaux-item-metadata#readme
- Issues: https://github.com/internetarchive/iaux-item-metadata/issues
- npm.io page: https://npm.io/package/@internetarchive/iaux-item-metadata

## Dependencies (2)

- [typescript-memoize](https://npm.io/package/typescript-memoize.md) ^1.1.1
- [@internetarchive/field-parsers](https://npm.io/package/@internetarchive/field-parsers.md) ^1.2.0

## Recent versions

- 1.5.0 (latest) — 2026-08-20
- 1.6.0-beta.0 (beta) — 2026-09-23
- 1.1.1-webdev-8572.0 (alpha) — 2026-06-05
- 1.0.7-webdev-7743.0 (canary) — 2025-09-22
- 1.4.0 — 2026-08-03
- 1.3.0 — 2026-07-27
- 1.3.0-beta.0 — 2026-07-06
- 1.2.0 — 2026-07-06
- 1.1.1 — 2026-06-17
- 1.1.0 — 2025-09-25
- 1.0.7-webdev-7550.3 — 2025-08-14
- 1.0.7-webdev-7550.2 — 2025-08-14
- 1.0.7-webdev-7550.1 — 2025-08-13
- 1.0.7-webdev-7550.0 — 2025-08-13
- 1.0.6 — 2025-08-06
- … 13 more at https://npm.io/package/@internetarchive/iaux-item-metadata/versions

## README

![Build Status](https://github.com/internetarchive/iaux-item-metadata/actions/workflows/ci.yml/badge.svg) [![codecov](https://codecov.io/gh/internetarchive/iaux-item-metadata/branch/main/graph/badge.svg?token=ZOYRJ2BV9W)](https://codecov.io/gh/internetarchive/iaux-item-metadata)

# Internet Archive Item Metadata

These are the data models for Internet Archive Metadata. The Metadata models handle automatic conversions between the raw values to native Typescript data types.

When receiving JSON responses from the Internet Archive's metadata service, the values can be strings, numbers, or arrays. These take all of those values and normalizes them.

All fields, except for `identifier`, have 3 properties:
- `.value` to get the first (or only) value in the native type
- `.values` to get all of the values if it's an array in their native types
- `.rawValue` to get the original value from the response

## Demo

[Live demo](https://internetarchive.github.io/iaux-item-metadata/main/) — load any archive.org item by identifier (or paste raw metadata JSON) and inspect the parsed fields.

## Example

```ts
const metadata = new Metadata({
    identifier: 'foo',
    addeddate: '2021-01-01',
    collection: ['foo', 'bar'],
    description: 'A foo that is also a bar',
    duration: '1:23:45',
    mediatype: 'audio',
})

console.log('Raw metadata:', JSON.stringify(metadata.rawMetadata));
// outputs the raw JSON response,
// { identifier: 'foo', addeddate: '2021-01-01', collection: ['foo', 'bar'] .... }

console.log('Identifier', metadata.identifier);
// > 'foo'

console.log('Addeddate', metadata.addeddate.value);
// > Date object (Fri Jan 01 2021 00:00:00 GMT-0800 (Pacific Standard Time))

// get first value of an array of values
console.log('Collection', metadata.collection.value);
// > 'foo'

// get all values of an array
console.log('Collection', metadata.collection.values);
// > ['foo', 'bar']

// duration is in seconds and handles conversions from hh:mm:ss if needed
console.log('Duration', metadata.duration.value);
// > 5025
```

## Local Demo with `web-dev-server`
```bash
npm run start
```
To run a local development server that serves the basic demo located in `demo/index.html`

## Testing with Web Test Runner
To run the suite of Web Test Runner tests, run
```bash
npm run test
```

To run the tests in watch mode (for &lt;abbr title=&#34;test driven development&#34;&gt;TDD&lt;/abbr&gt;, for example), run

```bash
npm run test:watch
```

## Linting with ESLint, Prettier, and Types
To scan the project for linting errors, run
```bash
npm run lint
```

You can lint with ESLint and Prettier individually as well
```bash
npm run lint:eslint
```
```bash
npm run lint:prettier
```

To automatically fix many linting errors, run
```bash
npm run format
```

You can format using ESLint and Prettier individually as well
```bash
npm run format:eslint
```
```bash
npm run format:prettier
```

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