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

shameimaru

v1.0.6

Published

Shameimaru Aya likes to traverse node_modules and capture the tree

Downloads

976

Readme

Shameimaru.js

Shameimaru Shameimaru Build Status Coverage Status License Dependency Status

Shameimaru Aya likes to traverse node_modules and capture the tree.

Shameimaru

Installation

$ npm install --save shameimaru

Usage

const Shameimaru = require("shameimaru");

const shameimaru = new Shameimaru("<YOUR_PROJ_ROOT>");

<YOUR_PROJ_ROOT> is the root path which contains node_modules of your project.

After create the Shameimaru instance, you can do traverse() through it.

const ret = await shameimaru.traverse();

Then you'll get a may-flatten graph-form tree. e.g.

{
  "@crand/mt19937": {
    "ref": "5c2f5c96-9c29-4f3f-8cc1-ec6ab1f4025b",
    "name": "@crand/mt19937",
    "version": "2.0.0",
    "from": "@crand/[email protected]",
    "resolved": "http://registry.npm.taobao.org/@crand/mt19937/download/@crand/mt19937-2.0.0.tgz",
    "exists": true,
    "rawSpec": "*"
  },
  "any-promise": {
    "ref": "78325895-5945-4180-97dd-a01c705b254e",
    "name": "any-promise",
    "version": "0.2.0",
    "from": "[email protected]",
    "resolved": "http://registry.npm.taobao.org/any-promise/download/any-promise-0.2.0.tgz",
    "exists": true,
    "rawSpec": "0.2.0"
  },
  "mz": {
    "ref": "63bb611b-232d-4f7a-ba53-3322670ed170",
    "name": "mz",
    "version": "2.7.0",
    "from": "[email protected]",
    "resolved": "http://registry.npm.taobao.org/mz/download/mz-2.7.0.tgz",
    "exists": true,
    "rawSpec": "^2.7.0",
    "dependencies": {
      "any-promise": {
        "ref": "41f0b04f-0904-432f-aa33-13e5cbb8fcdc",
        "name": "any-promise",
        "version": "1.3.0",
        "from": "[email protected]",
        "resolved": "http://registry.npm.taobao.org/any-promise/download/any-promise-1.3.0.tgz",
        "exists": true,
        "rawSpec": "^1.0.0"
      }
    },
    ...
  },
  ...
}

Each element in the result may contains keys as below:

  • ref: a random referrence sign in this tree, it's unique; e.g. 63bb611b-232d-4f7a-ba53-3322670ed170
  • name: the name of this package (dependency); e.g. toshihiko
  • version: the name of this package (dependency); e.g. 2.7.0
  • from: same as _from in installed package.json; e.g. mz@^2.0.0
  • resolved: same as _resolved in installed package.json; http://registry.npm.taobao.org/mz/download/mz-2.7.0.tgz
  • exists: whether it's really exist in current tree folder; e.g. true
  • ancestor: if it matches a exactly the same package at any upper directory, it indicates that element's ref; e.g. 63bb611b-232d-4f7a-ba53-3322670ed170
  • rawSpec: the raw spec of this package in its parent's package.json; e.g. ^2.0.0
  • adjustHere: this package is not need by its parent, but some package need it flatten here; e.g. true
  • missing: if we can't find this package at any right path, then it will be true; e.g. true

Contribute

You're welcome to fork and make pull requests!