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

module-tree-viewer

v2.1.0

Published

Lists a tree of module dependencies for any framework or language: PHP, NodeJS, ES to name a few. Just provide the entry point file and the regular expression to match for the filename on lines that loads dependent modules. If you provide regular expressi

Downloads

32

Readme

Tree module

By Weng Fei Fung

Lists a tree of module dependencies for any framework or language: PHP, NodeJS, ES to name a few. Just provide the entry point file and the regular expression to match for the filename on lines that loads dependent modules.

If you provide regular expression for comments, you could add description comments on the same lines as the dependencies being loaded, and the module tree would show descriptions next to each module. eg. require("./dependency"); // This dependency makes the plugin possible.

Mandatory: --entry fileNameHere --pattern regExpHere

Optional: --comment regExpHere --help

Example

@test-php/index.php - test-php/plugin.php ( main plugin) -- test-php/child_plugin.php -- test-php/child_plugin.php

Hints

PHP

module-tree-viewer --entry test-php/index.php --pattern "include\(.(.*).\)" --comment "//\s?(.*)

Node JS

module-tree-viewer --entry test-nodejs/index.php --pattern "require\(.(.*).\)" --comment "//\s?(.*)"

ES

module-tree-viewer --entry test-es/index.php --pattern "from .(.*)." --comment "//\s?(.*)"

Troubleshooting: Does not run?

Try installing globally sudo npm install -g module-tree-viewer

Then testing with module-tree-viewer --help

If this fails, then most likely your npm is not setup correctly. See if $NODE_PATH is empty: echo $NODE_PATH

Then find out where your node_modules is by finding the directory of npm npm which

For example, that command shows my npm directory is /usr/local/lib/node_modules/npm

So the node_modules directory is one level up: /usr/local/lib/node_modules

Finally, export your NODE_PATH to configure node correctly. In my case, it is: export NODE_PATH='/usr/local/lib/node_modules/'