gulp-ng-classify
Compile CoffeeScript classes to AngularJS modules
Last updated 5 years ago by carylandholt .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-ng-classify 
SYNC missed versions from official npm registry.

gulp-ng-classify

License Version Build Status Dependency Status

Convert CoffeeScript classes to AngularJS modules with ng-classify
Write less JavaScript. Write less CoffeeScript. Write less Angular.

Watch the screencast

Install

Install with npm

$ npm install gulp-ng-classify

Usage

CoffeeScript

gulp = require 'gulp'
ngClassify = require 'gulp-ng-classify'

gulp.task 'default', ->
	gulp.src '**/*.coffee'
		.pipe ngClassify()
		.pipe gulp.dest 'dist'

JavaScript

var gulp = require('gulp');
var ngClassify = require('gulp-ng-classify');

gulp.task('default', function () {
	return gulp.src('**/*.coffee')
		.pipe(ngClassify())
		.pipe(gulp.dest('dist'));
});

Table of Contents

API

See the ng-classify docs

ngClassify(options)

options

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'));
});

Contributing

See CONTRIBUTING.md

Changelog

See CHANGELOG.md

License

See LICENSE

Current Tags

  • 4.0.1                                ...           latest (5 years ago)

14 Versions

  • 4.0.1                                ...           5 years ago
  • 4.0.0                                ...           6 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.5.0                                ...           6 years ago
  • 0.4.0                                ...           6 years ago
  • 0.3.0                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |