diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml new file mode 100644 index 0000000..bb49c22 --- /dev/null +++ b/.github/workflows/build-and-push.yaml @@ -0,0 +1,24 @@ +name: Node.js package + +on: + push: + branches: + - main + +env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + +jobs: + build-test-publish: + runs-on: ubuntu-latest + timeout-minutes: 6 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '16.x' + - run: npm install + - run: npm test + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ env.NPM_TOKEN }} \ No newline at end of file diff --git a/index.d.ts b/index.d.ts index 1ca6ece..cc137d8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,9 +1,11 @@ interface OnShutdown { - (handler: ()=> Promise): void - (name: string, handler: ()=> Promise): void - (name: string, dependencies: string[], handler: ()=> Promise): void + (handler: () => Promise): void; + (name: string, handler: () => Promise): void; + (name: string, dependencies: string[], handler: () => Promise): void; } -export const onShutdown: OnShutdown +export const onShutdown: OnShutdown; -export function onShutdownError(callback: (error: Error) => Promise): void; +export function onShutdownError( + callback: (error: Error) => Promise +): void; diff --git a/package.json b/package.json index 5ccbc8e..d5feb0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-graceful-shutdown", - "version": "1.1.0", + "version": "1.1.1", "description": "Gracefully shutdown your modular NodeJS application", "main": "index.js", "engines": {