Skip to content

hax/npm-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

npm-dev -- Develop Server for NPM

Run your node.js server and automatically restart if needed.

Introduction

This project is inspired by gulp-develop-server, but with some important differences:

  • Zero configuration in most use cases
  • Provide npm-dev cli
  • Your node.js process is spawned in separate process group so all child processes can be cleanly killed
  • Better APIs (in my opinion :)
  • Written in ES6+

Usage as a global tool

Install

npm install npm-dev --global

Just run npm-dev under your project directory.

Local configuration

Edit .npmdevrc

Usage as a local package

Install

npm install npm-dev --save-dev

APIs

import {Server} from 'npm-dev'

const serv = new Server()

serv.watch('lib/**/*.js')

Gulp Sample

import {Server} from 'npm-dev'

const serv = new Server()

gulp.task('start', () => {
	serv.start()
})

gulp.task('dev', () => {
	gulp.watch('lib/**/*.js', () => {
		serv.restart()
	})
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published