@sane/service
v1.0.2
Published
A service interface, for typescript.
Downloads
2
Readme
@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
- Bump up the version number in package.json
- Add a section for the new release in CHANGELOG.md
- Run npm run prepublish to ensure it builds
- Commit
- Run npm publish
- Create a git tag for the new release and push it