Skip to content

Getting Started

  • Node.js v18 or higher
  • A package manager: npm, pnpm, or yarn

Each package is published independently under the @thuum scope. Install only the packages you need:

Terminal window
# npm
npm install @thuum/piper
npm install @thuum/decor
npm install @thuum/promising
# pnpm
pnpm add @thuum/piper
import { pipe } from "@thuum/piper";
const { value } = pipe(1)
.pipe((x) => x + 1)
.pipe((x) => x * 2);
console.log(value); // 4
import { attempt } from "@thuum/decor";
const safeParse = attempt(JSON.parse);
const result = safeParse("invalid json");
if ("error" in result) {
console.error("Parse failed:", result.error);
} else {
console.log("Parsed:", result.value);
}
import { createContext } from "@thuum/promising";
const ctx = createContext({
watch: (event) => console.log(`[${event.type}] ${event.name}`),
});
ctx.run("first", async () => await fetchFirst());
ctx.run("second", async () => await fetchSecond());
// "second" always waits for "first" to complete

To work on the Thuum monorepo itself:

Terminal window
git clone https://github.com/jalepi/thuum.git
cd thuum
pnpm install
pnpm run build
pnpm run test