gulp-ng-classify
Convert CoffeeScript classes to AngularJS modules with ng-classify
Write less JavaScript. Write less CoffeeScript. Write less Angular.Watch the screencast
Install with npm
$ npm install gulp-ng-classify
gulp = require 'gulp'
ngClassify = require 'gulp-ng-classify'
gulp.task 'default', ->
gulp.src '**/*.coffee'
.pipe ngClassify()
.pipe gulp.dest 'dist'
var gulp = require('gulp');
var ngClassify = require('gulp-ng-classify');
gulp.task('default', function () {
return gulp.src('**/*.coffee')
.pipe(ngClassify())
.pipe(gulp.dest('dist'));
});
See the ng-classify docs
Optional
Type: Object
(see ng-classify API) 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.
gulp = require 'gulp'
ngClassify = require 'gulp-ng-classify'
gulp.task 'default', ->
gulp.src '**/*.coffee'
.pipe ngClassify (file) ->
# use 'admin' as the appName if 'administrator' is found in the file path
return if file.path.indexOf('administrator') isnt -1
{appName: 'admin'}
{appName: 'app'}
.pipe gulp.dest 'dist'
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'));
});
See CONTRIBUTING.md
See CHANGELOG.md
See LICENSE