Skip to content

hubject/ngconfig-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngconfig-cli

A command line tool to create angular constants from json files.

Installation

npm install @hubject/ngconfig --save-dev

Usage

ngconfig [configJsonPath] [outputJsPath] [--moduleName|-m <string>] [--useExistingModule|-x <boolean>] [--interface|-t <boolean>] [--imports|-i <array>] [--exports|-e <string>]

Example

ngconfig ./config.dev.json ./config.prod.json ./config.json ./src/app/modules/core/config/config.ts -m intercharge.core -x -i ../core -o -t

Input

config.dev.json

{
  "env": {
    "development": {
      "settings": {
        "apiEndpoint": "https://app-dev.eroaming-platform.com/v1/"
      }
    }
  }
}

config.json

{
  "env": {
    "version": 1.2.3,
    "default": {
      "settings": {
        "soap": {
          "timeout": 3000
        },
      }
    }
  }
}

Output

config.ts

import '../core';

export const env = {
  "development": {
    "settings": {
      "apiEndpoint": "https://app-dev.eroaming-platform.com/v1/"
    }
  },
  "version": 1.2.3,
  "default": {
    "settings": {
      "soap": {
        "timeout": 3000
      }
    }
  }
};

export interface ISettings {
  /* ... */
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 88.2%
  • Smarty 11.8%