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

whichpm

v0.2.0

Published

CLI that Locates and reports information about installed Perl modules.

Downloads

15

Readme

npm version license

Contents

whichpm — introduction

whichpm is a cross-platform CLI that locates installed Perl modules, and optionally reports information about them, including detection of accidental duplicates.

Analogous to how the common which Unix utility locates binaries by their filename, whichpm locates Perl modules by their module (package) name.

Examples

# Locate the Data::Dumper module.
$ whichpm Data::Dumper
/usr/lib/perl/5.18/Data/Dumper.pm

# Locate the Data::Dumper module, and also print
# version information and core-module status.
$ whichpm -v Data::Dumper
Data::Dumper    2.145   core>=5.005 /usr/lib/perl/5.18/Data/Dumper.pm

# Locate the Data::Dumper module and open it in your system's default text
# editor.
$ whichpm -e Data::Dumper

# Look for accidental duplicates of the Foo::Bar module.
# Normally, only 1 path should be returned.
$ whichpm -a Foo::Bar
/usr/lib/perl/5.18/Foo/Bar.pm
./Foo/Bar.pm

# Print the paths of all installed modules.
$ whichpm -a

Installation

Supported platforms and prerequisites

Linux, macOS, and Windows, with Perl v5.4.50 or higher installed.

Installation from the npm registry

Note: Even if you don't use Node.js, its package manager, npm, works across platforms and is easy to install with curl -L http://git.io/n-install | bash

With Node.jsinstalled, install the package as follows:

[sudo] npm install whichpm -g

Note:

  • Whether you need sudo depends on how you installed Node.js and whether you've changed permissions later; if you get an EACCES error, try again with sudo.
  • The -g ensures global installation and is needed to put whichpm in your system's $PATH.

Manual installation (macOS and Linux)

  • Download the CLI as whichpm.
  • Make it executable with chmod +x whichpm.
  • Move it or symlink it to a folder in your $PATH, such as /usr/local/bin (macOS) or /usr/bin (Linux).

Usage

Find brief usage information below; for complete documentation, run whichpm --man or read the manual online.

$ whichpm --help


Prints the filesystem paths of the specified Perl modules, if installed.

    whichpm    [-v] [-q] [-e] <module_name>...
    whichpm -a [-v] [-q] [-e] [<module_name>...]

    -a ... lists all installed module files / all module files matching  
           the specified name(s) (checks for accidental duplicates)
    -v ... verbose mode: also prints name, version, core-module status
    -q ... suppresses warnings
    -e ... opens modules in default text editor

Standard options: --help, --man, --version, --home

License

Copyright (c) 2020 Michael Klement [email protected] (http://same2u.net), released under the MIT license.

Acknowledgements

This project gratefully depends on the following open-source components, according to the terms of their respective licenses.

npm dependencies below have optional suffixes denoting the type of dependency; the absence of a suffix denotes a required run-time dependency: (D) denotes a development-time-only dependency, (O) an optional dependency, and (P) a peer dependency.

npm dependencies

Changelog

Versioning complies with semantic versioning (semver).

  • v0.2.0 (2020-01-14):

    • [enhancement] If duplicate module search paths are found in @INC, a warning is now issued (suppress with -q). Technically, this is a breaking change in that previous callers may not anticipate the additional stderr output.
  • v0.1.8 (2020-01-14):

    • [doc] Read-me improvements.
    • [dev] Dev dependencies updated.
  • v0.1.7 (2015-09-16):

    • [doc] man page improvements.
  • v0.1.6 (2015-09-16):

    • [doc] man page improvements.
  • v0.1.5 (2015-09-15):

    • [dev] Makefile improvements; various other behind-the-scenes tweaks.
  • v0.1.4 (2015-09-03):

    • [dev] Missing dev. dependency marked-man added.
  • v0.1.3 (2015-09-02):

    • [doc] Formatting error in man page corrected.
  • v0.1.2 (2015-09-02):

    • [fix] Fixed too-permissive check for the -h / --help option.
  • v0.1.1 (2015-09-02):

    • [fix] Fixed broken man-page installation - man whichpm should now work on Linux and OSX.
  • v0.1.0 (2015-09-01):

    • Initial release.