Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

systime

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

systime

NodeJS Event Based System Time Keeper

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by650%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage Status

systime

NodeJS Event Based System Time Keeper

Systime syncs with system time and emits time events. It accounts for fluctuations in time accuracy by continuously re-syncing with local system time.

Use this package for any software that needs to accurately track time (assuming system time is accurate).

For more information on computer clocks and time see NTP.org.

Requirements

  • NodeJS v5.11.x or higher
  • NPM

See ./package.json

Installation

Source available on GitHub or install module via NPM:

$ npm install systime

Usage

After requiring systime create a new instance. Bind event listeners to systime then call the start method.

var Systime = require('systime')

var systime = new Systime()

// bind listeners to zero or more of the following events
// (each callback has a date object argument)

systime.on('second', date => console.log(date))

systime.on('minute', () => console.log('new minute'))

systime.on('hour', () => console.log('new hour'))

systime.on('day', () => console.log('new day'))

systime.on('week', () => console.log('new week'))

systime.on('month', () => console.log('new month'))

systime.on('year', () => console.log('new year'))

systime.start() // start systime

// runs until process has exited or systime.stop() method called

The above starts systime and console logs as event listeners are triggered.

See ./example/events.js for working example.

That's it!

License

MIT

Keywords

FAQs

Package last updated on 28 Nov 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc