# scroll-past

> Return a promise when any element is scroll past

Latest version **2.0.0** (published 2022-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install scroll-past
pnpm add scroll-past
yarn add scroll-past
bun add scroll-past
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-06-26 |
| First published | 2016-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Kevin Mårtensson |
| Maintainers | kevva |
| Keywords | past, promise, scroll, viewport |

## Links

- npm: https://www.npmjs.com/package/scroll-past
- Repository: https://github.com/kevva/scroll-past
- Homepage: https://github.com/kevva/scroll-past#readme
- Issues: https://github.com/kevva/scroll-past/issues
- npm.io page: https://npm.io/package/scroll-past

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-08-28
- 1.0.2 — 2016-04-15
- 1.0.1 — 2016-04-14
- 1.0.0 — 2016-04-14

## README

# scroll-past

> Return a Promise when any element is scroll past


## Install

```
$ npm install scroll-past
```


## Usage

```js
const scrollPast = require('scroll-past');

scrollPast(document.querySelector('.container')).then(pos => {
	console.log(`I'm at ${pos}`);
});
```


## API

### scrollPast(element, [options])

Returns a `Promise` that resolves the `scrollY` position of the window.

#### element

Type: `Element`

The element to check for.

#### options

##### threshold

Type: `number`<br>
Default: `0`

Add a threshold to scroll past before the `Promise` is returned.


## License

MIT © [Kevin Mårtensson](https://github.com/kevva)

---
_Source: https://npm.io/package/scroll-past · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
