1.0.21 • Published 1 month ago

w-backup v1.0.21

Weekly downloads
96
License
MIT
Repository
github
Last release
1 month ago

w-backup

A backup tool for files and folders.

language npm version license gzip file size npm download npm download jsdelivr download

Documentation

To view documentation or get support, visit docs.

Installation

Using npm(ES6 module):

Note: w-backup is mainly dependent on w-zip and json5.

Note: w-backup can be compiled into an executable file by using pkg.

npm i w-backup

Example:

Link: [dev source code]

import fs from 'fs'
import w from 'wsemi'
import wb from 'w-backup'

let fpSetting = './setting-zip.json' let fpBackup = './testData/output' let fpKeep = './testData/outputList'

//fsDeleteFolder w.fsDeleteFolder(fpBackup)

//fsCreateFolder w.fsCreateFolder(fpKeep) fs.writeFileSync(fpKeep + '/20200101.zip', 'a1', 'utf8') fs.writeFileSync(fpKeep + '/20200115.zip', 'a2', 'utf8') fs.writeFileSync(fpKeep + '/20200201.zip', 'b1', 'utf8') fs.writeFileSync(fpKeep + '/20200215.zip', 'b2', 'utf8') fs.writeFileSync(fpKeep + '/20200301.zip', 'c1', 'utf8') fs.writeFileSync(fpKeep + '/20200315.zip', 'c2', 'utf8') fs.writeFileSync(fpKeep + '/20200401.zip', 'd1', 'utf8') fs.writeFileSync(fpKeep + '/20200415.zip', 'd2', 'utf8')

//use setting.json wb(fpSetting) .then((msg) => { console.log(msg) }) .catch((err) => { console.log(err) })

// then => output success to: path/to/testLog/success-20200806193318.log // // 'done: ./testData/output/20200805/test-y1.zip', // 'done: ./testData/output/2020-08-05/test-y2.zip', // 'done: ./testData/output/20-08-05/test-y3.zip', // 'done: ./testData/output/2020-08-06/test-t1.zip', // 'done: ./testData/output/20200806/test1.zip', // 'done: ./testData/output/20200806/test2.zip', // 'done: ./testData/output/20200806/test3.zip', // 'done: ./testData/output/20200806/unzip/test1', // 'done: ./testData/output/20200806/unzip/test2', // 'done: ./testData/output/20200806/unzip/test3', // 'done: ./testData/outputList', // 'finish at 2020-08-06T19:33:18+08:00' //

## Build an executable file:
You can use `./src/compile.js` and `pkg` to compile `w-backup` into an executable file.

> **Compile for windows:**

./node_modules/.bin/pkg -t win src/compile.js --output bin/wb.exe

> **Run for windows:**

path/to/wb.exe path/to/setting.json

1.0.21

1 month ago

1.0.19

2 months ago

1.0.20

2 months ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago