aru

If there is, without error checking.
Install or Download
yarn add aru
npm i -S aru
Or access to releases page.
Then, download the latest version.
Usage
import aru from 'aru';
const aru = require('aru');
or
<script src="https://unpkg.com/aru/dist/aru.js"></script>
<script src="path/tp/aru.js"></script>
API
aru(key, value): promise or undefined
Set a value
. (Do noting if catch error)
aru(key): value-type or null
Get the value
.
aru.has(key): boolean
Wheter key exists.
aru.left(key, cb): return-value-of-cb or null
If there is no that key
, execute cb
aru.right(key, cb): type-of-return-value-of-cb or null
If there is that key
, execute cb
Example
aru('str', 'str');
aru('str');
aru.has('str');
aru.left('str', () => 'str');
aru.right('str', () => 'str');
aru('func', () => 'func');
aru('func');
aru.has('func');
aru.left('func', () => 'func');
aru.right('func', () => 'func');
await aru('resolve', Promise.resolve('resolve'));
aru('resolve');
aru.has('resolve');
aru.left('resolve', () => 'resolve')
aru.right('resolve', () => 'resolve')
await aru('promise:reject', Promise.reject('reject'));
aru('reject');
aru.has('reject')
aru.left('reject', () => 'reject')
aru.right('reject', () => 'reject')
LICENSE
The MIT License (MIT)
Copyright (c) 2017 nju33 nju33.ki@gmail.com