1.0.4 • Published 8 years ago
pon-task-file-encrypt v1.0.4
pon-task-file-encrypt
Pon task to encrypt a file
Installation
$ npm install pon-task-file-encrypt --saveUsage
'use strict'
const pon = require('pon')
const { encrypt, decrypt } = require('pon-task-file-encrypt')
;(async () => {
let run = pon({
encrypt: encrypt('secret.json', 'secret.json.enc', 'password123'),
decrypt: decrypt('secret.json.enc', 'secret.json', 'password123')
})
run('encrypt')
}).catch((err) => console.error(err))Signatures
decrypt(src, dest, key, options) -> function
decrypt task
| Param | type | Description |
|---|---|---|
| src | string | Source file path |
| dest | string | Destination file path |
| key | string | Secret key string |
| options | Object | Optional settings |
encrypt(src, dest, key, options) -> function
encrypt task
| Param | type | Description |
|---|---|---|
| src | string | Source file path |
| dest | string | Destination file path |
| key | string | Secret key string |
| options | Object | Optional settings |
License
This software is released under the Apache-2.0 License.