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 🙏

© 2024 – Pkg Stats / Ryan Hefner

radashi-helper

v0.1.4

Published

Help with managing your own Radashi

Downloads

554

Readme

radashi-helper

Gitter.im License npm code style: biome.js

The command-line tool powering the Radashi template. If you stumbled upon this package and don't know about the Radashi template yet, you probably want that instead.

Installation

pnpm add -D radashi-helper

Alternatively, you can install this globally.

pnpm add -g radashi-helper

Usage

After installing this from NPM, you can use the radashi help command to get started.

pnpm radashi help

Alternatively, there's a guide over at the Radashi website.

Note: This tool expects a specific project structure (the one used by radashi-org/radashi-template).

 

radashi fn create [name]

Scaffold the files for a new custom function.

It creates the following files, skipping any that already exist:

  • src/<group>/<name>.ts
  • tests/<group>/<name>.test.ts
  • docs/<group>/<name>.mdx
  • benchmarks/<group>/<name>.bench.ts

The name can be a full path, like array/sum, or just the function name, like sum. If not provided, you will be prompted to name the function and/or select a group.

You'll also be prompted for a short description, which is added to the metadata at the top of the docs/ file.

 

radashi fn move [name] [dest]

Rename the files for a custom function.

The name should include the group and function names, like number/sum or object/pick. If not provided, you will be prompted to pick the function you want.

The dest can be a group name, like array, or a full path, like array/sum. If not provided, you will be prompted to decide what to do.

Important: This command doesn't update any of the code. It will only rename the files. This is being tracked in #1.

# Interactive mode
pnpm radashi fn move

# Rename objectify without changing the group
pnpm radashi fn move array/objectify objectToArray

# Move sum to the array group without changing the name
pnpm radashi fn move number/sum array/sum

 

radashi fn override [query]

Copy the files for an existing function into your project's overrides folder.

The query is a partial function name. If there's a tie for best match or no query is provided, you will be prompted to pick the function you want.

# Interactive mode
pnpm radashi fn override

# Copy the files for "number/sum" into your project
pnpm radashi fn override number/sum

 

radashi pr import <pr-id>

Copy the files for a Radashi “pull request” into your project.

# Import all changes from a PR
pnpm radashi pr import 208

Notes

  • GitHub CLI must be installed for this command.
  • The pr-id must be a valid PR ID in the radashi-org/radashi repository. See the pull requests page to find one.
  • The PR will be automatically committed to your Radashi.
  • If the PR title doesn't follow the Conventional Commits format, you will be prompted to provide a commit message.
  • There's no need to run pnpm build after importing a PR, as this command will do it for you.

 

radashi build

Compile and bundle the project, writing to the filesystem.

# Perform a production build.
pnpm radashi build

# Watch for changes and rebuild automatically.
pnpm radashi build --watch

# If you're using radashi-template:
pnpm build

 

radashi lint [...globs]

Check your Radashi files for possible bugs, formatting issues, and other problems.

Currently, this command supports Biome and ESLint.

# Lint all files.
pnpm radashi lint

# Lint only the files in the src folder.
pnpm radashi lint src/**/*.ts

# If you're using radashi-template:
pnpm lint

 

radashi format [...globs]

Format your Radashi files using Biome.

# Format all files.
pnpm radashi format

# Format only the files in the src folder.
pnpm radashi format src/**/*.ts

# If you're using radashi-template:
pnpm format

 

radashi test [...globs]

Run the tests for your custom Radashi functions.

This command expects Vitest to be installed in your project. This means any flags supported by Vitest will work.

# Run all tests.
pnpm radashi test

# Run only the tests for your "foo" function.
pnpm radashi test foo

# Run only the tests for the files that match the globs.
pnpm radashi test src/array/*.ts

# If you're using radashi-template:
pnpm test

 

radashi open [query]

Open the files for a custom Radashi function in your preferred editor.

If you don't have a preferred editor, you will be prompted to pick one.

If you don't specify a query, you will be prompted to pick a function.

# Open the source file for the function named "foo".
pnpm radashi open foo

# Open all of the files related to the function named "foo".
pnpm radashi open foo -A

Flags

When no flags are provided, this command will open the source file by default.

  • -s, --source: Open the source file.
  • -t, --test: Open the test file.
  • -T, --type-test: Open the type test file.
  • -b, --benchmark: Open the benchmark file.
  • -d, --docs: Open the documentation file.
  • -A, --all: Open all related files.