Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@exah/promise-animejs
Advanced tools
Simple wrapper around Anime.js, that resolves Promise when animation is complete
Simple wrapper around Anime.js, that resolves Promise when animation is complete.
Note: this package include animejs as peer dependency, so you must install it manually
$ npm install -S animejs @exah/promise-animejs
It can help chain animation, i.e. animate multiple dom nodes in order:
import promiseAnime from '@exah/promise-animejs'
const $nodes = document.querySelectorAll('.class-to-animate')
const animations = Array.from($nodes).reduce(
(promise, $el) => promise.then(() =>
promiseAnime({
targets: $el,
opacity: [0, 1],
easing: 'easeOutCirc'
})
),
Promise.resolve()
)
/* All animations is finished */
animations
.then(() => console.log('complete'))
promiseAnime(
{ /* anime options */ },
function (animation) { /* control animation */ }
)
.then(animation => /* animation complete */)
Simply pass Anime.js options to promiseAnime
function.
// before
anime({
targets: 'div',
opacity: [0, 1],
easing: 'easeOutCirc',
complete(animation) {
console.log('complete')
}
})
// after
promiseAnime({
targets: 'div',
opacity: [0, 1],
easing: 'easeOutCirc'
})
.then(animation => console.log('complete'))
Since wrapper returns Promise, to access animation instance simply pass handler as second argument.
promiseAnime({ /* options */ }, animation => {
animation.pause() // pause animation
})
.then(animation => console.log('complete'))
MIT License. © 2017 John Grishin.
FAQs
Simple wrapper around Anime.js, that resolves Promise when animation is complete
We found that @exah/promise-animejs 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.