New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

async-raf

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-raf - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

lib/index.js

14

package.json
{
"name": "async-raf",
"version": "1.0.0",
"version": "1.0.1",
"description": "Get async animation frame context",
"main": "index.js",
"main": "lib/index.js",
"scripts": {
"test": "jest",
"release": "release-it",
"prepublishOnly": "npm t"
"prepublishOnly": "npm run build && npm t",
"build": "babel index.js --out-dir lib && uglifyjs --compress --mangle --output lib/index.js -- lib/index.js"
},

@@ -35,6 +36,11 @@ "files": [

"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@types/jest": "^25.1.2",
"jest": "^25.1.0",
"release-it": "^12.4.3"
"release-it": "^12.4.3",
"uglify-js": "^3.9.3"
}
}

@@ -1,7 +0,30 @@

# async-raf
Get async animation frame context
# async-raf [![npm version](https://badge.fury.io/js/async-raf.svg)](https://badge.fury.io/js/async-raf)
_Get async animation frame context_
### Install
`npm install --save async-raf`
### Why?
When you want to get a value from requestAnimationFrame, instead of:
```javascript
const area = await new Promise((resolve) => {
window.requestAnimationFrame(() => {
const { offsetWidth, offsetHeight } = someElement;
resolve(offsetWidth * offsetHeight);
});
});
```
You can use AsynRAF:
```javascript
const area = await asyncRaf(() => {
const { offsetWidth, offsetHeight } = someElement;
return offsetWidth * offsetHeight;
});
```
### Usage

@@ -8,0 +31,0 @@ ```javascript

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc