Predictable tools for everyday data tasks
The library is released under the MIT license and has no runtime dependencies. It runs in modern browsers and on current server runtimes.
Features
- serializeState(state). Converts the current state to a compact string that can be restored later.
- batchUpdate(items, size). Splits a list into groups of the given size and processes them in order.
- mergeConfig(base, overrides). Combines two configuration objects, giving priority to the second and keeping types intact.
- retryTask(task, attempts). Runs an asynchronous task again if it fails, with a short delay between attempts.
Installation
npm install loomkitQuick start
const { serializeState } = require("loomkit");
const result = serializeState(data, { strict: true });
console.log(result);