Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

Install Grounds packages using npm or pnpm.

Core Package Only

For low-level encoding without schema support:

npm install @grounds/core
# or
pnpm add @grounds/core

For type-safe schema-driven serialization:

npm install @grounds/schema @sinclair/typebox luxon
# or
pnpm add @grounds/schema @sinclair/typebox luxon

The schema package includes @grounds/core as a dependency.

Peer dependencies:

  • @sinclair/typebox - TypeBox for schema definitions
  • luxon - DateTime handling for timestamps

With Streaming

For streaming encode/decode:

npm install @grounds/stream
# or
pnpm add @grounds/stream

TypeScript Configuration

Grounds is written in TypeScript and provides full type definitions. For best results, use strict TypeScript settings:

{
  "compilerOptions": {
    "strict": true,
    "noUncheckedIndexedAccess": true
  }
}

Next Steps

Continue to First Encode to write your first serialization code.