# @codaco/shared-consts

> Shared constants and typescript definitions for the Network Canvas project.

Latest version **6.0.0** (published 2026-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @codaco/shared-consts
pnpm add @codaco/shared-consts
yarn add @codaco/shared-consts
bun add @codaco/shared-consts
```

## 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 | 6.0.0 |
| Published | 2026-08-31 |
| First published | 2022-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.0.0 |
| Dependencies | 1 |
| Unpacked size | 79.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2 |
| Author | Complex Data Collective <hello@complexdatacollective.org> |
| Maintainers | jthrilly, buckhalt |
| Keywords | library, typescript |

## Links

- npm: https://www.npmjs.com/package/@codaco/shared-consts
- Repository: https://github.com/complexdatacollective/network-canvas-monorepo
- npm.io page: https://npm.io/package/@codaco/shared-consts

## Dependencies (1)

- [zod](https://npm.io/package/zod.md) ^4.4.3

## 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

- 6.0.0 (latest) — 2026-08-31
- 3.0.0 (alpha) — 2025-06-19
- 5.6.1 — 2026-08-05
- 5.6.0 — 2026-07-31
- 5.5.0 — 2026-07-15
- 5.4.0 — 2026-07-03
- 5.3.0 — 2026-06-26
- 5.2.0 — 2026-06-05
- 5.1.0 — 2026-05-20
- 5.0.0 — 2025-09-01
- 4.0.0 — 2025-06-19
- 1.0.0-alpha.3 — 2025-04-30
- 1.0.0-alpha.2 — 2025-04-04
- 1.0.0-alpha.1 — 2025-03-31
- 1.0.0-alpha.0 — 2025-03-06
- … 7 more at https://npm.io/package/@codaco/shared-consts/versions

## README

# `@codaco/shared-consts`

Shared constants, runtime schemas, and TypeScript types used across Network
Canvas.

## Sparse entity attributes

`NcEntity`, `NcNode`, `NcEdge`, `NcEgo`, and `NcNetwork` expose a strict output
contract: every own property in an entity's `attributes` record contains a
defined `VariableValue`. A missing property is the only representation of an
unset variable.

`VariableValueSchema` and `VariableValue` support strings, booleans, numbers,
arrays of primitive values, encrypted number arrays, and `{ x, y }` layout
coordinates. They do not accept `null` or `undefined`. Defined empty values are
data, not absence, so writers and normalizers must preserve all of these:

```ts
{
  optedIn: false,
  count: 0,
  note: '',
  selections: [],
}
```

Do not create placeholder properties for unanswered variables:

```ts
// Correct: `nickname` is unset.
const attributes = {};

// Incorrect output: nullish values are not VariableValue values.
const attributes = { nickname: null };
```

## Input compatibility and strict output

Use `NcNetworkSchema.parse(input)` at persistence, synchronization, and other
untrusted-data boundaries. Its input accepts `null` and `undefined` attribute
entries, then omits those properties from every ego, node, and edge attribute
record. It preserves `false`, `0`, `''`, `[]`, and defined attributes not
declared by the current codebook.

The distinction between input and output is intentional:

```ts
const network: NcNetwork = NcNetworkSchema.parse(storedValue);
// network attributes are now Record<string, VariableValue>
```

Code that already has an `NcNetwork` must not write nullish values. Code that
accepts stored or external data must parse it before exposing the public output
types. `StageMetadataSchema` applies the same sparse normalization to Family
Pedigree edge attribute snapshots.

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