• Stars
    star
    452
  • Rank 96,766 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

terminal UI for npm

lazynpm

CI Go Report Card GolangCI GoDoc GitHub tag TODOs

A simple terminal UI for npm commands, written in Go with the gocui library.

npm is pretty cool, but some of its workflows are a little too much for somebody with my atrocious short term memory. If I need to link a couple of dependencies to a package I need to do an npm install on the package so we're up to date, then cd to each dependency package and npm install, then npm run build, then npm link if it's not already globally linked (and how would I know that it is?) and then cd back to the original package and do npm link <dependency> for each dependency. Pretty much every time I'll get halfway through, suspect that I've forgotten a step, then start again from scratch. But who needs a functionining brain when have a tool where every step in the process take one keypress and at a glance you can see how everything is linked up?

lazynpm is the younger brother of lazygit and lazydocker, and has learnt from both its siblings how best to make life lazier in the terminal so that you can focus on what matters: programming.

Gif

Table of contents

Github Sponsors is matching all donations dollar-for-dollar for 12 months so if you're feeling generous consider sponsoring me

Installation

This program is not compatible with Windows because one of its dependencies, pty, is not compatible.

Binary Releases

For Mac OS or Linux, you can download a binary release here.

Homebrew

Normally the lazynpm formula can be found in the Homebrew core but we suggest you tap our formula to get the frequently updated one. It works with Linux, too.

Tap:

brew install jesseduffield/lazynpm/lazynpm

Go

go install github.com/jesseduffield/lazynpm@latest

Please note: If you get an error claiming that lazynpm cannot be found or is not defined, you may need to add ~/go/bin to your $PATH (MacOS/Linux). Not to be mistaken for $GOROOT/bin (which is for Go's own binaries, not apps like lazynpm).

Usage

Call lazynpm in your terminal inside a git repository.

$ lazynpm

If you want, you can also add an alias for this with echo "alias lzn='lazynpm'" >> ~/.zshrc (or whichever rc file you're using).

Keybindings

You can check out the list of keybindings here.

Changing Directory On Exit

If you change repos in lazynpm and want your shell to change directory into that repo on exiting lazynpm, add this to your ~/.zshrc (or other rc file):

lzn()
{
    export LAZYNPM_NEW_DIR_FILE=~/.lazynpm/newdir

    lazynpm "$@"

    if [ -f $LAZYNPM_NEW_DIR_FILE ]; then
            cd "$(cat $LAZYNPM_NEW_DIR_FILE)"
            rm -f $LAZYNPM_NEW_DIR_FILE > /dev/null
    fi
}

Then source ~/.zshrc and from now on when you call lzn and exit you'll switch directories to whatever you were in inside lazyigt. To override this behaviour you can exit using shift+Q rather than just q.

Configuration

Check out the configuration docs.

Tutorials

Cool features

  • easily link packages and see which packages are linked
  • pack packages and install from tarballs
  • instantly know which dependencies are behind (or ahead) based on semver
  • install/update multiple things at a time
  • view at a glance each description of a package's dependencies
  • easily switch between packages
  • easily change the version constraints on packages
  • easily add/remove/modify dependencies and scripts

Contributing

I've written the code so that it's easy to build upon, so contributors are welcome! Please check out the contributing guide. For contributor discussion about things not better discussed here in the repo, join the discord channel

Donate

If you would like to support the development of lazynpm, consider sponsoring me (github is matching all donations dollar-for-dollar for 12 months)

Work in progress

I don't use npm as heavily as I use git/docker so if you have an idea for satisfying a use case I'm not aware of, please raise an issue (and better yet a PR)

Social

If you want to see what I (Jesse) am up to in terms of development, follow me on twitter or watch me program on twitch.

More Repositories

1

lazygit

simple terminal UI for git commands
Go
51,536
star
2

lazydocker

The lazier way to manage everything docker
Go
33,364
star
3

horcrux

Split your file into encrypted fragments so that you don't need to remember a passcode
Go
3,095
star
4

OK

Welcome to the future of programming languages: OK?
Go
535
star
5

horcrux-ui

GUI for horcrux
Go
491
star
6

lazycli

Turn static CLI commands into TUIs with ease
Rust
311
star
7

notes

One place for me to put all my programmery notes
219
star
8

lazy_migrate

A little terminal UI for managing schema migrations in rails
Ruby
158
star
9

lazygit-debian

Debian package for lazygit
13
star
10

lazycore

Shared functionality for lazygit, lazydocker, etc
Go
12
star
11

generics

extensions on the official Go generics packages
Go
9
star
12

lazysession

Don't let a slow ssh connection trip up your typing speed
Go
9
star
13

CodeSlap

Push commands to your terminal console from the comfort of a text editor
JavaScript
8
star
14

wisdom

Stuff I wish I knew at the start
8
star
15

kill

simple package for killing processes
Go
6
star
16

LazyGitRuby

a simple command line tool to save you time with git
Ruby
6
star
17

react-dilemma

working through some possible solutions to a problem in react
TypeScript
5
star
18

asciigraph

Go package to make lightweight ASCII line graph β•­β”ˆβ•― in command line apps with no other dependencies.
Go
5
star
19

react-reconciliation

examples of reconciliation in react
JavaScript
2
star
20

homebrew-lazygit

Homebrew Repo for Lazygit, a UI Terminal for git
Ruby
1
star
21

immortality-reminder

1
star
22

lazygit-site

Static website for lazygit
JavaScript
1
star