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

@rkesters/later

v1.0.3-2

Published

Determine later (or previous) occurrences of recurring schedules

Downloads

7

Readme

Require env that supports ES6 classes.

Later is a library for describing recurring schedules and calculating their future occurrences. It supports a very flexible schedule definition including support for composite schedules and schedule exceptions. Create new schedules manually, via Cron expression, via text expressions, or using a fully chainable API.

Types of schedules supported by Later:

  • Run a report on the last day of every month at 12 AM except in December
  • Install patches on the 2nd Tuesday of every month at 4 AM
  • Gather CPU metrics every 10 mins Mon - Fri and every 30 mins Sat - Sun
  • Send out a scary e-mail at 13:13:13 every Friday the 13th

For complete documentation visit http://bunkat.github.io/later/.

Installation

Using npm:

$ npm install later

Using bower:

$ bower install later

Building

To build the minified javascript files for later, run npm install to install dependencies and then:

$ make all

Running tests

To run the tests for later, run npm install to install dependencies and then:

$ make test

Versioning

Releases will be numbered with the following format:

<major>.<minor>.<patch>

And constructed with the following guidelines:

  • Breaking backward compatibility bumps the major (and resets the minor and patch)
  • New additions without breaking backward compatibility bumps the minor (and resets the patch)
  • Bug fixes and misc changes bumps the patch

For more information on SemVer, please visit http://semver.org/.

Bug tracker

Have a bug or a feature request? Please open a new issue.

Change Log

Later v1.2.0

  • Implemented predefined scheduling definitions for cron
    • @yearly, @annually, @monthly, @weekly, @daily, and @hourly are now parsed correctly
    • Submitted by pekeler (thanks!)

Later v1.1.8, v1.1.9

  • Fixed npm and bower entry points

Later v1.1.7

  • Various bug fixes

Later v1.1.3

  • Merge consecutive ranges when using composite schedules (fixes issues #27)

Later v1.1.1 and v1.1.2

  • Fixed handling of ranged schedules which never go invalid. End date is undefined for these types of schedules.

Later v1.1.0

  • Implemented fullDate (fd) constraint to specify a specific occurrence (or exception)
    • later.parse.recur().on(new Date(2013,3,21,10,30,0)).fullDate()

Later v1.0.0

  • Refactored core engine so that it could be better tested
    • Added over 41,500 tests and fixed hundreds of edge cases that were unfortunately broken in v0.0.20
  • Core engine is now extensible via custom time periods and custom modifiers
    • Full examples included in the documentation
  • Added support for finding valid ranges as well as valid instances of schedules
    • Later can now be used to schedule activities and meetings as well as point in time occurrences
  • Improved support for finding past ranges and instances
    • Searching forward or backward now produces the same valid occurrences
  • No more need to specify a resolution!
    • Later now automatically handles this internally, you no longer need to specify your desired resolution. 'Every 5 minutes' now does exactly what you would expect it to :)
  • Changing between UTC and local time has changed.
    • Use later.date.UTC() and later.date.localTime() to switch between the two.
  • API for parsers has changed.
    • Recur is now at later.parse.recur()
    • Cron is now at later.parse.cron(expr)
    • Text is now at later.parse.text(expr)
  • API for calculating occurrences has changed.
    • Schedules are now compiled using later.schedule(schedule)
    • getNext is now later.schedule(schedule).next(count, start, end)
    • getPrev is now later.schedule(schedule).prev(count, start, end)
  • After meaning 'don't start until after this amount of time' has been deprecated.
    • This was a hack since people had a hard time with resolutions. With resolutions gone, this is no longer needed and is deprecated since it produced non-deterministic schedules.

Note: Schedule definitions did not change (unless you were using after constraints which have been deprecated). If you stored any schedule definitions from v0.0.20, they should continue to work unchanged in v1.0.0.