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

find-alias

v1.0.1

Published

interactive aliases finder and executor

Downloads

4

Readme

npm version

FIND ALIAS

Find-alias is an interactive alias finder and executor, it helps you to quickly find and execute any aliases.

find-alias-example

Installation

install with default name: fa

  1. npm install -g find-alias
  2. find-alias --configure
  3. restart the terminal
  4. fa

install with custom program name

  1. npm install -g find-alias
  2. find-alias --configure <<custom-name>>
  3. restart the terminal
  4. <<custom-name>>

Run without installation

  1. copy the following command to your terminal:
function find-alias {
  if [[ -n "$BASH" ]]; then
    history -s find-alias "$@"
  fi

  tmp_file=$(mktemp -t find-alias.XXXXXXX)
  aliases_tmp_file=$(mktemp -t find-alias.XXXXXXX)
  alias | cat >>"$aliases_tmp_file"
  npx find-alias@latest "$@" "$aliases_tmp_file" --height="$(tput lines)" --page-size="$(tput lines)" --output-file="$tmp_file"
  result="$(<"$tmp_file")"
  rm -f "$tmp_file"
  rm -f "$aliases_tmp_file"
  if [[ -n "$result" ]]; then
    eval "$result"

    if [[ -n "$BASH" ]]; then
      history -s "$result"
    elif [[ -n "$ZSH_VERSION" ]]; then
      print -s "$result"
    fi
  fi
}
  1. type find-alias

Features

  • run the program by typing fa or <<custom-name>>
  • to find and run an alias:
    • write in any keyword in the quick filter
    • use up and down button to choose any of the aliases from the filtered list
    • press <enter> to run chosen alias
  • to find and add extra arguments before running an alias:
    • write in any keyword in the quick filter
    • use up and down button to choose from the filtered list
    • press <tab>
    • write in the extra arguments
    • press <enter> to run

Why did I create this software?

  • Have you ever felt lost in dozens and dozens (or even hundreds) of different aliases?
  • After installing Oh My Bash or Oh My Zsh and adding a few plugins you could simply end up in a with 100+ new aliases, without any easily accessible documentation.
  • It happened too many times to me that I knew that an alias exist for my problem, but it requires too much time and effort to find it, so in the end I just ended up typing in the long command.
    • What is the alias for adding all the files to git and amending previous commit without any edit?
    • Or what is the alias if I want to edit the commit message?
    • Or what is the alias if I only want to add a few files?
  • The aim of the program is to give a helper utility where you can find any alias quickly, e.g. the above-mentioned aliases could be easily found by searching keywords commit and amend and then you can choose which ever you need at the moment.

Uninstalling

  1. npm uninstall -g find-alias
  2. remove ~/.find-alias.sh file from your home directory
  3. remove #find-alias part from your .bashrc or .zshrc file

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT