Licence
MIT
Version
0.1.2
Deps
1
Vulns
2
Weekly
0
crypto-io-utils
Utility's used in crypto-modules.
import { encrypt, decrypt, read, write, ... } from 'crypto-io-utils';
(async () => {
const result = await encrypt('hello', 'pubkey');
await write('hello.txt', result);
const cipher = await read('hello.txt');
const data = await decrypt(cipher, 'secret');
})();
API
backed[{options}]
options
encrypt
Type: Promise
Params: data, secret
encrypt(data, secret).then(cipher => ...);
decrypt
Type: Promise
Params: cipher, secret
decrypt(cipher, secret).then(data => ...);
read
Type: Promise
Params: path, as
Options:
as string, json & map
write(path, data).then(() => ...);
write
Type: Promise
Params: path, data
write(path, data).then(() => ...);
remove
Type: string
Default: ''
remove('rainbows').then(() => ...);
mkdir
Type: string
Default: ''
mkdir('rainbows').then(() => ...);
direxists
Type: string
Default: ''
direxists('rainbows').then(exists => ...);
exists
Type: string
Default: ''
exists('rainbows.txt').then(exists => ...);