Last active
July 21, 2020 20:09
-
-
Save meriturva/912b95d30c5545a16e043dd836dcb5b7 to your computer and use it in GitHub Desktop.
A simple example how to load and to parse angular.json in RAW mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as path from 'path'; | |
import { from } from 'rxjs'; | |
import { filter, tap } from 'rxjs/operators'; | |
const angularFile = require(path.join(__dirname, 'angular.json')); | |
console.log('Start: do something only on my libraries'); | |
from(Object.keys(angularFile.projects)).pipe( | |
filter(key => angularFile.projects[key].projectType === 'library'), | |
tap((projectKey: string) => { | |
// DO something on library | |
}) | |
).subscribe({ | |
complete() { | |
console.log('End: task completed'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment