backup-url

1.0.1 • Public • Published

When the content corresponding to a certain url changes, back it up.

  • Allow urls with basic authentication

use

const { BackupUrl } = require(`backup-url`);
new BackupUrl({
  dir: `./backup`,
  interval: 5 * 1000,
  url: [`http://127.0.0.1:8999/doc/openApi.json`],
  format: `json`,
});

parameter

new BackupUrl({
  url = ``, // url address, support string or string[]
  interval =  10 * 1000, // Each backup interval in milliseconds, 0 means no backup
  dir = `${__dirname}/backup`, // what directory to back up to
  format = undefined, // The function used for formatting before backup, supports `json` or function
})

License

MIT

Copyright (c) 2017-present, xw

Readme

Keywords

none

Package Sidebar

Install

npm i backup-url

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

9.47 kB

Total Files

9

Last publish

Collaborators

  • wll8