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

@swenkerorg/atque-dolorem-accusantium

v1.1.21

Published

## Switches the input received on out1 or out2 depending on the time and the settings of the node.

Downloads

13,509

Readme

node-red-contrib-timegate

Switches the input received on out1 or out2 depending on the time and the settings of the node.

The node compares the current time to up to five different time configurations and thansfers its input unmodified on the first output if the current time matches any of the configuration or, otherwise, on the second output.

node-red-contrib-timegate

Inputs

msg (any type)

Any input message is passed unmodified to one of the outputs.

Outputs

out-1

Passes the input msg when any of the time configuration matches the current time.

out-2

passes the input msg when none of the timer matches the current time.

Configurations

node-red-contrib-timegate-setup

Reference datetime

The node can use the current date and time to check against one of it's configurations or can be initialized with a property inside the message passed to it's input, a value inside the flow object or a global value.

You can use the Reference DateTime Field to decide where to get an external reference datetime from.

The value can be specified in one of these formats:

YYYY/MM/DD HH:mm 
YYYY/MM/DD

If the msg/flow/global variable is not set, the node will use the current date time.

Time matching configurations

You can configure up to five different time matching configurations to be checked against the reference datetime.

For each configuration, you can specify these parameters:

Time

One or more time ranges separated by commas.

A time can be be a 24 hour time or a SunCalc event, as expressed by the SunCalc Library.

Keywords are case insensitive.

| Property | Description | |----------|----------| | sunrise | sunrise (top edge of the sun appears on the horizon) | | sunriseEnd | sunrise ends (bottom edge of the sun touches the horizon) | | goldenHourEnd | morning golden hour (soft light, best time for photography) ends | | solarNoon | solar noon (sun is in the highest position) | | goldenHour | evening golden hour starts | | sunsetStart | sunset starts (bottom edge of the sun touches the horizon) | | sunset | sunset (sun disappears below the horizon, evening civil twilight starts) | | dusk | dusk (evening nautical twilight starts) | | nauticalDusk | nautical dusk (evening astronomical twilight starts) | | night | night starts (dark enough for astronomical observations) | | nadir | nadir (darkest moment of the night, sun is in the lowest position) | | nightEnd | night ends (morning astronomical twilight starts) | | nauticalDawn | nautical dawn (morning nautical twilight starts) | | dawn | dawn (morning nautical twilight ends, morning civil twilight starts) |

Example:

10:15-11:30 or 10:00-12:00,15:30-16:30
12:00-goldenHour or sunsetStart-sunset

Day

One or more day values separated by commas.

Possible values:

  • 1,8,15,21 to match the day number
  • SUN,MON,TUE,WED,THU,FRI,SAT to match the day name
  • ODD,EVEN to match odd or even days based on the number of the day in the month (1-31)
  • ODD-YEAR,EVEN-YEAR to match odd or even days based on the number of the day in the year (1-365)

Example:

1,SUN,ODD is true for: the first day of the month, every sundays and every odd day number in the month

SAT,SUN,EVEN-YEAR is true on saturdays and sundays and on every even day based the number of the day in the year

Week

One or more week values separated by commas.

Possible values:

  • 1,2,3,4,5,6 to match the week number in the month
  • ODD,EVEN to match odd or even weeks based on the number of the week in the month (1-6)
  • ODD-YEAR,EVEN-YEAR to match odd or even weeks based on the number of the day in the year (1-52)

Example:

1,EVEN-YEAR is true for: the first week of the month and every even week number in the year

Month

One or more month values separated by commas.

Possible values:

  • 1,2,3,4,5,6 to match the month

Example:

1,2,3 is true for: January, February and March

Multiple configurations

For every timer configuration the time settings is mandatory. If you add any day, week or month settings, these are evaluated in AND between each other.

Multiple timer configurations are evaluated in OR between each other.

Example:

Time: 10:00-11:00
Day: ODD
Week: EVEN-YEAR
Month: 1,2,3,4,5,6

This configuration will pass the input to Out-1 only from 10:00 to 11:00 of every odd day (based on the number of the day in the month) of every even week (based on the number of the week in the year) and from January to June. Otherwise, it will pass the input to Out-2.

Example

See the example for a basic setup of the node

References

GitHub - the nodes github repository

Donations

If you use and appreciate this software, please consider the idea of supporting my efforts in mantaining it.

Thanks.

Donate

Changelog

  • 1.0.0 First release
  • 1.0.1 Minor fixes
  • 1.0.2 Added better help text
  • 1.0.3 Fixed a regression bug
  • 1.0.4 Moved examples to the correct folder
  • 1.0.5 Fixes issue #6 Name not shown in node
  • 1.0.6 Added the possibility to read reference datetime from msg, flow or global
  • 1.0.7 Added suncalc suport