Anyul Rivas Anyul Rivas - 1 year ago 62
React JSX Question

display the current npm version of my NodeJs app

I just want to display the version value of my package.json file within the footer of my app, but have no idea how to do that. I've read you could access those properties with process env object. Is it correct?

Answer Source

If you're running your app within NodeJs, you can access it by doing


With ES6, you can also do

import {version} from './package.json';