Socket
Book a DemoInstallSign in
Socket

cache-sh

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-sh

CLI tool to use cache for cli-commands to prevent long running commands from executing unnecessarily

latest
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

cache-sh

cache-sh is a command line tool for caching shell commands. It can be used to cache the results of any shell command, reducing the time it takes to run repetitive tasks.

Changelog

Installation

npm install -g cache-sh

Usage

Here are some examples of how you can use cache-sh with prisma generate and tsc.

Prisma Generate

cache-sh -i "{./prisma/schema.prisma,node_modules/**/.prisma/client/**/*.*}" \
pnpm prisma generate

In this example cache-sh will check if the prisma/schema.prisma file AND the generated .prisma/client has changed and exists, since the last time prisma generate was run.

If it hasn't, cache-sh will skip running the command and use the cached result instead.

TypeScript Compilation

cache-sh -i "{src/**/*,dist/**/*}" tsc

In this example, cache-sh will check if any .ts files in the src directory have changed since the last time tsc was run. If they haven't, cache-sh will skip running the command and assume you can use what's already there, instead.

Usage

cache-sh [options] -- <command...>
cache-sh [options] <command...>

Options

  • -V, --version output the version number
  • -i, --input <input> glob that's used as input to check whether the existing files need to be updated
  • -C, --config <path> set the config path (default: (pwd)/.cache-sh)
  • -d, --cwd <path> set the current working directory
  • -f, --force ignore the cache the command
  • -c, --clear clear the cache
  • -h, --help display help for command

Examples:

$ cache-sh -i "{src/**,dist/**}" -- tsc
$ cache-sh -i hi.log -- "sleep 2 && echo "hi" > hi.log"
$ cache-sh -i "{./prisma/schema.prisma,node_modules/**/.prisma/client/**/*.*}"\
-- pnpm prisma generate

FAQs

Package last updated on 21 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts