1.0.14 • Published 3 years ago

ng-programmatic v1.0.14

Weekly downloads
23
License
MIT
Repository
github
Last release
3 years ago

ng-programmatic

Azure DevOps builds Azure DevOps coverage npm

Fully typed programmatic interface for configuring and running Angular CLI commands. Primarily designed for use with taskrunners such as Gulp, but could easily be used anywhere.

Currently supports:

  • ng build
  • ng lint
  • ng test
  • ng serve

Install

$ npm i ng-programmatic

Usage

import { Ng, NgBuild } from "ng-programmatic";

// --- Assign args via constructor.
const ngBuild: NgBuild = Ng.Build({ aot: true });

// --- Assign args in bulk, will clear any existing args by default.
ngBuild.setArgs({
  baseHref: "./",
  configuration: "production"
});

// --- Assign args in bulk, with optional merge parameter to keep any existing arguments set.
ngBuild.setArgs({ aot: false }, true);

// --- Assign args individually.
ngBuild
  .setArg("aot", false)
  .setArg("baseHref", "src/")
  .setArg("configuration", "development");

// --- Get current command string.
console.log(ngBuild.toString());
// => `ng build --aot=false --baseHref=src/ --configuration=development`

// --- Run the command.
ngBuild.run().then((result) => {});
1.0.14

3 years ago

1.0.13

3 years ago

1.0.9

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.12

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago