schematics-utilities
schematics-utilities copied to clipboard
add new function 'getJSON'
When trying to edit file '/tsconfig.json', there found no suitable functions. Considering add the follow function(from here):
export function getJSON(host: Tree, jsonFile: string, type?: string): any {
if (!host.exists(jsonFile)) return null;
const sourceText = host.read(jsonFile)!.toString('utf-8');
const json = JSON.parse(sourceText);
if (type && !json[type]) {
json[type] = {};
}
return json;
}
Maybe it's should be classified as 'third-lib'
HI,
Sorry for the very long wait. It sounds useful, would you like to implement it and open a PR?