1.2.1 • Published 2 years ago

managed-service-daemon v1.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

Managed Service Daemon

A wrapper for spawning child processes as managed daemons in Node, with typescript definitions included.

Usage

Install via NPM and require in your project.

const gulp = require('gulp')
const shell = require('gulp-shell')
const { Service } = require('managed-service-daemon')
const workingDir = './.azurite'
const azuriteBlob = new Service({
  name: 'azuriteBlob',
  command: 'node',
  args: [path.normalize('./node_modules/azurite/dist/src/blob/main'), '-s', '-l', workingDir],
  startWait: 500,
  onStart: () => fs.mkdirSync(workingDir),
  onStop: () => fs.rmdirSync(workingDir, { recursive: true })
})

exports.mocha = async function mocha () {
  return shell.task(['mocha'], { ignoreErrors: true })()
}

exports.test = gulp.series(azuriteBlob.start, exports.mocha, azuriteBlob.stop)

The Service options also accept all non-overlapping child_process.spawn options; overlapping options would include stdio, for example.

Aditional options specific to the Service class can be viewed in the TypeScript code.

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.2.1

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago