Read package.json file.
npm install @jswork/read-pkg-json
import readPkgJson from '@jswork/read-pkg-json';
// 1. current dir
const pkg = readPkgJson();
// 2. specify dir
const pkg = readPkgJson('path/to/your/project');
/// <reference types="@jswork/read-pkg-json/global.d.ts" />
Code released under the MIT license.