2019.6.8 • Published 5 years ago

mkcache v2019.6.8

Weekly downloads
-
License
Unlicense
Repository
-
Last release
5 years ago

npm.io

make cache file. inspired by 'mktemp'

Installation

$ [sudo] npm i -g mkcache

How it works

$XDG_CACHE_HOME/mkcache/<hash>

Config

export MKCACHE=path/to/cache # ~/.cache/mkcache by default

Scripts usage

commandusage
mkcacheusage: mkcache args ...

Examples

example 1. speed up macOS tts with mkcache:

path="$(mkcache "$@")"
! [ -e "$path" ] && /usr/bin/say "$@" -o "$path"
afplay "$path"

example 2. execute script once:

path="$(mkcache script "$@")"
! [ -e "$path" ] && { script "$@" || exit; touch "$path"; }