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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cordova-plugin-timer

v1.0.1

Published

Cordova Native Timer Plugin

Readme

cordova-plugin-timer

Cordova native timer plugin

Installation

cordova plugin add cordova-plugin-timer

// you may also install directly from this repo cordova plugin add https://github.com/kitolog/cordova-plugin-timer

Sample usage

Here is simple example of how to connect to remote server, consume data from it and close the connection.

Create instance of Socket type:

var timer = new window.nativeTimer();

Set data consumer, error and close handlers:

timer.onTick = function(tick) {
  // invoked on tick
};
timer.onError = function(errorMessage) {
  // invoked after error occurs
};
timer.onStop during connection = function(hasError) {
  // invoked after stop
};

Start timer with delay 1ms and repeat 1000ms

timer.start(
  1,
  1000,
  function() {
    // invoked after successful start
  },
  function(errorMessage) {
    // invoked after unsuccessful start
  });

stop the timer

timer.stop();

API

Event handlers

onTick: (data: int) => void

Invoked after new tick is received by the timer.

onStop: (hasError: boolean) => void

Invoked after timer was stopped.

onError: (message: string) => void

Invoked when some error occurs during timer process.

on: (eventName: string, callback: function) => void

Syntax sugar for the event handlers (onTick, onStop, onError) eventName: error, tick, stop

Methods

start(delay, interval, onSuccess?, onError?): void

Establishes connection with the remote host.

| parameter | type | description | | ----------- |-----------------------------|--------------| | delay | number | timer delay | | | interval | number | timer tick interval | | onSuccess | () => void | Success callback - called after successfull timer start. (optional)| | onError | (message: string) => void | Error callback - called when some error occurs during timer start. (optional)|

stop(onSuccess?, onError?): void

Closes the connection. onClose event handler is called when connection is successfuly closed.

| parameter | type | description | | ----------- |-----------------------------|--------------| | onSuccess | () => void | Success callback, called after timer was stopped. (optional)| | onError | (message: string) => void | Error callback, called when some error occurs during this procedure. (optional)|

What's new

  • 1.0.0 - initial code
  • 1.0.1 - added common event handler