npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ariya/berkala

v1.3.0

Published

Run scheduled tasks

Downloads

40

Readme

Berkala

GitHub license Tests

Berkala runs scheduled tasks specified in a YAML-based configuration.

To get started, first download the binary for your operating system from the Releases page. Unpack the ZIP file and run the executable.

Since a config file does not exist yet, you will be offered to create one. Simply accept it and berkala.yml will be created, which may look like the following:

tasks:

  # Without an explicit interval, the task runs immediately
  boot:
    steps:
    - notify: Berkala starts now

  stay-hydrated:
    interval: every 1 hour
    steps:
    - notify: Drink some water! # TODO: how much?
    - print: Reminder was sent

  lunch:
    interval: at 11:58am
    steps:
    - notify: It's lunch time very soon
      title: Important
    - say: Get ready for lunch

  sign-of-life:
    interval: every 2 hours
    steps:
    - run: ping -c 7 google.com
      timeout-minutes: 2

  weekend-exercise:
    cron: 0 9 * * 6  # every 9 morning on Saturday
    steps:
    - notify: Time for some exercises!
      title: Stay healthy

Just like any regular YAML, everything from the # character until the end of the line will be ignored. Use this to insert comments.

The schedule for each task can be specified as:

If neither is explicitly stated, then the task runs right away.

Each task consists of one or more steps.

Every step must be one of the following:

Example:

  sign-of-life:
    interval: every 30 minutes
    steps:
    - run: ping -c 7 google.com

Optionally, timeout-minutes can be used to limit the execution time and working-directory can be used to set the directory to start the execution from.

Another example:

  sys-resource:
    interval: every 2 hours
    steps:
    - run: |
        date >> resources.log
        top | head -n 4 >> resources.log
      timeout-minutes: 3
      working-directory: /var/log

Example:

  morning:
    interval: at 7:00am
    steps:
    - print: Good morning!

Optionally, title can be used to set the notification title.

Example:

  mahlzeit:
    interval: at 11:58am
    steps:
    - notify: It's lunch time very soon
      title: Yummy

The notification is supported on the following system:

Example:

  vaya-con-dios:
    interval: 0 17 * * 1-5  # every workday late afternoon
    steps:
    - say: Time to go home

The text-to-speech conversion is supported on the following system:

Found a problem or have a new idea? File an issue!

With Node.js v14 or later (that has npx):

npx @ariya/berkala

To run the development version, check out this repo and then:

npm install
npm start

npm version npm bundle size (minified)