A service interface, for typescript.
npm install @sane/service --save
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
See src/index.ts. New services should implement IService (just stop and start, no args, returning Promise).
- Requires Node >= v4.0.0
- 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