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

jumping

v1.5.0

Published

Assign custom aliases to directories and quickly jump to them from anywhere.

Downloads

38

Readme

Jumping

Assign custom aliases to directories and quickly jump to them from anywhere.

Installation

npm i -g jumping

Put the following in your ~/.bashrc or ~/.zshrc file:

j(){
	local dir
	dir="$(jumping --get "$1")"
	[[ -d "$dir" ]] && cd "$dir"
}

d(){
	jumping --set "$@"
}

o(){
	local dir
	dir="$(jumping --get "$1")"
	[[ -d "$dir" ]] && open "$dir" && exit
}

You can choose names other than j and d, but this document will assume you're using the same names.

Usage

d <alias> # defines an alias at the current working directory
j <alias> # jumps to the directory associated with an alias
o <alias> # opens the directory associated with an alias and closes the terminal window
jumping # lists all aliases

Guide

When you're in a directory and you realize you might want to access it later, just run d <alias>. For example, if I'm in ~/Desktop/repositories/fuzzyhome, I might make an alias rf:

d rf

Later, when I want to change to the ~/Desktop/repositories/fuzzyhome directory, I can jump to it from anywhere with:

j rf

Or, if I'd rather just open the directory with Finder and close the terminal window, I can do:

o rf

This works well with hotkey daemons such as skhd. If I want to navigate to a folder in Finder, I simply open a terminal with cmd + return per my skhd hotkey:

cmd - return : open -a Terminal ~/Desktop

Then I type o rf, and the relevant finder window opens while the terminal closes.

Extras

I prefer j with no arguments to fuzzy find files recursively.

To do this, install:

brew install fd fzy

And add the following to your ~/.zshrc:

# jumping
j(){
	if [ $# -eq 0 ]; then
		local item
		item=$(\fd | fzy -l max)
		if [[ -f "$item" ]]; then
			cd "$(dirname "$item")"
		elif [[ -d "$item" ]]; then
			cd "$item"
		fi
	else
		local dir
		dir="$(jumping --get "$1")"
		[[ -d "$dir" ]] && cd "$dir"
	fi
}

FAQ

Why do I have to edit my ~/.bashrc or ~/.zshrc?

Programs cannot change the directory of the underlying shell. So we just use jumping to set and get our aliases, while our shell function does the actual directory changing.