
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Clocky executes callbacks at predefined intervals called ticks, providing an easy-to-use wrapper around the built in setInterval method.
Simplest option, with npm:
npm install clocky
or, if you prefer old fashioned downloads, click here for the minified UMD file
var Clocky = require('clocky')
var clocky = new Clocky({
onTick: function (ticks, startedAt, elapsed) {
console.log('ticked ' + ticks + ' times')
console.log('started at ' + startedAt)
console.log('total elapsed time (including pauses):' + elapsed + ' seconds')
}
tickEvery: 2 // seconds
})
clocky.start()
import {Clocky} from 'clocky'
let clocky = new Clocky({
onTick: (ticks, startedAt, elapsed) => {
console.log(`ticked ${ticks} times`)
console.log(`started at ${startedAt}`)
console.log(`total elapsed time (including pauses): ${elapsed} seconds`)
},
tickEvery: 2 // seconds
})
clocky.start()
Clocky provides a fluent interface which allows for chaining methods. The methods outlined below can also be invoked in the constructor as an object. The following examples are equivalent:
let clocky = new Clocky({
onTick: (ticks, startedAt, elapsed) => {
console.log(`ticked ${ticks} times`)
console.log(`started at ${startedAt}`)
console.log(`total elapsed time (including pauses): ${elapsed} seconds`)
},
tickFor: 5,
tickEvery: 2 // seconds
})
clocky.start()
and
let clocky = new Clocky()
clocky
.tickFor(5)
.tickEvery(2)
.onTick((ticks, startedAt, elapsed) => {
console.log(`ticked ${ticks} times`)
console.log(`started at ${startedAt}`)
console.log(`total elapsed time (including pauses): ${elapsed} seconds`)
})
.start()
Clocky has 3 states or statuses:
In order to provide consistency, methods that alter the behavior (tickEvery(), runFor()) can only be called if the status is "stopped"
Specify the amount of time Clocky needs to run for. After this amount has elapsed, Clocky will automatically stop and no further ticks will be fired. This method can only be called when the status is stopped
clocky.runFor(5) // seconds
Specify the amount of time in seconds between 2 consecutive ticks. Must be called when clocky is "stopped"
clocky.tickEvery(5) // seconds
Specify a truthy value is Clocky needs to tick when it's resumed.
Specify a truthy value is Clocky needs to tick when it's started.
Shorthand method for adding event. Specify the event as a string.
clocky.on('tick', () => {
console.log('ticked')
})
Provide a callback to be executed when the timer is started.
clocky.onStart((ticks, startedAt, elapsed) => {
console.log(`ticked ${ticks} times`)
console.log(`started at ${startedAt}`)
console.log(`total elapsed time (including pauses): ${elapsed} seconds`)
})
Provide a callback to be executed when the timer is paused. This event is triggered before the pause.
clocky.onPause((ticks, startedAt, elapsed) => {
console.log(`ticked ${ticks} times`)
console.log(`started at ${startedAt}`)
console.log(`total elapsed time (including pauses): ${elapsed} seconds`)
})
Provide a callback to be executed when the timer is resumed. This event is triggered after the pause.
clocky.onResume((ticks, startedAt, elapsed) => {
console.log(`ticked ${ticks} times`)
console.log(`started at ${startedAt}`)
console.log(`total elapsed time (including pauses): ${elapsed} seconds`)
})
Provide a callback to be executed when the timer is stopped.
clocky.onStop((ticks, startedAt, elapsed) => {
console.log(`ticked ${ticks} times`)
console.log(`started at ${startedAt}`)
console.log(`total elapsed time (including pauses): ${elapsed} seconds`)
})
Provide a callback
clocky.onTick((ticks, startedAt, elapsed) => {
console.log(`ticked ${ticks} times`)
console.log(`started at ${startedAt}`)
console.log(`total elapsed time (including pauses): ${elapsed} seconds`)
})
Start the timer. If the timer is not stopped, it will throw an exception.
Pause the timer. Pausing will also stop the timer for the "runFor()" method, so that Clocky instance with a runFor() interval of 10 seconds paused in the middle for 5 it will actually run for 15 seconds.
Resume a previously stopped timer. Will throw an exception if the timer is not paused
Stop timer and reset it to its initial state. Can be trigger regardless of the status.
Return the current status, can be one of "stopped", "running" or "paused"
Return boolean values based on the current status
FAQs
Call functions at various intervals
The npm package clocky receives a total of 0 weekly downloads. As such, clocky popularity was classified as not popular.
We found that clocky 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.