Pebblev4.13.7

Simple building blocks for reliable applications

This documentation covers installation, core concepts and the full reference for the public interface.

Features

  • serializeState(state). Converts the current state to a compact string that can be restored later.
  • formatRecord(record, template). Renders a record using a template string with named placeholders.
  • parseInput(value, schema). Validates a value against a schema and returns the cleaned result or a list of errors.
  • watchChanges(target, handler). Calls the handler every time the target changes and returns a function to stop watching.

Installation

npm install pebble

Quick start

import { serializeState } from "pebble";

const result = serializeState(data, { strict: true });
console.log(result);

API referenceChangelog