Coder Social home page Coder Social logo

alt-yarn-why's Introduction

alt-yarn-why CI

yarn why is cool, but sometimes it doesn't show what i want....

Specifically I realized, it’s a little tricky to see:

  • how many versions of a given library are present
  • what directly is depending on all those versions, keeping them around.

This library aims to help answer those questions.

usage

  Usage
    $ alt-yarn-why <command> <...args>

  Commands:
    who-depends-on

    This command helps you understand which dependencies depend on a given
    package-name, by telling you both all the versions of this dependency
    present, and it's dependents.

    Example
      $ alt-yarn-why who-depends-on  ./yarn.lock fs-extra
    
      > {
           "[email protected]": {
             "[email protected]": 1
           },
           "[email protected]": {
             "[email protected]": 1,
             "[email protected]": 1
           },
           ...
           "[email protected]": {}
      }
    

    Other Examples
      $ alt-yarn-why who-depends-on yarn.lock 'ember-cli-version-checker'
      $ alt-yarn-why who-depends-on yarn.lock 'ember-cli-version-checker@4'
      $ alt-yarn-why who-depends-on yarn.lock 'ember-cli-version-checker@4 || 5'


    duplicates

    This command quickly surface duplicate dependencies. These are sorted by
    most duplicated to least.

    Example
      $ alt-yarn-why duplicates  ./yarn.lock
    
      > [
          {
            "name": "debug",
            "total": 17,
            "versions": {
              "2.6.9": 7,
              "4.2.0": 4,
              "3.2.6": 4,
              "3.1.0": 1,
              "4.1.1": 1
            }
          },
          {
            "name": "rimraf",
            "total": 15,
            "versions": {
              "2.6.3": 2,
              "2.7.1": 11,
              "3.0.2": 2
            }
          }
        ]
    

    Other Examples
      $ alt-yarn-why dupcliates yarn.lock | jq '.[:5]' # Show Top 5 Duplicates

as a library

yarn add alt-yarn-why
// index.mjs
import { whoDependsOn, duplicates } from 'alt-yarn-why';

whoDependsOn(pathToLockFile, packageName) === { /* dictionary of <matched> to [...retainers] */ }
duplicates(pathToLockFile) === [ /* list of duplicates, their versions and totals */ ];

alt-yarn-why's People

Contributors

stefanpenner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.