gulp-ng-ts

0.0.1 • Public • Published

gulp-ng-classify

Convert TypeScript classes to AngularJS modules with gulp-ng-ts
Write less JavaScript. Write less TypeScript. Write less Angular.

Watch the screencast

Install

Install with npm

$ npm install gulp-ng-ts

Usage

JavaScript

var gulp = require('gulp');
var ngTS = require('gulp-ng-ts');
 
gulp.task('default', function () {
    return gulp.src('**/*.ts')
        .pipe(ngTS())
        .pipe(gulp.dest('dist'));
});

Table of Contents

API

The following is the API for gulp-ng-ts

ngTS(options)

options

Optional
Type: Object or Function (see examples below)
Default: undefined

Dynamically create options via the function callback. The function takes in the file object and returns the options.

var gulp = require('gulp');
var ngClassify = require('gulp-ng-classify');
 
gulp.task('default', function () {
    return gulp.src('**/*.coffee')
        .pipe(ngClassify(function (file) {
            // use 'admin' as the appName if 'administrator' is found in the file path
 
            if (file.path.indexOf('administrator') !== -1) {
                return {appName: 'admin'};
            }
 
            return {appName: 'app'};
        }))
        .pipe(gulp.dest('dist'));
});

Contributing

See CONTRIBUTING.md

Changelog

See CHANGELOG.md

License

See LICENSE

Package Sidebar

Install

npm i gulp-ng-ts

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • mattduffield