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

schwrc

v1.0.5

Published

A CLI tool for working with files

Readme

Schwrc CLI

A command-line tool for creating and managing shell aliases and lambda functions.

Installation

# Install globally
yarn global add schwrc

# Or install from local directory
yarn global add file:.

Usage

Basic Commands

# Create an alias for the last command
schwrc -a [name]

# Delete an alias or function from .zshrc
schwrc -d [name]

# Generate a shell command for a lambda function
schwrc -l [func] [args...]

Creating Aliases

The -a or --alias flag allows you to create an alias for the last command in your shell history:

# Create an alias interactively
schwrc -a

# Create an alias with a specific name
schwrc -a myalias

Deleting Aliases and Functions

The -d or --delete flag lets you remove aliases or functions from your .zshrc file:

# Delete an entry interactively
schwrc -d

# Delete a specific entry
schwrc -d myalias

Lambda Functions

The -l or --lambda flag generates a shell command from a JavaScript lambda function:

# Create a lambda function interactively
schwrc -l

# Create a lambda function with arguments
schwrc -l "(args) => args.join(' ')" hello world

The generated command will be displayed and you'll be prompted to create an alias for it.

Lambda Function Examples

  1. Join arguments with spaces:
schwrc -l "(args) => args.join(' ')" hello world
# Output: hello world
  1. Convert arguments to uppercase:
schwrc -l "(args) => args.map(arg => arg.toUpperCase()).join(' ')" hello world
# Output: HELLO WORLD
  1. Count arguments:
schwrc -l "(args) => args.length" hello world
# Output: 2
  1. Read a file (using Node.js built-in modules):
schwrc -l "async (args) => { const fs = require('fs'); const content = await fs.promises.readFile(args[0], 'utf-8'); return content; }" file.txt

Suppressing Yarn Output

Use the --no-yarn flag to suppress yarn output:

schwrc --no-yarn -l "(args) => args.join(' ')" hello world

How It Works

  1. Alias Creation: The tool reads your shell history to get the last command and creates an alias in your .zshrc file.

  2. Lambda Functions: The tool generates a Node.js command that executes your lambda function with the provided arguments. The generated command can be aliased for future use. Node.js built-in modules (like fs, path, etc.) can be accessed using require().

  3. Interactive Mode: When no arguments are provided for interactive options (like -a or -l), the tool will prompt you for input.

Requirements

  • Node.js 14 or higher
  • Yarn or npm
  • Zsh shell

Development

# Install dependencies
yarn install

# Build the project
yarn build

# Run tests
yarn test

License

MIT