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 🙏

© 2025 – Pkg Stats / Ryan Hefner

master-inquisitor

v1.0.4

Published

Masterful inquirer library, combining most of the good inquirer libs

Readme

Master Inquisitor

Wrapper for various inquirer libraries to suit most of your requirements!

Install

npm i master-inquisitor --save

Node.js require

const inquisitor = require('master-inquisitor')

ES6 modules import

import inquisitor from 'master-inquisitor'

Import selected namespaces

import { folder, repoName } from 'master-inquisitor'

Demo

The file demo.js in the repo currently contains some "demo code".

Usage

The main API is based on inquirer-shortcuts which wraps inquirer with some additional useful methods.

const inquisitor = require('master-inquisitor')

// multiple questions
inquirer.prompt([{
  type: "input",
  name: "animal",
  message: "Favorite animal?",
  default: "wapiti"}
])
.then(results => console.log(results.animal));

// single question
inquisitor.question({
  type: "input",
  message: "Favorite animal?",
  default: "wapiti"
})
.then(animal => console.log(animal));

inquisitor.input("Favorite animal?", {default: "wapiti"})
  .then(animal => console.log(animal));

inquirer.confirm("Is the wapiti your favorite animal?")
  .then(answer => console.log(answer));

// choose single option from list
inquirer.list("Favorite animal?", ["cat", "dog", "wapiti"])
  .then(animal => console.log(animal));

// choose single option from "raw" list
inquirer.rawlist("Favorite animal?", ["cat", "dog", "wapiti"])
  .then(animal => console.log(animal));

// press key and make single selection
inquirer.expand("Favorite animal?",
                [{key: "c", name: "cat"}
                 {key: "d", name: "dog"}
                 {key: "w", name: "wapiti"}])
  .then(animal => console.log(animal));

// choose multiple options from checkbox list
inquirer.checkbox("Favorite animals?", ["cat", "dog", "wapiti"])
  .then(animals => console.log(animals));

// enter secret
inquirer.password("Enter password.")
  .then(password => console.log("Don't print passwords!"));

Extensions

List and text input combined

inquirer..question({
  type: 'list-input',
  // ...
})

Directory

Select a directory

inquirer..question({
  type: 'directory',
  // ...
})

Path

Currently unavailable babel-runtime error

Select a path

inquirer..question({
  type: 'path',
  // ...
})

Folder explorer

inquirer.folder('Please choose a folder', 'src')
.then(folder => console.log(`you selected: ${folder}`))
.catch(err => console.error(err));

Traverse

For usage, see this basic example or the advanced example

traverse({
  /* Put your branched questions object here */
  })
  .then((value) => {
    // Handle a successfull resolution ...
  })
  .catch((err) => {
    // Handle a rejection ...
  });

Menus

Choose from nested menus:

let level = 0;

const redMenu = {
  message: 'red-menu',
  choices: {
    callApi: function() {
      console.log('red-api called');
      return;
    }
  }
};

const blueMenu = {
  message: 'blue-menu',
  choices: {
    callApi: function() {
      console.log('blue-api called');
      return;
    }
  }
};

createMenu() => {
  return {
    message: 'main-menu level ' + level,
    choices: {
      setupData: () => {
        level++;
        return;
      },
      blueMenu: blueMenu,
      redMenu: redMenu
    }
  };
};

inquisitor.menu(createMenu)
  .then(() => {
    // do sth
  })
  .catch((err) => {
    console.log(err.stack);
  });

Ask for repo and npm module name

inquisitor.npmName({
  name: 'name',
  message: 'Module Name'
})
.then(answer => console.log(answer.name))

inquisitor.repoName({
  name: 'repoUrl',
  message: 'GitHub repository link (username/repo pair)'
})
.then((repoUrl) => {
})

Secret Credentials

Example will store the secrets prompted for in the file .secrets Note: result is an instance of dot-file-config

let creds = inquisitor.credentials('.secrets')
creds.prompt([
  username,
  password
])
.then((result) => {
  result.data //=> { username: 'string', password: 'string' } 
  result.save() // persists config to fs

  Object.keys(creds.config.data) //=> ['username', 'password'] })
})

Test inquirer

Test your inquire prompts, when you write code generators CLI binaries etc.

Save as dev dependency: npm i master-inquisitor --save-dev

See inquirer-test for test examples.

const inquisitor = require('master-inquisitor');
const testRun, { UP, DOWN, ENTER } = inquisitor;
// ...

ES6 modules

import testRun, { UP, DOWN, ENTER } from 'master-inquisitor';
// ...

Test suite for this project

TODO

Development

Just do it!

License

MIT