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

knevee

v4.4.1

Published

**knevee** simplifies running JavaScript directly from the terminal. It enables users to execute scripts efficiently, providing intuitive CLI interactions.

Readme

knevee

knevee simplifies running JavaScript directly from the terminal. It enables users to execute scripts efficiently, providing intuitive CLI interactions.

Overview

knevee allows you to craft lightweight, customizable command-line tools using JavaScript. Define a module, specify the positional arguments and options, and you're ready to run your script with ease.

Example

Here’s a quick example of how a simple greeting command could be implemented:

#!/usr/bin/env knevee
export const description = "Greetings earthling";
export const positionals = "<name>";

export default async (name) => {
  return `hello ${name}`;
};

Usage

You can execute the script directly, view help, and handle various command-line inputs:

$ greeting --help
Usage: greeting <name>
Greetings earthling
    --help Prints command help message

$ greeting michael
hello michael

$ greeting
Missing required positional arguments: <name>

$ greeting michael jordan
Extra positional arguments: jordan

$ greeting "michael jordan"
hello michael jordan

Installation

Install knevee globally using npm to use it from anywhere on your system:

npm install knevee -g

Alternativley you can execute a single file like this

npx knevee ./file.js

Configuration Options

knevee supports a robust set of configuration options to tailor your scripts. Here's what you can customize:

| name | type | doc | | --- | --- | --- | | name | string | string[] | The name of the module. (Defaults to the name of the file) | | description | string | A description of what the module does. | | dependencies | string | string[] | A list of dependencies required by the module. | | positionals | string[] | string | Positional arguments that the module accepts. Can be specified as an array or a space-separated string. | | flags | FlagOptions | A mapping of command line flags to their settings. parseArgs | | default | null | | The function that executes when the command is run. | | useStrictFlags | boolean | Specifies if the flags should be strictly validated against the provided flags definitions. (Defaults to true) | | useUnshiftStdin | boolean | Determines if stdin should be unshifted into args. (Defaults to true) | | useLoopMethod | string | allSettled | all | for-await | When iterating stdin loop uses Promise.allSettled instead of Promise.all. (Defaults to false) | | output | string | boolean | The type of output that the module should produce. (Defaults to log) | | | | - bool - Outputs the result as a boolean value, adds --emoji, --int flags to command. | | | | - json - Outputs the result as a JSON string, pretty prints the result. | | | | - lines - Expects an array, and will output each item on a line. | | | | - log - Prints the value. | | | | - stdout - Prints the value. | | | | - bash - Expects function to return string, and executes, adds --print flag to the command, which prints the string. | | | | - false - Disables output. | | positionalType | PositionalType | undefined | Describes how positional rules translate to function arguments. (Defaults to positionalAsObject) | | | | - positionalNamedObject - Uses name in positionals as key in args. | | | | - positionalAsArray - Uses escalating _ as the key separating -- in positionals. | | stdin | StdinLoopType | boolean | Determines if the module should read from stdin and how. (Defaults to false) | | | | - false - Disables stdin. | | | | - true - Reads from stdin | | | | - loopJson - Reads from stdin as a JSON array and loops over each item. | | | | - loopLines - Reads from stdin as a string and loops over each line. | | | | - loop - Reads stdin and does loopJson with backup to loopLines. | | runtime | undefined | string | string[] | Set the javscript runtime to evaluate subprocesses under, must expect appending js string. | | | | node | | | | --experimental-strip-types | | | | --experimental-detect-module | | | | --disable-warning=MODULE_TYPELESS_PACKAGE_JSON | | | | --disable-warning=ExperimentalWarning | | | | -e | | runtimeKey | string | node | deno | undefined | | path | undefined | string | path to dir or file | | __filename | undefined | string | path to dir or file | | importMeta | undefined | ImportMeta | undefined | | cwd | string | undefined | current working directory | | argv | string[] | undefined | command arguments | | subprocess | boolean | runs the command as a subprocess |

| var | type | description | | --- | --- | --- | | KNEVE_THROW | boolean | Throws Kneve errors instead of just logging the message |