# vow

> DOM Promise and Promises/A+ implementation for Node.js and browsers

Latest version **0.4.20** (published 2019-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install vow
pnpm add vow
yarn add vow
bun add vow
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.20 |
| Published | 2019-07-03 |
| First published | 2012-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 0 |
| Unpacked size | 61 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dmitry Filatov |
| Maintainers | dfilatov |
| Keywords | nodejs, browser, async, promise, dom, a+ |

## Links

- npm: https://www.npmjs.com/package/vow
- Repository: https://github.com/dfilatov/vow
- Homepage: http://dfilatov.github.io/vow/
- Issues: https://github.com/dfilatov/vow/issues
- npm.io page: https://npm.io/package/vow

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.4.20 (latest) — 2019-07-03
- 0.4.19 — 2019-02-16
- 0.4.18 — 2018-08-31
- 0.4.17 — 2017-10-04
- 0.4.16 — 2017-05-18
- 0.4.15 — 2017-02-20
- 0.4.14 — 2017-02-10
- 0.4.13 — 2016-11-01
- 0.4.12 — 2015-12-29
- 0.4.11 — 2015-09-29
- 0.4.10 — 2015-06-11
- 0.4.9 — 2015-03-21
- 0.4.8 — 2015-01-20
- 0.4.7 — 2014-10-30
- 0.4.6 — 2014-10-16
- … 40 more at https://npm.io/package/vow/versions

## README

<a href="http://promises-aplus.github.com/promises-spec"><img src="http://promises-aplus.github.com/promises-spec/assets/logo-small.png" align="right" /></a>
Vow
[![NPM Version](https://img.shields.io/npm/v/vow.svg?style=flat-square)](https://www.npmjs.com/package/vow)
[![Build Status](https://img.shields.io/travis/dfilatov/vow/master.svg?style=flat-square)](https://travis-ci.org/dfilatov/vow/branches)
[![NPM Downloads](https://img.shields.io/npm/dm/vow.svg?style=flat-square)](https://www.npmjs.org/package/vow)
=========

Vow is a [Promises/A+](http://promisesaplus.com/) implementation.
It also supports [ES6 Promises](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) specification.

Full API reference can be found at http://dfilatov.github.io/vow/.

Getting Started
---------------
### In Node.js ###
You can install using Node Package Manager (npm):

    npm install vow

### In Browsers ###
```html
<script type="text/javascript" src="vow.min.js"></script>
```
It also supports RequireJS module format and [YM module](https://github.com/ymaps/modules) format.

Vow has been tested in IE6+, Mozilla Firefox 3+, Chrome 5+, Safari 5+, Opera 10+.

Usage
-----
### Creating a promise ###
There are two possible ways to create a promise.
#### 1. Using a deferred ####
```js
function doSomethingAsync() {
    var deferred = vow.defer();
    
    // now you can resolve, reject, notify corresponging promise within `deferred`
    // e.g. `defer.resolve('ok');`
        
    return deferred.promise(); // and return corresponding promise to subscribe to reactions
}

doSomethingAsync().then(
    function() {}, // onFulfilled reaction
    function() {}, // onRejected reaction
    function() {}  // onNotified reaction
    );
```
The difference between `deferred` and `promise` is that `deferred` contains methods to resolve, reject and notify corresponding promise, but the `promise` by itself allows only to subscribe on these actions.

#### 2. ES6-compatible way ####
```js
function doSomethingAsync() {
    return new vow.Promise(function(resolve, reject, notify) {
        // now you can resolve, reject, notify the promise
    });
}

doSomethingAsync().then(
    function() {}, // onFulfilled reaction
    function() {}, // onRejected reaction
    function() {}  // onNotified reaction
    );
```

Extensions and related projects
-------------------------------
  * [vow-fs](https://github.com/dfilatov/vow-fs) — vow-based file I/O for Node.js
  * [vow-node](https://github.com/dfilatov/vow-node) — extension for vow to work with nodejs-style callbacks
  * [vow-queue](https://github.com/dfilatov/vow-queue) — vow-based task queue with weights and priorities
  * [vow-asker](https://github.com/nodules/vow-asker) — wraps [asker](https://github.com/nodules/asker) API in the vow promises implementation

**NOTE**. Documentation for old versions of the library can be found at https://github.com/dfilatov/vow/blob/0.3.x/README.md.

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