# crypto-io-utils

> Utility's used in crypto-modules.

Latest version **0.1.2** (published 2018-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install crypto-io-utils
pnpm add crypto-io-utils
yarn add crypto-io-utils
bun add crypto-io-utils
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-01-15 |
| First published | 2017-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Glenn Vandeuren |
| Maintainers | vandeurenglenn |

## Links

- npm: https://www.npmjs.com/package/crypto-io-utils
- Repository: https://github.com/crypto-io/crypto-utils
- Homepage: https://github.com/crypto-io/crypto-utils#readme
- Issues: https://github.com/crypto-io/crypto-utils/issues
- npm.io page: https://npm.io/package/crypto-io-utils

## Dependencies (1)

- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.9-1

## Recent versions

- 0.1.2 (latest) — 2018-01-15
- 0.1.0-rc.2 (rc) — 2018-01-01
- 0.1.2-alpha.1 — 2018-01-13
- 0.1.2-alpha — 2018-01-12
- 0.1.1 — 2018-01-11
- 0.1.0-rc.3 — 2018-01-08
- 0.1.0-rc.1 — 2018-01-01
- 0.1.0-beta.1 — 2017-12-30
- 0.1.0-beta — 2017-12-30
- 0.1.0-alpha.6 — 2017-12-30
- 0.1.0-alpha.5 — 2017-12-30
- 0.1.0-alpha.4 — 2017-12-30
- 0.1.0-alpha.3 — 2017-12-15
- 0.1.0-alpha.2 — 2017-12-09

## README

# crypto-io-utils

[![Build Status](https://travis-ci.org/crypto-io/crypto-utils.svg?branch=master)](https://travis-ci.org/crypto-io/crypto-utils)

> Utility's used in crypto-modules.

```js
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`<br>
Params: `data, secret`<br>

```js
encrypt(data, secret).then(cipher => ...);
```
#### decrypt
Type: `Promise`<br>
Params: `cipher, secret`<br>

```js
decrypt(cipher, secret).then(data => ...);
```

#### read
Type: `Promise`<br>
Params: `path, as`<br>
Options:  <br>
*as*  `string, json & map`

```js
write(path, data).then(() => ...);
```

#### write
Type: `Promise`<br>
Params: `path, data`<br>

```js
write(path, data).then(() => ...);
```

#### remove
Type: `string`<br>
Default: `''`<br>

```js
remove('rainbows').then(() => ...);
```

#### mkdir
Type: `string`<br>
Default: `''`<br>

```js
mkdir('rainbows').then(() => ...);
```

#### direxists
Type: `string`<br>
Default: `''`<br>

```js
direxists('rainbows').then(exists => ...);
```

#### exists
Type: `string`<br>
Default: `''`<br>

```js
exists('rainbows.txt').then(exists => ...);
```

---
_Source: https://npm.io/package/crypto-io-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
