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

lazyboy

v0.1.3

Published

Command line laziness redefined!

Downloads

10

Readme

lazyboy NPM version Bitdeli Badge

NPM

> Command line laziness redefined!

The sole purpose of lazyboy (a.k.a lb) is to make you more lazier when dealing with CLI. How many times did you type got init instead of git init and the "smart" CLI corrects you!

But what if you had a shortcut say i to run git init everytime?? would'nt that be convinent?

So, here is a CLI that does exatcly the same for you!!

##Contents

Installation

Install the module globally :

$ npm install -g lazyboy

Options

Usage: lb [options]

Options:

    -h, --help                       output usage information
    -V, --version                    output the version number
    -a, --add [command -> shortcut]  Enter a command that you would like to shortcut.
    -r, --remove [shortcut]          Enter the shortcut to be removed from the saved commands.
    -x, --execute [shortcut]         Enter the shortcut to run the saved command.
    -p, --print                      Prints the list of saved shortcuts
    -i, --import [commands]          Imports the commands that was exported from another Lazyboy collection
    -e, --export                     Exports all the commands in your Lazyboy collection

  Example Usage:

  > Add new command and its shortcut
    $ lb -a "git init -> gi"
  > Execute a shortcut
    $ lb -x "gi"
  > Print saved shortcuts
    $ lb -p
  > Remove a shortcut
    $ lb -r "gi"
  > Export your Lazyboy shortcuts
    $ lb -e
  > import Lazyboy shortcuts
    $ lb -i '[{"command":"git init","shortcut":"gi"},{"command":"ls -ltr","shortcut":"l"}]'

Documentation

Adding and Executing shortcuts

You can add a new shortcut by running

$ lb -a "git init -> i"

do notice the ->. The left hand side of -> is the command and the right hand side part is the shortcut.

PS : You can name your shortcut charcters, numbers, etc..

Now, you can execute the command by running

$ lb -x i

or

$ lb i

Simple right??

Another example. Do you use the Python's SimpleHTTPServer module to launch a new static server? And you have to type

$ python -m SimpleHTTPServer

or

$ python -m http.server

You can create an alias like

$ lb -a "python -m SimpleHTTPServer -> ps"

and you can run the below command in the folder where you want to spwan the HTTP server

$ lb -x ps

or

$ lb ps

Sweet right? And the best thing is, this module is language agonistic. It can store any command line statement as shortcuts!

You can also add dynamic commands like

$ lb -a "git commit -m * -> c"

here * is the placeholder. And you can execute the command like

$ lb -x c "Initial Commit"

or

$ lb c "Initial Commit"

This will run git commit -m "Initial Commit" for you.

And if you are like me creating new repos and pushing them to Github, you must have this shortcut

$ lb -a "git init && git add -A && git commit -m * && git remote add origin * && git push origin master -> r"

And then the next time when you want to initialize and push the current folder to Github all you need to do is

 $ lb r "inital commit" "https://github.com/arvindr21/lb.git"

And bam!!! You code will be initialized, staged, commited locally and pushed to Github!

PS : The order of arguments in the actual command should match with the arguments while using lazyboy

Prinitng shortcuts

Running

 $ lb -p

will list all the shortcuts you have saved so far

List of saved commands :

	Shortcut	Command
	i 	 git init
	r 	 git init && git add -A && git commit -m * && git remote add origin * && git push origin master

Removing shortcuts

If you want to remove any shortcuts, you can run

$ lb -r i

where i is the name of the shortcut.

Importing & Exporting shortcuts

You can export your saved shortcuts and then share them with your near and dear ones! All you need to do is run

$ lb -e

And you can share the output

$ lb -e
[{"command":"git init","shortcut":"i"},{"command":"git init && git add -A && git commit -m * && git remote add origin * && git push origin master","shortcut":"r"}]

And you can import the same using

$ lb -i '[{"command":"git init","shortcut":"i"},{"command":"git init && git add -A && git commit -m * && git remote add origin * && git push origin master","shortcut":"r"}]'

Do notice the single quotes before and after the JSON.

Contributing

See the CONTRIBUTING Guidelines

License

Copyright (c) 2014 Arvind Ravulavaru. Licensed under the MIT license.