Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --json option to outdated command #4434

Closed
1 task done
carloscuesta opened this issue Mar 12, 2022 · 1 comment
Closed
1 task done

Add --json option to outdated command #4434

carloscuesta opened this issue Mar 12, 2022 · 1 comment

Comments

@carloscuesta
Copy link

carloscuesta commented Mar 12, 2022

Describe the user story

As a developer, I want to be able to parse the output returned by the outdated command in a programmatic way. Right now there are only two options, a table and a list.

Describe the solution you'd like

I would like to add a --json option to the outdated command so I can parse the output of it with a script.

Here's an example:

pnpm outdated --json

The following command 👆 should return a JSON with the outdated dependencies in one of the following formats:

[
  {
    "package": "package-name",
    "current": "x.y.z",
    "latest": "x.y.z",
    "dependents": ["dependent-package"]
  }
]
{
  "package-name": {
   "current": "x.y.z",
   "latest": "x.y.z",
   "dependents": ["foo"]
  }
}

Describe the drawbacks of your solution

  • We will increase the complexity of the command options a bit.
  • We will have to maintain 3 different output formats.

Describe alternatives you've considered

  • Using the --no-table option and then parsing the output, but it's not ideal as it requires much more effort to parse the output.
@carloscuesta
Copy link
Author

Duplicate of #2705 looks like this landed in 7.15

https://github.com/pnpm/pnpm/releases/tag/v7.15.0

Screenshot 2022-11-17 at 14 53 58

Thanks! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant