Electron-vue: read version from package.json

Created on 31 Jul 2017  ·  3Comments  ·  Source: SimulatedGREG/electron-vue

I want to get version from package.json

I use

const version = require(path).version;

Who know this path?

Most helpful comment

I recommend you to use app.getVersion() if you only need to get app version.

All 3 comments

@develar thank you for your replay.
I find way like this

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

export default class loadingService extends ILoading {

    constructor() {
        super();
    }

    async getVersion() { 
        return version;
    }
}

but your is better.

I recommend you to use app.getVersion() if you only need to get app version.

Was this page helpful?
0 / 5 - 0 ratings