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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rbxts/jecs-spring

v1.0.1

Published

Utility for running springs in Jecs.

Readme

Jecs Spring

Utility for running springs in Jecs.

Setup

  • Call jecs_spring.world(world) before using it to set it up with your world.

  • Add jecs_spring.system(delta) to your systems. Set the order right before your component values apply. This system needs the delta time to step the springs.

local c = require(components)
local jecs_spring = require(jecs_spring)

jecs_spring.world(world)

return {
    system = function(delta: number)
        jecs_spring.system(delta)
    end
}

Usage

  • Use jecs_spring.goal as a pair to set your goal value.

  • The target should be the component you want to interpolate

  • The value of the pair should be the goal value. This value should be any of ripple Animatable types (number | vector | Vector3 | Vector2 | CFrame | Color3 | UDim | UDim2 | Rect).

local spring = require(jecs_spring)

local cube = world:entity()

world:set(cube, c.size, Vector3.new(1, 1, 1))
world:set(cube, pair(spring.goal, c.size), Vector3.new(2, 2, 2))

-- cube will go from 1 -> 2

Configuring the spring.

  • Use jecs_spring.options as a pair to set the options for the spring. Similar to jecs.goal, the target is the component's spring you want to configure.

  • Its recommended that you set the options before the goal so the spring starts with the correct configuration.

local spring = require(jecs_spring)

local cube = world:entity()

world:set(cube, c.size, Vector3.new(1, 1, 1))
world:set(cube, pair(spring.options, c.size), { friction = 30, tension = 800 })
world:set(cube, pair(spring.goal, c.size), Vector3.new(2, 2, 2))

-- cube will go from 1 -> 2 with a friction of 30 and tension of 800

Manipulating the spring object.

  • The spring object is stored in a jecs_spring.motion pair. The target is the component's spring.

  • The spring object is available right after you set the goal.

  • The spring object is destroyed when the goal is removed.

local spring = require(jecs_spring)

local cube = world:entity()

world:set(cube, c.size, Vector3.new(1, 1, 1))
world:set(cube, pair(spring.goal, c.size), Vector3.new(2, 2, 2))

local spring_motion = world:get(cube, pair(spring.motion, c.size))
spring_motion:impulse(Vector3.new(5, 5, 5))

Checking spring completion.

  • Springs that have completed will be marked with a jecs_spring.completed pair. The target is the component's spring.

  • The completed pair is removed if you change the goal.

  • The completed pair is removed if you remove the goal.

local spring = require(jecs_spring)

local cube = world:entity()
world:set(cube, c.size, Vector3.new(3, 3, 3))

task.wait(2)
-- animate out
world:set(cube, pair(spring.goal, c.size), Vector3.zero)

function system()
    for entity in world:query(pair(spring.completed, c.size)) do
        world:delete(entity)
    end
end