Socket
Socket
Sign inDemoInstall

throttleit

Package Overview
Dependencies
0
Maintainers
25
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 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 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc