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 🙏

© 2025 – Pkg Stats / Ryan Hefner

meld

v10.3.1

Published

Meld: A template language for LLM prompts

Downloads

8,521

Readme

NOTE: If you're looking for the old 'meld' package for aspect oriented programming, you'll want to pin your version to <2.0.0


meld (pre-release)

meld is a prompt scripting language.

Installation

npm install -g meld

or just run it with npx meld

CLI Usage

Process meld files from the command line:

# Basic usage - outputs .xml file
meld input.mld

# Specify output format
meld input.mld --format md

# Specify output file
meld input.mld --output output.xml

# Print to stdout instead of file
meld input.mld --stdout

Supported Options

  • --format, -f: Output format (default: md)
    • Supported formats: md, xml
  • --output, -o: Output file path (default: input filename with new extension)
  • --stdout: Print to stdout instead of file

Supported File Extensions

  • .mld is standard .mld.md is another option.
  • .md: Meld can just interpret regular old markdown files with added meld syntax, too.

JavaScript API

Meld has a fairly extensive js API which give access to its AST, interpreted variables, etc., but it's not documented yet. However, here's meld's simple API for processing content directly:

// ES Module import
import runMeld from 'meld';

// Process meld content
const meldContent = `
  @text greeting = "Hello"
  @text name = "World"
  
  ${greeting}, ${name}!
`;

// Simple usage
const result = await runMeld(meldContent);
console.log(result); // "Hello, World!"

// With options
const xmlResult = await runMeld(meldContent, {
  format: 'xml',
  transformation: true
});

Writing Meld Files

Meld is a simple scripting language designed to work within markdown-like documents. It processes special @directive lines while preserving all other content as-is.

Core Directives

@text name = "value"              # Define a text variable
@data config = { "key": "value" } # Define a structured data variable
@path docs = "$PROJECTPATH/docs"  # Define a path (must use $PROJECTPATH or $HOMEPATH)
@embed [file.md]                  # Embed content from another file
@embed [file.md # section]        # Embed specific section from file
@run [command]                    # Run a shell command
@import [file.mld]               # Import another meld file
@define cmd = @run [echo "hi"]    # Define a reusable command

Variables & Interpolation

{{variable}}            # Reference a variable
{{datavar.field}}       # Access data field
$pathvar                # Reference a path variable

# Variables can be used in strings and commands:
@text greeting = "Hello {{name}}!"
@run [cat {{file}}]

Comments & Code Fences

>> This is a comment
>> Comments must start at line beginning

# Code fences preserve content exactly:
```python
def hello():
    print("Hi")  # @text directives here are preserved as-is

### String Values

- Use single quotes, double quotes, or backticks
- Quotes must match (no mixing)
- Use backticks for template strings with variables:
```meld
@text simple = "Hello"
@text template = `Hello {{name}}!`
@text multiline = [[`
  Multi-line
  template with {{vars}}
`]]

Path Variables

  • Must use $PROJECTPATH (or $.) or $HOMEPATH (or $~)
  • Forward slashes as separators
@path docs = "$PROJECTPATH/docs"
@path home = "$HOMEPATH/meld"

Data Variables

  • Store structured data (objects/arrays)
  • Support field access
@data user = { "name": "Alice", "id": 123 }
@text name = "User: {{user.name}}"

License

MIT