Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Declarative user event tracking system. :squirrel:
creepmove
and shakemove
Creepx attaches event listeners to the supplied DOM element, then fires your callback with event payload when various events occur.
Put a JSON string into the data-creepx
attribute onto DOM elements you want to track and the data will be attached to your events.
Note: events that had
stopPropagation
called on them will not be registered.
HTML:
<button data-creepx='{"id":"pressbutton"}'>
Press
</button>
JS:
import creep from 'creepx';
creep(document, payload => {
// do stuff with payload
});
When a user clicks on the button, your callback will receive the following payload:
const payload = {
event: 'click',
data: {
id: 'pressbutton',
},
};
You can then send the data to your log server!
You can import the following functions:
import {
creepClicks, // click events
creepMousemove, // mousemove events
creepKeydown, // keydown events
creepClipboard, // clipboard events
creepWheel, // wheel events
creepSelect, // select events
} from "creepx";
If you just want to track everything, import default:
import creep from "creepx"; // yolo
Located in creepClicks
.
click
doubleclick
multiclick
Located in creepMousemove
.
creepmove
shakemove
Located in creepKeydown
.
keydown
Located in creepClipboard
.
cut
copy
paste
Located in creepWheel
.
scroll
Located in creepSelect
.
select
rxjs
>= 5The package exports a set of functions as well as a default function with two parameters:
target
- the DOM element to which should events be attachedcallback
- the callback to fire when an event happensimport creep, { creepClicks } from 'creepx';
// track everything happening on document if it has 'data-creepx' on it
creep(document, payload => {
if (payload.data) {
fetch('http://localhost:8081/logstash', {
method: 'POST',
body: JSON.stringify(payload),
});
}
});
// track clicks on this specific button extra
const btn = document.getElementById("trackme")
creepClicks(btn, payload => {
fetch('http://localhost:8081/trackme', {
method: 'POST',
body: JSON.stringify(payload),
});
})
MIT
FAQs
Declarative user event tracking system. :squirrel:
We found that creepx 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
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.