ng-config

Generate Angular constants from POJO

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ng-config
101.0.09 years ago9 years agoMinified + gzip package size for ng-config in KB

Readme

ng-config
!Build Statustravis-imagetravis-url
Generate Angular constants from POJO

Usage

ng-config returns a single function that takes an optional options object and returns a string.
Example:
var fs = require('fs');
var ngConfig = require('ng-config');
var options = {
  constants: {
    hello: 'world'
  }
};

var config = ngConfig(options);

console.log(config);
// =>
// 'use strict';
// angular.module('config', [])
//   .constant('hello', 'world');

fs.writeFileSync('app/config.js', config);

The module name and template are customisable. See the source the current defaults.

See also

Author

© 2014 Tom Vincent

License

Licensed under the MIT license.