crypto-io-utils

0.1.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i crypto-io-utils

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • vandeurenglenn