R0byn
R0byn

Reputation: 423

Get version of specific package inside node.js app

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

Answers (1)

Will Black
Will Black

Reputation: 402

You can try do it like this:

const { dependencies } = require('./package.json');
console.log('React version: ', dependencies.react)

Upvotes: 4

Related Questions