2.2.4 • Published 3 years ago

express-git-self-update v2.2.4

Weekly downloads
-
License
idc
Repository
-
Last release
3 years ago

express-git-self-update

Express route to upgrade self from git remote when endpoint is called.

Usage

const Express = require('express');
const SelfUpdate = require('express-git-self-update');

const app = Express();

app.use(Express.json());

const options = {
  compareBody: body => body.key === 'SuperSecretExampleKey',
  onUpdatedCommand: 'systemctl restart example-program.service'
};

app.post('/webhook/selfupdate', SelfUpdate(options));

Options

Pass options when initializing the middleware to customize it's behavior. Available options:

  • compareNpmVersion boolean (default: true) - Only update when remote package.json version is higher than the local.
  • runNpmInstall boolean (default: true) - Automatically run npm install after update.
  • compareBody object => boolean - Function to compare incoming body. Won't update if function returns false.
  • compareQuery object => boolean - Function to compare incoming query parameters. Won't update if function returns false.
  • onUpdate () => void - Function to call after program has been updated.
  • onUpdateCommand string - Shell command to execute after program has been updated. (Runs after onUpdate.)
  • groupingTime number (default: 0) - Minimum amount of time in millis to wait after starting a self updating check before allowing a new check. Requests that are sent within this time frame will be grouped together, that is, their response will be the same and returned when the running check finishes.
2.2.4

3 years ago

2.2.3

3 years ago

2.2.1

3 years ago

2.2.2

3 years ago

2.2.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

2.0.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago