Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

sloth-cli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sloth-cli

a dead simple Chron cli tool for Node

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Sloth

Sloth is a dead simple Chron cli tool for Node.

Install Sloth as a dependency:

npm install --save sloth-cli

Then pass Sloth the length of time it should wait until running your command, and what command to run:

sloth 5 "npm run my-script"

or set it up in your package.json like:

"start": "sloth .1 \"npm run my-script\""

That's it! By default you pass a number of minutes. You can pass a decimal number.

By default the slothed script will only run after the specified length of time. If you want it to also run once immediately, pass true like this:

"start": "sloth .1 \"npm run my-script\" true"

You can also have Sloth log the last iteration time by passing true as a fifth argument:

"start": "sloth .1 \"npm run my-script\" false true"

Terminate the loop by pressing ctrl + c. You may have to press that twice. It's not graceful.

Contributing

PRs are welcome, and you can always file an issue for features requests, as well as, uh, an issue.

TODO

  • For timing, support ms, s, m, h, or a chron string
  • Add command line options for these things:
    • Run X number of times.
    • Run until X length of time (supported as above: ms, s, m, h, or a chron string)
  • Gracefully end process two ways:
    • ctrl + shift + t to immediately send a graceful termination signal.
    • spacebar to invoke a prompt which can be confirmed by pressing y to send a graceful termination signal.

Keywords

chron

FAQs

Package last updated on 12 Feb 2018

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