Reputation: 423
How can one retrieve the version of a specific package used in a NodeJS app?
That is, I want to find it out on JavaScript level.
Upvotes: 1
Views: 628
Reputation: 402
You can try do it like this:
const { dependencies } = require('./package.json');
console.log('React version: ', dependencies.react)
Upvotes: 4