Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@daeinc/timeline
Advanced tools
A Timeline object can hold multiple properties with keyframes. ex. position, rotation, color, etc., and makes it easy to group things together. In my own projects, I create multiple Timeline objects, one for each graphical object.
It builds on top of keyframes
, but does not expose Keyframes library to user - user only needs to provide a minimum amount of necessary data. ex. { time, value, ... }
In development, and breaking changes are expected in the future.
npm i @daeinc/timeline
Then,
import Timeline from "@daeinc/timeline";
Pass a timeline name and a single property object ({name, keyframes}
) or an array of property objects ([{name, keyframes}, {name, keyframes}]
):
const tl = new Timeline("my-timeline", {
name: "position",
keyframes: [
{ time: 0, value: 5 },
{ time: 1, value: 10 },
],
});
const v1 = tl.value("position", 0.5); // returns 7.5
Pass a custom interpolator function:
JS:
const easeInQuad = (a, b, t) => {
return lerp(a.value, b.value, t * t);
};
const v2 = tl.value("position", 0.5, easeInQuad);
console.log(v2); // 6.25
TS:
import type { Keyframe } from "@daeinc/timeline";
const easeInQuad = (a: Keyframe, b: Keyframe, t: number) => {
return lerp(a.value, b.value, t * t);
};
const v2 = tl.value("position", 0.5, easeInQuad);
console.log(v2); // 6.25
constructor(propOrProps?: InputProp | InputProp[]);
propExists(propName: string): boolean;
addKeyframe(propName: string, newKey: Keyframe): void;
addKeyframes(propName: string, ...newKeys: Keyframe[]): void;
getKeyframe(propName: string, timeStamp: number): Keyframe;
getKeyframes(propName: string): Keyframe[];
getName(): string;
getPropertyNames(): string[];
value(propName: string, timeStamp: number, interpolator?: Interpolator): any;
addProperty(propName: string, ...newKeys: Keyframe[]): void;
removeKeyframes(propName: string, index: number, howmany: number): void;
nearest(propName: string, timeStamp: number, radius?: number): Keyframe;
nearestIndex(propName: string, timeStamp: number, radius?: number): number;
next(propName: string, timeStamp: number): Keyframe;
previous(propName: string, timeStamp: number): Keyframe;
static fromJSON(file: string): Promise<void | Timeline>;
static from(data: {
name: string;
properties: InputProp[];
}): Timeline;
toJSON(): string;
keyframes
package.d.ts
for keyframes
JS package, or, create a TS version of the keyframes package as a class
.MIT
FAQs
A wrapper class on top of keyframes package
The npm package @daeinc/timeline receives a total of 18 weekly downloads. As such, @daeinc/timeline popularity was classified as not popular.
We found that @daeinc/timeline 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.