UNPKG

nx

Version:

The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.

17 lines (16 loc) 594 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.readNameFromPackageJson = readNameFromPackageJson; const fileutils_1 = require("../../../../utils/fileutils"); function readNameFromPackageJson() { let appName = 'webapp'; if ((0, fileutils_1.fileExists)('package.json')) { const json = (0, fileutils_1.readJsonFile)('package.json'); if (json['name'] && json['name'].length && json['name'].replace(/\s/g, '').length) { appName = json['name'].replace(/\s/g, ''); } } return appName; }