JSPM

  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q44923F

Type-safety piping paradigram through webstream-kernels.

Package Exports

  • snoflow

Readme

Webstream Kernel

Example: analyze all imports from a repo

import fs from "fs/promises";
import ignore from "ignore";
import imports from "imports-walk-ts";
import path from "path";
import { peekYaml } from "peek-log";
import { froms, filters, maps, nils } from "webstream-kernal";

const ignorer = ignore({})
  .add(await fs.readFile("./.gitignore", "utf8"))
  .createFilter();

await from(new Bun.Glob("./**/*.{ts,tsx,jsx,js}").scan())
  .pipeThrough(maps((f) => path.normalize(f)))
  .pipeThrough(filters(ignorer))
  .pipeThrough(maps((f) => fs.readFile(f, "utf8")))
  .pipeThrough(maps((c) => imports(c)))
  .pipeThrough(maps(peekYaml))
  .pipeTo(nils());