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

@vertesia/memory-commands

v0.82.0

Published

Memory commands for memory recipe scripts

Readme

@vertesia/memory-commands

Commands for building Vertesia memory packs from recipe scripts. This package provides the DSL (Domain Specific Language) used in memory recipe scripts.

Features

  • Recipe DSL: Simple commands for building memory packs
  • TypeScript Support: Direct execution of TypeScript recipe files
  • File Operations: Copy files, text, JSON, and media into memory packs
  • Document Processing: Built-in support for PDF and DOCX conversion
  • Shell Execution: Run shell commands during build

Installation

npm install @vertesia/memory-commands
# or
pnpm add @vertesia/memory-commands

Usage

Writing Recipe Scripts

Recipe scripts use the exported commands to define memory pack contents:

import { from, copy, json, content, vars } from '@vertesia/memory-commands';

// Set the base directory for file operations
from('./src');

// Copy files into the memory pack
copy('**/*.ts', { to: 'source/' });

// Add JSON data
json({ version: vars().version, name: 'my-project' }, 'metadata.json');

// Add text content directly
content('# Project Documentation\n\nThis is the main documentation.', 'docs/README.md');

export default {}; // Required default export

Building Programmatically

import { build } from '@vertesia/memory-commands';

await build('recipe.ts', {
  out: 'memory.tar',
  gzip: true,
  vars: { version: '1.0.0' }
});

Available Commands

File Operations

| Command | Description | |---------|-------------| | from(path) | Set the base directory for file operations | | copy(glob, options?) | Copy files matching glob pattern | | copyText(glob, options?) | Copy text files with optional transformation | | content(text, path) | Add text content directly | | json(data, path) | Add JSON data |

Document Processing

| Command | Description | |---------|-------------| | pdf(path, options?) | Extract text from PDF files | | docx(path, options?) | Convert DOCX files to markdown | | media(path, options?) | Add media files with optional transformation |

Utilities

| Command | Description | |---------|-------------| | vars() | Access variables passed via CLI | | tmpdir() | Get a temporary directory for intermediate files | | exec(command) | Execute a shell command |

Examples

Copy Source Code

import { from, copy } from '@vertesia/memory-commands';

from('./src');
copy('**/*.ts', { to: 'code/' });
copy('**/*.json', { to: 'config/' });

export default {};

Process Documents

import { from, pdf, docx } from '@vertesia/memory-commands';

from('./docs');
pdf('*.pdf', { to: 'text/' });
docx('*.docx', { to: 'markdown/' });

export default {};

Dynamic Content

import { json, content, vars } from '@vertesia/memory-commands';

const config = vars();

json({
  name: config.name,
  version: config.version,
  timestamp: new Date().toISOString()
}, 'manifest.json');

content(`# ${config.name}\n\nVersion: ${config.version}`, 'README.md');

export default {};

API

build(script, options?)

Execute a recipe script to build a memory pack.

interface BuildOptions {
  out?: string;           // Output file (default: 'memory.tar')
  gzip?: boolean;         // Compress output
  indent?: number;        // JSON indentation
  quiet?: boolean;        // Suppress output
  test?: boolean;         // Test mode (don't write files)
  vars?: Record<string, any>;  // Variables for the script
  transpileDir?: string;  // Directory for transpiled TypeScript
}

getBuilder()

Get the current builder instance (for advanced use cases).

License

Apache-2.0