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

file-prompt

v1.2.2

Published

An interactive prompt for selecting files from a directory.

Downloads

16

Readme

File Prompt Travis npm package

An interactive prompt for files inspired by git add -i. By supplying a filter and a base directory and calling the fileprompt function you can interactively select from a list of matching files in a number of ways intended to speed up typing time trying to guess and remember paths. This tool can be used with Gulp to send a list of files to gulp.src.

Screencast of file prompt in action

Installation

Using npm:

$ npm install expect

Usage

In ES6:

import fileprompt from 'fileprompt'

fileprompt({ base: process.cwd(), glob: '*.js' })
  .then((files) => {
    // Array of absolute path files
  })
  .catch((e) => {
    // e is an instance of an Error Object that happened along the way.
  })

In ES5:

var fileprompt = require('fileprompt');

fileprompt({ base: process.cwd(), glob: '*.js' })
  .then((files) => {
    // Array of absolute path files
  })
  .catch((e) => {
    // e is an instance of an Error Object that happened along the way.
  })

Config Properties

  • config.base - Absolute path to a base directory to look for files in
  • config.glob - Glob string to filter files from the basedirectory

Input

The following methods of input are currently supposed:

Main Menu

  • {int} id - Number of the menu item to access
  • {string} name - Must uniquely identify the beginning of a menu item

Files

  • {string} * - Adds all files from the current page
  • {string} -* - Removes all files from the current page
  • {int} id - Number of the menu item to access
  • {string} name - Must uniquely identify the beginning of a file name
  • {string} n-n - Supports numeric ranges like 1-5
  • {string} -n-n - Supports removing files within the given range

You can also supply multiple arguments like 4 5-10 -8 and it will do the following:

  • Selected item # 4
  • Select items # 5 through 10
  • Unselect file # 8

Supported Features

Currently the following features are supported

Browing Directories

Lets you add files by entering directories and selecting files. Pressing <enter> will return to the main menu.

Files

Lists all levels of files matching the supplied filter. Pressing <enter> will return to the main menu.

Glob

Asks for a glob string such as **/*.js. If matches are found it will allow you to select from the list of matching files. Pressing <enter> will return to the main menu.

Changed Files

Executes git diff --name-only to get a list of files changed since the last git commit. Pressing <enter> will return to the main menu.

Credits

This tool was lovingly made for use at VenueBook.

License

BSD-3-Clause (c) 2015 VenueBook, Inc. (https://venuebook.com)