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

@wafl-lang/core

v0.1.3

Published

WAFL Core — Wider Attribute Formatting Language engine (parser, eval, schema, tags)

Downloads

27

Readme

@wafl-lang/core

NPM Downloads

Core engine for the Wider Attribute Formatting Language (WAFL): parsing, resolving tags/expressions, evaluating documents, and validating against schemas.

Install

Add to a project: pnpm add @wafl-lang/core (Node 18+)

High-level usage

import { loadWaflConfig } from "@wafl-lang/core";

const result = await loadWaflConfig("config/app.wafl", {
  env: { NODE_ENV: "production" }, // overrides/extends process.env
});

// result holds the fully resolved, evaluated, and validated configuration object

Load from a string (no filesystem)

import { loadWaflConfigFromString } from "@wafl-lang/core";

const source = `
@schema:
  App:
    name: string
    port: int

app<App>:
  name: "Demo"
  port = $ENV.PORT || 3000
`;

const result = await loadWaflConfigFromString(source, { env: { PORT: 4242 } });
// => { app: { name: "Demo", port: 4242 } }

Lower-level APIs

If you need finer control, import specific modules:

import { loadWaflFile } from "@wafl-lang/core/loader.mjs";
import { resolveWafl } from "@wafl-lang/core/resolver.mjs";
import { evaluateDocument } from "@wafl-lang/core/eval.mjs";
import { validateDocument } from "@wafl-lang/core/schema.mjs";

const { doc, meta } = loadWaflFile("config/app.wafl");
const resolved = resolveWafl(doc, { env: process.env });
const evaluated = evaluateDocument(resolved, { env: process.env });
validateDocument(evaluated, meta.schema);

loadWaflFile parses .wafl files (and @imports), resolveWafl handles tags/conditions/expressions, evaluateDocument runs @eval blocks and expressions, and validateDocument enforces schemas so you can plug these pieces into your own pipeline.

What’s included

  • Parser for indentation-based .wafl syntax with tags (!tag(args)), lists, and expressions (key = expr).
  • Resolver/evaluator for $ENV expressions, conditionals (- if ...), and custom tags.
  • Schema validation via @schema blocks; supports optional fields (field?) and typed lists (list<string>).
  • Type metadata extraction from keys like app<App> to enforce validation on the right paths.

Testing (in this repo)

  • From repo root: pnpm test --filter @wafl-lang/core
  • Direct: cd packages/core && pnpm test