make cache file. inspired by 'mktemp'
![]()
make cache file. inspired by 'mktemp'
#### Installation
``bash`
$ [sudo] npm i -g mkcache
#### How it works
``
$XDG_CACHE_HOME/mkcache/
#### Config
`bash`
export MKCACHE=path/to/cache # ~/.cache/mkcache by default
#### Scripts usage
command|usagemkcache
-|- |usage: mkcache args ...
#### Examples
example 1. speed up macOS tts with mkcache:
`bash`
path="$(mkcache "$@")"
! [ -e "$path" ] && /usr/bin/say "$@" -o "$path"
afplay "$path"
example 2. execute script once:
`bash``
path="$(mkcache script "$@")"
! [ -e "$path" ] && { script "$@" || exit; touch "$path"; }