Giter Club home page Giter Club logo

qnm's Introduction

qnm-logo

๐Ÿ” A simple cli utility for querying the node_modules directory

Build Status NPM version License

fuzzy-search

Why?

most bugs are caused by the assumptions we didn't realize we were making.

When debugging a problem, I sometimes find myself checking what are the installed versions of the modules within node_modules directory. Current solutions like running npm list are not fast enough and prints too much clutter, checking the version in the package.json takes a bit more effort and doesn't give you more information regarding other occurrences of this module.

qnm aims to get this information fast and tries to filter only the important parts, while supporting both yarn & npm.

Features

  • ๐Ÿ’ฌ Tab completions
  • โœจ Interactive fuzzy-search
  • ๐Ÿ”ค Match all packages with a specific string
  • โ‰๏ธ Explain why a package was installed
  • ๐Ÿ“š Supports monorepos

Installation

npm i --global qnm

Usage

qnm [module]

For example, if you want to see the installed versions of lodash:

qnm lodash

And you'll see something like that:

lodash
โ”œโ”€โ”€ 4.17.5
โ”œโ”€โ”ฌ cli-table2
โ”‚ โ””โ”€โ”€ 3.10.1
โ””โ”€โ”ฌ karma
  โ””โ”€โ”€ 3.10.1

Which means you have 3 occurrences of lodash in your node_modules:

  1. ./node_module/lodash
  2. ./node_module/cli-table2/node_modules/lodash
  3. ./node_module/karma/node_modules/lodash

Fuzzy-search

Use qnm command without arguments to trigger an fzf like fuzzy search.

  • Start typing to filter the matches from your node_modules
  • Use arrows to move cursor up and down
  • Enter key to select the item, CTRL-C / ESC to exit
  • TAB and Shift-TAB to mark multiple items

Options

-o , --open

Open the module's package.json file with the default editor.

-d, --debug

See full error messages, mostly for debugging.

--disable-colors

Disables the most of colors and styling. E.g. version colors.

Commands

list

alias: ls

Returns a list of all modules in node_modules directory.

qnm list
Optional arguments Description
--deps List the versions of direct dependencies and devDependencies.

match

Works like grep, and match's any module that includes the supplied string.

For example, i want to see which eslint plugins i have installed:

> qnm match eslint-plug

eslint-plugin-babel
โ””โ”€โ”€ 3.3.0

eslint-plugin-lodash
โ””โ”€โ”€ 2.6.1

eslint-plugin-mocha
โ””โ”€โ”€ 4.12.1

eslint-plugin-react
โ””โ”€โ”€ 6.10.3

homepage

Opens package "homepage" property in your browser.

install-completions

Run to install tab completions using tabtab (Setup only once)

Contributing

Help is always welcome! Please head to the CONTRIBUTING.md file to see how to get started.

License

The MIT License

qnm's People

Contributors

dependabot[bot] avatar dvakatsiienko avatar ealush avatar lavgl avatar peetwriter avatar ranyitz avatar ronami avatar rulsky avatar sidoruk-sv avatar sleepwalker avatar vsashyn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.