All Projects → narirou → Gulp Develop Server

narirou / Gulp Develop Server

Licence: mit
Development assistant for node.js server by gulp

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gulp Develop Server

Meantorrent
meanTorrent - MEAN.JS BitTorrent Private Tracker - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js, A BitTorrent Private Tracker CMS with Multilingual, and IRC announce support, CloudFlare support. Demo at:
Stars: ✭ 438 (+508.33%)
Mutual labels:  gulp, express
Gulp Jsonlint
🔍 jsonlint plugin for Gulp
Stars: ✭ 26 (-63.89%)
Mutual labels:  gulp, gulp-plugin
Gulp Shell
A handy command line interface for gulp
Stars: ✭ 474 (+558.33%)
Mutual labels:  gulp, gulp-plugin
gulp-convert-encoding
Plugin for gulp to convert files from one encoding to another.
Stars: ✭ 15 (-79.17%)
Mutual labels:  gulp, gulp-plugin
Express Mvc Boilerplate
A simple mvc boilerplate for express.js (gulp + expressjs + nodemon + browser-sync)
Stars: ✭ 46 (-36.11%)
Mutual labels:  gulp, express
gulp-markdown-to-json
Parse Markdown and YAML → compile Markdown to HTML → wrap it all up in JSON
Stars: ✭ 76 (+5.56%)
Mutual labels:  gulp, gulp-plugin
Gulp Angular Templatecache
Concatenates and registers AngularJS templates in the $templateCache.
Stars: ✭ 530 (+636.11%)
Mutual labels:  gulp, gulp-plugin
gulp-iife
A Gulp plugin for wrapping JavaScript code in IIFEs.
Stars: ✭ 39 (-45.83%)
Mutual labels:  gulp, gulp-plugin
Vue Express Webpack Gulp
使用Vue,Express,Webpack,gulp搭建的自动化电影库项目
Stars: ✭ 42 (-41.67%)
Mutual labels:  gulp, express
Docker Compose Nodejs Examples
Finally some real world examples on getting started with Docker Compose and Nodejs
Stars: ✭ 944 (+1211.11%)
Mutual labels:  gulp, express
gulp-yarn
Automatically install node modules using Yarn. 😻
Stars: ✭ 22 (-69.44%)
Mutual labels:  gulp, gulp-plugin
Gulp Require Tasks
Splits Gulpfile into multiple individual files
Stars: ✭ 51 (-29.17%)
Mutual labels:  gulp, gulp-plugin
anyfs
Portable file system for Node
Stars: ✭ 17 (-76.39%)
Mutual labels:  gulp, gulp-plugin
Video.github.io
🎬视频网站项目已实现功能: 首页导航栏,中部轮播图,以及电影列表的展现,底部导航链接 注册页面 视频播放页面 搜索页面 登录页面 用户管理页面 一键安装 电影抓取 等功能。基于NodeJS的Express框架开发的动态网站项目,下面也提供了本程序的相关演示站点。
Stars: ✭ 413 (+473.61%)
Mutual labels:  gulp, express
gulp-golang
gulp plugin for golang projects
Stars: ✭ 13 (-81.94%)
Mutual labels:  gulp, gulp-plugin
Gulp Pug
Gulp plugin for compiling Pug templates
Stars: ✭ 512 (+611.11%)
Mutual labels:  gulp, gulp-plugin
gulp-recess
[DEPRECATED] Lint CSS and LESS with RECESS
Stars: ✭ 42 (-41.67%)
Mutual labels:  gulp, gulp-plugin
gulp-tinypng-compress
TinyPNG API wrapper for compressing PNG & JPG images
Stars: ✭ 49 (-31.94%)
Mutual labels:  gulp, gulp-plugin
Express Reloadable
Automatically hot-swap Express server code without the restart
Stars: ✭ 20 (-72.22%)
Mutual labels:  express, developer-tools
Generator Gulp Plugin Boilerplate
Scaffold out a Gulp plugin boilerplate
Stars: ✭ 46 (-36.11%)
Mutual labels:  gulp, gulp-plugin

gulp-develop-server

run your node.js server and automatically restart with gulp.

Build Status Dependency Status Test Coverage Npm Modules MIT Licensed

gulp-develop-server is a development assistant for node.js server that runs the process and automatically restarts it when a file is modified.

installation

npm install gulp-develop-server --save-dev

usage

var gulp   = require( 'gulp' ),
    server = require( 'gulp-develop-server' );

// run server
gulp.task( 'server:start', function() {
    server.listen( { path: './app.js' } );
});

// restart server if app.js changed
gulp.task( 'server:restart', function() {
    gulp.watch( [ './app.js' ], server.restart );
});

api

###server.listen( options[, callback] )

options {Object}

  • path

    • type: {String}
    • example: './your_node_app.js'
    • Your node application path. This option is required.
  • env

    • type: {Object}
    • default: { NODE_ENV: 'development' } (extends current process.env)
    • example: { PORT: 3000, NODE_ENV: 'production' }
    • Environment settings of your server.
  • cwd

    • type: {String}
    • default: .
    • example: path/to/my/project/
    • Current working directory of the child process
  • args

    • type: {Array}
    • your application's arguments
  • execArgv

    • type: {Array}
    • example: [ '--harmony' ]
    • Run node process with this options.
  • delay

    • type: {Number}
    • default: 600
    • If this plugin does not receive an error from the server after options.delay seconds, assumes the server listening success.
    • This option needs to adjust according to your application's initialize time.
    • If this option set 0, it will only check successMessage.
  • successMessage

    • type: {RegExp}
    • default: /^[Ss]erver listening/
    • If your application send the specific message by process.send method, this plugin assumes the server listening success.
  • errorMessage

    • type: {RegExp}
    • default: /[Ee]rror:/
    • If this plugin receives the specific error message that matched this RegExp at start-up, assumes the server has error.
  • killSignal

    • type: {String}
    • default: SIGTERM

callback( error )

###server.restart( [callback] ) / server.changed( [callback] )

callback( error )

###server( [options] )

Create a Transform stream. Restart the server at once when this stream gets files.

###server.kill( [signal, callback] )

Send kill signal to the server process.
signal {String}
callback( error )

###server.reset( [signal, callback] )

Send kill signal to the server process and reset the options to default.
signal {String}
callback( error )

more examples

####with gulp-livereload:

var gulp       = require( 'gulp' ),
    server     = require( 'gulp-develop-server' ),
    livereload = require( 'gulp-livereload' );

var options = {
    path: './apps/app.js'
};

var serverFiles = [
    './apps/app.js',
    './routes/*.js'
];

gulp.task( 'server:start', function() {
    server.listen( options, livereload.listen );
});

// If server scripts change, restart the server and then livereload.
gulp.task( 'default', [ 'server:start' ], function() {
    
    function restart( file ) {
        server.changed( function( error ) {
            if( ! error ) livereload.changed( file.path );
        });
    }

    gulp.watch( serverFiles ).on( 'change', restart );
});

####with BrowserSync:

var gulp   = require( 'gulp' ),
    server = require( 'gulp-develop-server' ),
    bs     = require( 'browser-sync' );

var options = {
    server: {
        path: './apps/app.js',
        execArgv: [ '--harmony' ]
    },
    bs: {
        proxy: 'http://localhost:3000'
    }
};

var serverFiles = [
    './apps/app.js',
    './routes/*.js'
];

gulp.task( 'server:start', function() {
    server.listen( options.server, function( error ) {
        if( ! error ) bs( options.bs );
    });
});

// If server scripts change, restart the server and then browser-reload.
gulp.task( 'server:restart', function() {
    server.restart( function( error ) {
        if( ! error ) bs.reload();
    });
});

gulp.task( 'default', [ 'server:start' ], function() {
    gulp.watch( serverFiles, [ 'server:restart' ] )
});

####use as a stream:

var gulp   = require( 'gulp' ),
    server = require( 'gulp-develop-server' ),
    bs     = require( 'browser-sync' ),
    coffee = require( 'gulp-coffee' );

var options = {
    server: {
        path: './apps/app.js',
        execArgv: [ '--harmony' ]
    },
    bs: {
        proxy: 'http://localhost:3000'
    }
};

var serverCoffee = [
    './src/*.coffee'
];

gulp.task( 'server:start', function() {
    server.listen( options.server, function( error ) {
        if( ! error ) bs( options.bs );
    });
});

// If server side's coffee files change, compile these files,
// restart the server and then browser-reload.
gulp.task( 'server:restart', function() {
    gulp.src( serverCoffee )
        .pipe( coffee() )
        .pipe( gulp.dest( './apps' ) )
        .pipe( server() )
        .pipe( bs.reload({ stream: true }) );
});

gulp.task( 'default', [ 'server:start' ], function() {
    gulp.watch( serverCoffee, [ 'server:restart' ] );
});

thanks

@pronebird
@vkareh
@chimerast
@silverbp
@tomxtobin

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].