Giter VIP home page Giter VIP logo

yarn-why's Introduction

yarn-why npm-version

Identifies why a package has been installed.

Difference to yarn why

  • Full requiring path (yarn why only list direct dependents).
  • Read from yarn.lock locally (no network request), blazing fast.
  • Simpler output, consistent with npm-why.

Install & Usage

npm install -g yarn-why
Usage

  $ yarn-why <package>

Examples

  $ yarn-why chalk

Related

  • npm-why - Identifies why a package has been installed (by package-lock.json).
  • nls - Missing inspector for npm packages.

License

MIT @ Amio

yarn-why's People

Contributors

amio avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

yarn-why's Issues

Maximum call stack size exceeded when running in prettier/prettier repo

~/stuffyarn-why --version
0.2.0

~/stuffnode --version
v10.9.0

~/stuffgit clone [email protected]:prettier/prettier.git
Cloning into 'prettier'...
remote: Counting objects: 46962, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 46962 (delta 3), reused 1 (delta 0), pack-reused 46950
Receiving objects: 100% (46962/46962), 23.83 MiB | 13.71 MiB/s, done.
Resolving deltas: 100% (21977/21977), done.

~/stuffcd prettier/

~/stuff/prettier masteryarn-why chalk
/home/lydell/stuff/prettier/node_modules/yarn-why/index.js:39
      return x.join('@') === target
               ^

RangeError: Maximum call stack size exceeded
    at Array.join (native)
    at meta.dependencies.Object.entries.find.x (/home/lydell/stuff/prettier/node_modules/yarn-why/index.js:39:16)
    at Array.find (<anonymous>)
    at Object.entries.filter (/home/lydell/stuff/prettier/node_modules/yarn-why/index.js:38:67)
    at Array.filter (<anonymous>)
    at lookupDependents (/home/lydell/stuff/prettier/node_modules/yarn-why/index.js:37:43)
    at dependents.forEach.dept (/home/lydell/stuff/prettier/node_modules/yarn-why/index.js:44:32)
    at Array.forEach (<anonymous>)
    at lookupDependents (/home/lydell/stuff/prettier/node_modules/yarn-why/index.js:44:16)
    at dependents.forEach.dept (/home/lydell/stuff/prettier/node_modules/yarn-why/index.js:44:32)

~/stuff/prettier 1m 28s masteryarn why chalk
yarn why v1.9.4
[1/4] Why do we have the module "chalk"...?
[2/4] Initialising dependency graph...
warning Resolution field "@babel/[email protected]" is incompatible with requested version "@babel/[email protected]"
warning Resolution field "@babel/[email protected]" is incompatible with requested version "@babel/[email protected]"
warning Resolution field "@babel/[email protected]" is incompatible with requested version "@babel/[email protected]"
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "[email protected]"
info Has been hoisted to "chalk"
info This module exists because it's specified in "dependencies".
=> Found "eslint-friendly-formatter#[email protected]"
info This module exists because "eslint-friendly-formatter" depends on it.
=> Found "jest-snapshot#[email protected]"
info This module exists because "jest-snapshot" depends on it.
=> Found "jest-message-util#[email protected]"
info This module exists because "jest-message-util" depends on it.
=> Found "jest-resolve#[email protected]"
info This module exists because "jest-resolve" depends on it.
=> Found "jest-validate#[email protected]"
info This module exists because "jest-validate" depends on it.
=> Found "eslint#[email protected]"
info This module exists because "eslint" depends on it.
=> Found "jest-watch-typeahead#[email protected]"
info This module exists because "jest-watch-typeahead" depends on it.
=> Found "inquirer#[email protected]"
info This module exists because "eslint#inquirer" depends on it.
=> Found "babel-code-frame#[email protected]"
info This module exists because "eslint#babel-code-frame" depends on it.
=> Found "postcss#[email protected]"
info This module exists because "postcss-less#postcss" depends on it.
=> Found "@babel/highlight#[email protected]"
info This module exists because "@babel#code-frame#@babel#highlight" depends on it.
=> Found "jest-matcher-utils#[email protected]"
info This module exists because "jest-snapshot#jest-matcher-utils" depends on it.
=> Found "jest-diff#[email protected]"
info This module exists because "snapshot-diff#jest-diff" depends on it.
=> Found "jest-junit#[email protected]"
info Reasons this module exists
   - "jest-junit#jest-validate" depends on it
   - Hoisted from "jest-junit#jest-validate#chalk"
=> Found "snapshot-diff#[email protected]"
info Reasons this module exists
   - "snapshot-diff#jest-snapshot" depends on it
   - Hoisted from "snapshot-diff#jest-snapshot#chalk"
   - Hoisted from "snapshot-diff#jest-snapshot#jest-message-util#chalk"
   - Hoisted from "snapshot-diff#jest-snapshot#jest-resolve#chalk"
=> Found "jest-cli#[email protected]"
info This module exists because "jest#jest-cli" depends on it.
=> Found "eslint-formatter-pretty#[email protected]"
info This module exists because "prettylint#eslint-formatter-pretty" depends on it.
=> Found "table#[email protected]"
info This module exists because "eslint#table" depends on it.
=> Found "postcss-scss#[email protected]"
info Reasons this module exists
   - "postcss-scss#postcss" depends on it
   - Hoisted from "postcss-scss#postcss#chalk"
=> Found "har-validator#[email protected]"
info This module exists because "codecov#request#har-validator" depends on it.
=> Found "log-symbols#[email protected]"
info This module exists because "prettylint#eslint-formatter-pretty#log-symbols" depends on it.
=> Found "jest-watcher#[email protected]"
info This module exists because "jest#jest-cli#jest-watcher" depends on it.
=> Found "jest-runtime#[email protected]"
info This module exists because "jest#jest-cli#jest-runtime" depends on it.
=> Found "jest-config#[email protected]"
info This module exists because "jest#jest-cli#jest-config" depends on it.
=> Found "jest-util#[email protected]"
info This module exists because "jest#jest-cli#jest-util" depends on it.
=> Found "jest-jasmine2#[email protected]"
info This module exists because "jest#jest-cli#jest-config#jest-jasmine2" depends on it.
=> Found "jest-each#[email protected]"
info This module exists because "jest#jest-cli#jest-config#jest-jasmine2#jest-each" depends on it.
Done in 2.68s.

Support Yarn 2 PnP

Starting from Yarn 2, packages are stored in a PnP environment (see https://yarnpkg.com/features/pnp). At the moment, yarn-why can't see them, but only packages in the node_modules folder. Even adding the nodeLinker property into the yarnrc file to store packages in node_modules folder doesn't work (I think yarn.lock has changed its format)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.