npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lokascript/domain-flow

v2.3.0

Published

Declarative reactive data flow DSL built on @lokascript/framework - fetch, poll, stream, submit via natural language

Readme

@lokascript/domain-flow

Multilingual reactive data flow DSL built on @lokascript/framework. Describe fetch, polling, streaming, form submission, and data transformation pipelines in 8 natural languages and compile to vanilla JS or HTMX attributes.

Supported Languages

| Language | Code | Word Order | Example | | -------- | ---- | ---------- | -------------------------------------------- | | English | en | SVO | fetch /api/users as json into #list | | Spanish | es | SVO | obtener /api/users como json en #list | | Japanese | ja | SOV | /api/users json で 取得 #list に | | Arabic | ar | VSO | جلب /api/users ك json في #list | | Korean | ko | SOV | /api/users json 로 가져오기 | | Chinese | zh | SVO | 获取 /api/users 以 json 到 #list | | Turkish | tr | SOV | /api/users json olarak getir | | French | fr | SVO | récupérer /api/users comme json dans #list |

Commands

| Command | Description | Example | | ----------- | ------------------------------- | ------------------------------------------------ | | fetch | HTTP GET, parse response | fetch /api/users as json into #list | | poll | Repeated fetch on interval | poll /api/status every 5s as json into #status | | stream | Server-Sent Events (SSE) | stream /api/events as sse into #feed | | submit | POST form data | submit #login-form to /api/login | | transform | Client-side data transformation | transform data with uppercase |

Usage

import { createFlowDSL } from '@lokascript/domain-flow';

const flow = createFlowDSL();

// Parse
const node = flow.parse('fetch /api/users as json into #list', 'en');

// Compile to vanilla JS
const result = flow.compile('fetch /api/users as json into #list', 'en');
// → fetch('/api/users').then(r => r.json()).then(data => { ... })

// Validate
const validation = flow.validate('poll /api/status every 5s', 'en');
// → { valid: true }

Pipelines

Chain commands with or ->:

import { compilePipeline } from '@lokascript/domain-flow';

const result = compilePipeline(
  flow,
  'fetch /api/data as json → transform data with uppercase into #output',
  'en'
);

HTMX Generation

import { toFlowSpec, generateHTMX } from '@lokascript/domain-flow';

const node = flow.parse('fetch /api/users as json into #list', 'en');
const spec = toFlowSpec(node, 'en');
const htmx = generateHTMX(spec);
// → { attrs: { 'hx-get': '/api/users', 'hx-target': '#list', 'hx-swap': 'innerHTML' }, notes: [...] }

Route Extraction

import { toFlowSpec, extractRoute } from '@lokascript/domain-flow';

const spec = toFlowSpec(flow.parse('submit #form to /api/orders', 'en'), 'en');
const route = extractRoute(spec);
// → { path: '/api/orders', method: 'POST', handlerName: 'createOrders', ... }

Translation

import { renderFlow } from '@lokascript/domain-flow';

const node = flow.parse('fetch /api/users as json into #list', 'en');
renderFlow(node, 'ja'); // → /api/users json で 取得 #list に
renderFlow(node, 'es'); // → obtener /api/users como json en #list

API

createFlowDSL(): MultilingualDSL

Create a DSL instance with all 8 languages.

toFlowSpec(node, language): FlowSpec

Convert a parsed semantic node to a structured FlowSpec.

renderFlow(node, language): string

Render a semantic node back to natural-language DSL text.

generateHTMX(spec): HTMXAttributes | null

Generate HTMX attributes from a FlowSpec. Returns null for transform.

extractRoute(spec): FlowRouteDescriptor | null

Extract a server route descriptor from a FlowSpec.

parseFlowPipeline(dsl, input, language): PipelineParseResult

Parse arrow-delimited multi-step pipelines.

compilePipeline(dsl, input, language): { ok, code, errors }

Parse and compile a pipeline to JS.