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

as-known-as

v1.2.6

Published

Alias Bash Command on Steroids

Downloads

40

Readme

AKA

Alias Bash Command on Steroids

A Bash alias is essentially nothing more than a keyboard shortcut, an abbreviation, a means of avoiding typing a long command sequence. It's because of these reasons that AKA provides a better alternative to the good ol' alias command:

  • Aliases are stored as files on your file system and hence can be easily shared and synchronized between your computers
  • AKA is cross-platform, which means it can be be used on your Linux, MacOS or Windows OS based machines
  • It comes with some advance & handy features, such as: search, dynamic parameters and more

Migrating to V1

The latest version has gone through some major changes, and hence is not compatible with aliases which were created with older versions of AKA. If you choose to upgrade to the new version, please make sure you backup your aliases folder and then run the following command: aka --migrate

Installation

npm install -g as-known-as

Usage

Usage: aka [options] [command]

Commands

  • copy|cp [options] <from> <to> - copy an existing alias
  • execute|ex [options] <alias> - execute an alias
  • list|ls [options] [filter] - show all aliases
  • make|mk [options] <alias> <command> - add a new alias or update existing one
  • move|mv [options] <from> <to> - rename an alias and/or update its description
  • remove|rm <alias...> - remove one or more aliases

Options

-C, --chdir <path> change the aliases directory -h, --help output usage information -m, --migrate migrate aliases from pre 1.0.0 versions of as-known-as -V, --version output the version number -w, --website open AKA website

Index

  • <...> - mandatory value
  • [...] - optional value

Examples

  • aka add my-ip "dig +short myip.opendns.com @resolver1.opendns.com" -d "get my public ip address" - adds a new my-ip alias with description. Description & command should be surrounded with quotes.
  • aka ls ip - searches for all aliases which contains ip in either alias or description.
  • aka ex my-ip - execute my-ip alias (you can also omit the ex if no options specified).
  • aka rm my-ip - removes all aliases.
  • aka --chdir /Users/nir/Dropbox/aka - changes AKA aliases directory.

Advanced Usage

  1. Dynamic command parameters - Use command option -p to leave out parameters which you want to add dynamically, for example: aka add ls "ls -la" -d "display folder content as a list" and then use as follows: aka ex ls -p "some-path"
  2. Dynamic command parameters binding - Parameters binding makes it even easier to execute aliases, by providing help and even set of valid options, for example: aka scale-image="convert {{Source image path?|input}} -resize {{Scale rate (in percents)?|input}} {{Scaled image path?|input}}" -d "scale an image proportionally" and then the use as follows: aka ex scale-image

Dynamic command parameters binding format: - {{description|type[|options]}} - description - short parameter description - type - can be one of the following:
* checkbox for predefined list of valid options - multiple options
* confirm for specific value
* expand for predefined list of valid options - single option
* input for free text
* list for predefined list of valid options - single option
* password for masked text
(see options for more info)
- options
* checkbox, list - semicolon separated list of strings (e.g. op1;op2;op3)
* confirm - a value which will be appended to the command in case of confirmation
* expand - semicolon separated list of comma separated key value pairs (e.g. a,op1;b,op2;c,op3)
* input, password - default value if empty

Tips & Tricks

  • Call any of the commands with -h parameter to see its help
  • Always use absolute paths (avoid shortcuts symbols such as ~, .. etc)
  • You do not have to remember command's exact alias. If no command with the exact alias was found, similar options will be displayed
  • Change AKA aliases directory to Dropbox, Google Drive or any other online storage service, to share your aliases with all your workstations
  • If you get EACCES: permission denied error on first run, either run as sudo (only once), or change your global node_modules directory to a path you have write access to
  • If you get Permission denied (publickey) error while running ssh command, make sure your public key path is absolute (i.e. do not start path with tilde ~)
  • Notice that if a command contains pipes, it will run in EXEC mode, which basically means it's output is limited to 200KB