Adriano P
Adriano P

Reputation: 2135

Is there a way to get version from package.json in Meteor code?

This answer explains how to read the package.json "version" from a npm started application. Is there an env variable in Meteor (1.3+) with this info?

Upvotes: 1

Views: 804

Answers (1)

Pankaj Jatav
Pankaj Jatav

Reputation: 2184

Well, there is not npm_package_version environment value in process object.

But you get the value of version using following code :

var pjson = require('/package.json'); 
console.log(pjson.version); // This will print the version

Upvotes: 4

Related Questions