0.1.2 • Published 6 years ago

crypto-io-utils v0.1.2

Weekly downloads
9
License
MIT
Repository
github
Last release
6 years ago

crypto-io-utils

Build Status

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 => ...);