1.0.2 • Published 8 years ago

@sane/service v1.0.2

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

@sane/service

A service interface, for typescript.

Install

npm install @sane/service --save

Example

import * as http from http;
import { Service, ServiceGroup } from '@sane/service';

let sg = new ServiceGroup([
    new Service(http.createServer(), { port: 31337 }),
    new Service(http.createServer(), { port: 31338 })
]);
await sg.start();
// Do stuff; both services are running now

Api

See src/index.ts. New services should implement IService (just stop and start, no args, returning Promise).

Compatibility

  • Requires Node >= v4.0.0

Release

  1. Bump up the version number in package.json
  2. Add a section for the new release in CHANGELOG.md
  3. Run npm run prepublish to ensure it builds
  4. Commit
  5. Run npm publish
  6. Create a git tag for the new release and push it