gulp-ng-json2js

0.1.1 • Public • Published

gulp-ng-json2js

The plugin to wrap json fixtures as an angular value

What is the result?

See here

Install

npm install gulp-ng-json2js

Usage

var gulp=require('gulp');

var json2js=require('gulp-ng-json2js');
var concat=require('gulp-concat');

gulp.task('fixtures',function(){
    return gulp.src('./test/fixtures/**/*.json')
                .pipe(json2js({
                    moduleName:'app.fixtures'
                }))
                .pipe(concat('fixtures.js'))
                .pipe(gulp.dest('./build/'));
});

options.moduleName

Type: Sting Default: json

The name of the generated AngularJS module.

options.prefix

Type: String

The prefix which should be prepended to the file path to generate the file url.

options.postfix

Type: String Default: Value

The postfix which should be append to the value name.

options.stripPrefix

Type: String

The prefix which should be subtracted from the file path to generate the file url.

options.rename

Type: Function

A function that allows the generate file url to be manipulated. For example:

function (url) {
  return url.replace('.json', '');
}

AND

gulp fixtures

Tests

npm test

License

Package Sidebar

Install

npm i gulp-ng-json2js

Weekly Downloads

92

Version

0.1.1

License

MIT

Last publish

Collaborators

  • galkinrost