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

npmfosjs

v1.0.34

Published

Fuzzy search npm package with fzf

Downloads

194,056

Readme

npm-fzf

npm node David David

install size Build Status Github issues Known Vulnerabilities Commitizen friendly

Fuzzy search npm modules with fzf

npm-fzf, short-named npf, provides fuzzy search for some most commonly used npm commands with fzf, i.e. npm ls, npm search, npm run, creating a more fulfilling develop experience with npm.

Requirements

Must: npf requires Node 8 for runtime or above.

Highly Recommended: fzf is used heavily by npf. If fzf is not installed, npf will default to a much less capable sibling, node-fzf - fzf's implementation in Node.

CLI

$ npm install -g npm-fzf

Usage

Usage: npf [options] [command]

Fuzzy search npm modules with fzf

Options:
  -v, --version       output the version number
  -d, --details       include details to each dependency, but disable the fuzzy mode
  -P, --no-preview    disable the default fzf preview mode
  -F, --no-fuzzy      disable the default fuzzy mode and resort to stdout
  -h, --help          output usage information

Commands:
  list|ls [options]   npm list with fzf
  info [module]       npm info with fzf
  run                 npm run with fzf
  search <module...>  npm search with fzf

npf search

Usage: search [options] <module...>

npm search with fzf

Options:
  -h, --help  output usage information

  Examples:
    npf search <module...>, fuzzy search for npm modules with preview
    npf search <module...> --no-preview, fuzzy search for npm modules without preview
    npf search <module...> --no-fuzzy, plain search for npm modules
$ npf search express
$ npf search express react

npf list

Usage: list|ls [options]

npm list with fzf

Options:
  -l, --local   list local dependencies, which is also the default feature
  -g, --global  list global modules
  -t, --time    show the latest global installs
  -h, --help    output usage information

  Examples:
    npf ls, a fzf list with preview of local dependencies
    npf ls -t, a fzf list of latest global installs
    npf ls -t --no-fuzzy, a normal list of latest global installs
    npf ls -g --no-preview, a fuzzy list with no preview of global installs
    npf ls -g --details, a normal, detailed list of global installs

Local dependencies

$ npf ls

Global modules

$ npf ls -g

Recent global installs

A quick refresher on what the heck it's installed/upgraded globally in the recent past

$ npf ls -t

Turn off preview mode

Preview mode uses fzf --preview underneath and is turned on in most cases by default. You can also opt for --no-preview to turn off the default preview mode.

$ npf ls -t --no-preview
$ npf ls -g --no-preview
$ npf ls -l --no-preview

Turn off fuzzy mode

Fuzzy mode is by default on. You can also opt for --no-fuzzy to turn it off.

$ npf ls -t --no-fuzzy
$ npf ls -g --no-fuzzy

Details flag

Applied to both local dependencies and global installs

$ npf ls --details
$ npf ls -g --details

npf run

Usage: run [options]

npm run with fzf

Options:
  -h, --help  output usage information

  Examples:
    npf run, execute npm scripts with fzf
    npf run --no-fuzzy, execute npm scripts without fzf
$ npf run

npf info

Usage: info [options] [module]

npm info with fzf

Options:
  -h, --help  output usage information

  Examples:
    npf info [module], a fuzzy list with preview of a module's dependencies fetched from NPM registry
    npf info [module] --no-preview, a fuzzy list of a module's dependencies fetched from NPM registry
    npf info [module] --no-fuzzy, a list of a module's dependencies fetched from NPM registry

npf info fetches the module's latest version by default, unless a version is specified.

It defaults to the current folder if no argument provided.

$ npf info npm-fzf

API

npf uses npmlist's API for getting modules' dependencies. npf itself does not expose any API.

$ npm install @hankchanocd/npmlist

Tests

To perform unit tests and integration tests, simply run npm test. (Need Help)

Changelog

CHANGELOG

Contribution

If you have any suggestion, leave it on Issues for discussion first. See here on how to contribute.

fzf empowers many features that would otherwise be hard to imagine. If you haven't heard of fzf, check out junegunn's fzf. Check out my Dotfiles to see more use cases of fzf.

License

MIT