Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
cordova-plugin-timer
Advanced tools
Cordova native timer plugin
cordova plugin add cordova-plugin-timer
// you may also install directly from this repo cordova plugin add https://github.com/kitolog/cordova-plugin-timer
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();
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
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) |
FAQs
Cordova Native Timer Plugin
The npm package cordova-plugin-timer receives a total of 15 weekly downloads. As such, cordova-plugin-timer popularity was classified as not popular.
We found that cordova-plugin-timer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.