🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

throttleit

Package Overview
Dependencies
Maintainers
25
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

throttleit - npm Package Compare versions

Comparing version

to
1.0.1

5

package.json
{
"name": "throttleit",
"description": "Throttle a function",
"version": "1.0.0",
"version": "1.0.1",
"keywords": [],
"funding": "https://github.com/sponsors/sindresorhus",
"repository": {
"type": "git",
"url": "git://github.com/component/throttle.git"
"url": "git://github.com/sindresorhus/throttleit.git"
},

@@ -10,0 +11,0 @@ "devDependencies": {

26

Readme.md

@@ -7,15 +7,25 @@

## Installation
```sh
$ component install component/throttle
```
$ component install component/throttle
```sh
$ npm install throttleit
```
## Example
var throttle = require('throttle');
window.onresize = throttle(resize, 200);
```js
// with component:
var throttle = require('throttle');
// with npm:
// var throttle = require('throttleit');
function resize(e) {
console.log('height', window.innerHeight);
console.log('width', window.innerWidth);
}
window.onresize = throttle(resize, 200);
function resize(e) {
console.log('height', window.innerHeight);
console.log('width', window.innerWidth);
}
```
## API

@@ -22,0 +32,0 @@