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

funcity-cli

v0.8.0

Published

A functional language interpreter with text processing

Readme

funcity

A functional language interpreter with text processing, easy embeddable!

funcity

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. License: MIT


What is this?

This is a lightweight functional language processor implemented in TypeScript, featuring syntax extensions for text processing. It includes a CLI application and a library package containing only the core engine.

funcity can be considered a type of text template processor. For example, entering code like this:

Today is {{if weather.sunny}}nice{{else}}bad{{end}} weather.

Evaluates the value of the weather variable manually bound to the core engine beforehand and generates different text outputs:

Today is bad weather.

The if ... else ... end statements in the text indicate that the script is being executed. So, you might ask, what makes this a "Functional language"? Or how is it different from existing text processors?

Let me show you another equivalent example:

Today is {{cond weather.sunny 'nice' 'bad'}} weather.

This is an example of function application, inserting the result of applying three arguments to the cond function. The first argument is a conditional expression.

The following code may further interest you:

{{
set printWeather (fun w (cond w.sunny 'nice' 'bad'))
}}
Today is {{printWeather weather}} weather.
  • fun defines an anonymous lambda function.
  • set performs a mutable binding in the current scope.

Furthermore, you can easily integrate this interpreter into your application:

// Input script
const script = "Today is {{cond weather.sunny ‘nice’ 'bad'}} weather.";

// Run the interpreter
const variables = buildCandidateVariables();
const logs: FunCityLogEntry[] = [];
const text = await runScriptOnceToText(script, variables, logs);

// Display the result text
console.log(text);

In other words, Funcity is a processing system that brings the power of functional programming to text template processors, enabling seamless integration into applications!

Features

  • A lightweight functional language processor for handling untyped lambda calculus. Adopted the simplest possible syntax. Additionally, selected the syntax extensions that should be prioritized for text processing.
  • All function objects are treated as asynchronous functions. You do not need to be aware that they are asynchronous functions when applying them.
  • There is also a CLI using the core engine. The CLI has both REPL mode and text processing mode.
  • The core engine includes a tokenizer, parser, and reducer (interpreter).
  • The core engine library is highly independent, requiring no dependencies on other libraries or packages. It can be easily integrated into your application.
  • Parsers and interpreters support both interpreting pure expressions and interpreting full text-processing syntax. This means that even when an interpreter for a purely functional language is required, it is possible to completely ignore the (somewhat incongruous) syntax of text processing.
  • Allows pre-binding of useful standard function implementations.

Installation (CLI)

TODO:

npm install -D funcity-cli

Or, global installation:

npm install -g funcity-cli

Installation (Library)

npm install funcity

Documentation

For detailed documentation and advanced features, please visit our GitHub repository.

Note

funcity was separated from the document site generator mark-the-ripper during its design phase, as it seemed better suited to function as an independent scripting engine.

Therefore, mark-the-ripper can leverage the power of funcity's functional language.

License

Under MIT.