# document-ready-promise

> A simple ES2015 Promise-based "document ready" event handler.

Latest version **3.0.1** (published 2016-01-30) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install document-ready-promise
pnpm add document-ready-promise
yarn add document-ready-promise
bun add document-ready-promise
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2016-01-30 |
| First published | 2015-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Micheal Parks |
| Maintainers | micheal.parks |
| Keywords | Promise, document, ready, DOMContentLoaded, ES6, ES2015 |

## Links

- npm: https://www.npmjs.com/package/document-ready-promise
- Repository: https://github.com/michealparks/document-ready-promise
- Homepage: https://github.com/michealparks/document-ready-promise#readme
- Issues: https://github.com/michealparks/document-ready-promise/issues
- npm.io page: https://npm.io/package/document-ready-promise

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2016-01-30
- 3.0.0 — 2015-11-20
- 2.1.0 — 2015-11-03
- 2.0.0 — 2015-10-22
- 1.1.3 — 2015-10-22
- 1.0.3 — 2015-10-22
- 1.0.2 — 2015-10-22
- 1.0.1 — 2015-10-22
- 1.0.0 — 2015-10-22

## README

# document-ready-promise
A simple promise-compatible "document ready" event handler with a few extra treats.

Works in any browser that supports [Promises](http://caniuse.com/#feat=promises) or with a good [polyfill](https://www.npmjs.com/package/es6-promise).


With browserify/webpack:

```javascript
const ready = require('document-ready-promise')

ready().then(function() {
  // Party time.
})

```


If in a non-commonjs environment, just include the script. It will attach ```document.ready``` for you.

```html
<script src="document-ready-promise.js"></script>
<script>
document.ready().then(function() {
  // voila!
})
</script>
```


The document.ready promise will preserve any values that you may be passing through the promise chain.

```javascript
// Using ES2015 and window.fetch
fetch(new Request('kitten.jpg'))
  .then(response => response.blob())
  .then(document.ready)
  .then(blob => document.querySelector('img').src = URL.createObjectURL(blob))
```

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