Predictable tools for everyday data tasks
If you are new, start with the quick start below and move to the reference when you need details.
Features
- retryTask(task, attempts). Runs an asynchronous task again if it fails, with a short delay between attempts.
- serializeState(state). Converts the current state to a compact string that can be restored later.
- watchChanges(target, handler). Calls the handler every time the target changes and returns a function to stop watching.
- parseInput(value, schema). Validates a value against a schema and returns the cleaned result or a list of errors.
Installation
npm install tinyledgerQuick start
import { retryTask } from "tinyledger";
const result = retryTask(data, { strict: true });
console.log(result);