Skip to content

Instantly share code, notes, and snippets.

@meriturva
Last active July 21, 2020 20:09
Show Gist options
  • Save meriturva/912b95d30c5545a16e043dd836dcb5b7 to your computer and use it in GitHub Desktop.
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
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