
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@terrahq/counter
Advanced tools
`Counter` is a JavaScript class for animating a numeric counter that starts when scrolled into view. It uses GSAP and ScrollTrigger to animate a number from an initial to a final value with customizable options.
Counter is a JavaScript class for animating a numeric counter that starts when scrolled into view. It uses GSAP and ScrollTrigger to animate a number from an initial to a final value with customizable options.
import Counter from "@terrahq/counter";
const counter = new Counter({
element: document.querySelector(".counter-element"),
duration: 2, // Duration of the animation in seconds
separator: ".", // Thousands separator (optional)
start: "top center", // ScrollTrigger start position (optional)
debug: true, // Display ScrollTrigger markers (optional, now called debug)
easing: "power1.out", // Easing of the animation (optional)
autoPlay: true, // Start animation on scroll (optional)
playOnce: true, // Run animation only once (optional)
decimalPlaces: 0, // Where the '.' will be located when it is a decimal number (optional)
onComplete: () => console.log("Counter animation complete!"), // Callback on animation complete
});
// Additional methods
counter.play(); // Start the animation manually
counter.update(); // Update the ScrollTrigger position
counter.destroy(); // Clean up the instance and stop animations
<div class="counter counter-element">1</div>
const counter = new Counter({
element: document.querySelector(".counter-element"),
duration: 2, // Duration of the animation in seconds
separator: ".", // Thousands separator (optional)
start: "top center", // ScrollTrigger start position (optional)
debug: true, // Display ScrollTrigger markers (optional, now called debug)
easing: "power1.out", // Easing of the animation (optional)
autoPlay: true, // Start animation on scroll (optional)
playOnce: true, // Run animation only once (optional)
decimalPlaces: 0, // Where the '.' will be located when it is a decimal number (optional)
onComplete: () => console.log("Counter animation complete!"), // Callback on animation complete
});
FAQs
`Counter` is a JavaScript class for animating a numeric counter that starts when scrolled into view. It uses GSAP and ScrollTrigger to animate a number from an initial to a final value with customizable options.
The npm package @terrahq/counter receives a total of 6 weekly downloads. As such, @terrahq/counter popularity was classified as not popular.
We found that @terrahq/counter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.