MCPcopy Index your code
hub / github.com/dfilatov/vow

github.com/dfilatov/vow @0.4.19

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.4.19 ↗ · + Follow
31 symbols 51 edges 43 files 0 documented · 0% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Vow NPM Version Build Status NPM Downloads =========

Vow is a Promises/A+ implementation. It also supports ES6 Promises 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

<script type="text/javascript" src="https://github.com/dfilatov/vow/raw/0.4.19/vow.min.js"></script>

It also supports RequireJS module format and YM module 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

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

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 — vow-based file I/O for Node.js
  • vow-node — extension for vow to work with nodejs-style callbacks
  • vow-queue — vow-based task queue with weights and priorities
  • vow-asker — wraps 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.

Core symbols most depended-on inside this repo

isFunction
called by 11
lib/vow.js
enqueueFn
called by 6
lib/vow.js
getArrayKeys
called by 3
lib/vow.js
callFns
called by 2
lib/vow.js
isObject
called by 2
lib/vow.js
processMarkdown
called by 1
utils/gen-doc.js
createScript
called by 1
lib/vow.js
defineCustomErrorType
called by 1
lib/vow.js

Shape

Function 31

Languages

TypeScript100%

Modules by API surface

lib/vow.js16 symbols
vow.min.js12 symbols
utils/gen-doc.js1 symbols
test/event.unhandledRejection.js1 symbols
benchmarks/comparison.js1 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add vow \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact