# @blockquote-web-components/blockquote-base-meta

> A modern architecture for building composable and reusable Web Components

Latest version **1.5.36** (published 2026-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @blockquote-web-components/blockquote-base-meta
pnpm add @blockquote-web-components/blockquote-base-meta
yarn add @blockquote-web-components/blockquote-base-meta
bun add @blockquote-web-components/blockquote-base-meta
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.5.36 |
| Published | 2026-08-15 |
| First published | 2022-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 25.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3 |
| Author | Blockquote |
| Maintainers | oscarmarina |
| Keywords | lit, web-component, lit-element |

## Links

- npm: https://www.npmjs.com/package/@blockquote-web-components/blockquote-base-meta
- Repository: https://github.com/oscarmarina/blockquote-web-components
- Homepage: https://github.com/oscarmarina/blockquote-web-components#readme
- Issues: https://github.com/oscarmarina/blockquote-web-components/issues
- npm.io page: https://npm.io/package/@blockquote-web-components/blockquote-base-meta

## Dependencies (1)

- [lit](https://npm.io/package/lit.md) ^3.3.3

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.5.36 (latest) — 2026-08-15
- 1.5.35 — 2026-07-10
- 1.5.34 — 2026-07-09
- 1.5.33 — 2026-06-13
- 1.5.32 — 2026-05-23
- 1.5.31 — 2026-05-23
- 1.5.30 — 2026-03-15
- 1.5.29 — 2026-03-14
- 1.5.28 — 2026-02-11
- 1.5.27 — 2026-02-08
- 1.5.26 — 2026-01-10
- 1.5.25 — 2025-11-14
- 1.5.24 — 2025-11-02
- 1.5.23 — 2025-09-27
- 1.5.22 — 2025-09-03
- … 70 more at https://npm.io/package/@blockquote-web-components/blockquote-base-meta/versions

## README

![Lit](https://img.shields.io/badge/lit-3.0.0-blue.svg)

`BlockquoteBaseMeta` is a generic class for sharing information across the DOM tree, inspired by Polymer's [`iron-meta`](https://github.com/PolymerElements/iron-meta/blob/master/iron-meta.js).
It employs the [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) to allow any instance to access the shared information.

The class instances hold the actual data. They must be created before attempting to access them.

`BlockquoteBaseMeta` uses a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) to store the data. Unlike an Object, a Map allows keys of any type.

### Demo

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/oscarmarina/blockquote-web-components/tree/main/packages/base/blockquote-base-meta)

#### Usage

```js
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';

const myDefault = new BlockquoteBaseMeta({
  key: 'basic',
  value: 'foo/bar',
});

console.log(myDefault.byKey('basic')); // foo/bar
```

#### Value Getter - String

```js
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';

const myDefault = new BlockquoteBaseMeta({
  key: 'basic',
  value: 'foo/bar',
});

console.log(myDefault.value); // foo/bar
```

#### List Getter - Array

The `list` getter returns an array of all values stored in the `BlockquoteBaseMeta` instance.

```js
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';

const myDefault = new BlockquoteBaseMeta({
  type: 'three',
  key: 'basic',
  value: 'foo/bar',
});

console.log(myDefault.list); // ['foo/bar']
```

#### ObjectList Getter - Object

```js
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';

const myDefault = new BlockquoteBaseMeta({
  type: 'one',
  key: 'basic',
  value: 'foo/bar',
});

console.log(myDefault.objectList); // {basic: 'foo/bar'}
```

#### MapList Getter - Map

```js
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';

const keyInfo = { id: 'dsfaskj0' };
const myDefault = new BlockquoteBaseMeta({
  type: 'two',
  key: keyInfo,
  value: 'foo/bar',
});

console.log(myDefault.mapList); // Map(1) { { id: 'dsfaskj0' } => 'foo/bar' }
```


### `src/BlockquoteBaseMeta.ts`:

#### class: `BlockquoteBaseMeta`

##### Static Fields

| Name    | Privacy | Type                                  | Default | Description | Inherited From |
| ------- | ------- | ------------------------------------- | ------- | ----------- | -------------- |
| `types` |         | `Map<unknown, Map<unknown, unknown>>` |         |             |                |
| `uuid`  |         | `string`                              |         |             |                |

##### Fields

| Name         | Privacy | Type                      | Default | Description                                                     | Inherited From |
| ------------ | ------- | ------------------------- | ------- | --------------------------------------------------------------- | -------------- |
| `type`       |         | `unknown`                 | `type`  | Type of Meta                                                    |                |
| `key`        |         | `unknown`                 | `key`   | Key for Meta                                                    |                |
| `value`      |         | `unknown`                 |         | Sets value to instance type and key                             |                |
| `list`       |         | `unknown[]`               |         | Returns a list (Array) of the values for that instance \`type\` |                |
| `mapList`    |         | `Map<unknown, unknown>`   |         | Returns a list (Map) for that instance \`type\`                 |                |
| `objectList` |         | `Record<string, unknown>` |         | Returns a list (Object) for that instance \`type\`              |                |

##### Methods

| Name    | Privacy | Description                                                      | Parameters     | Return    | Inherited From |
| ------- | ------- | ---------------------------------------------------------------- | -------------- | --------- | -------------- |
| `byKey` |         | Returns the value of the provided key for that instance \`type\` | `key: unknown` | `unknown` |                |

<details><summary>Private API</summary>

##### Fields

| Name    | Privacy | Type      | Default | Description | Inherited From |
| ------- | ------- | --------- | ------- | ----------- | -------------- |
| `__key` | private | `unknown` |         |             |                |

</details>

<hr/>

#### Exports

| Kind | Name                 | Declaration        | Module                    | Package |
| ---- | -------------------- | ------------------ | ------------------------- | ------- |
| `js` | `BlockquoteBaseMeta` | BlockquoteBaseMeta | src/BlockquoteBaseMeta.ts |         |

### `src/index.ts`:

#### Exports

| Kind | Name                 | Declaration        | Module                  | Package |
| ---- | -------------------- | ------------------ | ----------------------- | ------- |
| `js` | `BlockquoteBaseMeta` | BlockquoteBaseMeta | ./BlockquoteBaseMeta.js |         |

---
_Source: https://npm.io/package/@blockquote-web-components/blockquote-base-meta · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
