@typescript-tools/internal-dependencies
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

internal-dependencies

License NPM Package Build Status semantic-release

Calculate package dependencies living in the same monorepo

Install

npm install --save-dev @typescript-tools/internal-dependencies

Use

Usage:
    internal-dependencies [--root <root>] [--path] <package>...

Options:
    packages         Package names or paths to print dependencies of (also reads from stdin)
    --root=<root>    Root of lerna mono-repository
    --path           Print the relative path to each package from root

internal-dependencies reads one or more packages either as arguments or from stdin, and outputs the internal dependencies that the list of packages depends upon, either directly or transitively.

Packages may be specified by path or by (scoped) name.

Examples

Note: all examples run from the root of this monorepo

Given the following package.json

{
  "name": "@typescript-tools/lerna-utils",
  "version": "2.1.1",
  "dependencies": {
    "@typescript-tools/io-ts": "^2.2.0"
  }
}

internal-dependencies prints the following

$ npx internal-dependencies @typescript-tools/lerna-utils
@typescript-tools/io-ts

$ echo @typescript-tools/lerna-utils | npx internal-dependencies
@typescript-tools/io-ts

Use --path to print the path to the dependencies rather than the package names

{
    "name": "@typescript-tools/internal-dependencies",
    "version": "2.2.4",
    "dependencies": {
        "@typescript-tools/dependency-graph": "^2.1.5",
        "@typescript-tools/find-package": "^1.1.3",
        "@typescript-tools/io-ts": "^2.2.0",
        "@typescript-tools/lerna-packages": "^2.2.2",
        "@typescript-tools/monorepo-root": "^1.3.2"
    },
    "devDependencies": {
}
$ npx internal-dependencies --path @typescript-tools/internal-dependencies
packages/dependency-graph
packages/find-package
packages/io-ts
packages/lerna-packages
packages/monorepo-root
packages/lerna-utils

/@typescript-tools/internal-dependencies/

    Package Sidebar

    Install

    npm i @typescript-tools/internal-dependencies

    Weekly Downloads

    11,340

    Version

    3.0.1

    License

    ISC

    Unpacked Size

    13.8 kB

    Total Files

    6

    Last publish

    Collaborators

    • hamroctopus
    • amchelle