# squab

> a basic Promise library

Latest version **0.0.2** (published 2016-03-19) · MIT license · 0 weekly downloads

## Install

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

## 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.0.2 |
| Published | 2016-03-19 |
| First published | 2016-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Ning Xia |
| Maintainers | ningxia |
| Keywords | Promise, resolve, reject, light, lightweight |

## Links

- npm: https://www.npmjs.com/package/squab
- Repository: https://github.com/ning-github/squab
- Homepage: https://github.com/ning-github/squab#readme
- Issues: https://github.com/ning-github/squab/issues
- npm.io page: https://npm.io/package/squab

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-03-19
- 0.0.1 — 2016-03-13

## README

# squab [![Build Status](https://travis-ci.org/ning-github/squab.svg?branch=master)](https://travis-ci.org/ning-github/squab) [![npm version](https://badge.fury.io/js/squab.svg)](https://badge.fury.io/js/squab)
a basic Promise library

####Installation
    $ npm install squab

####Usage
    var Promise = require("squab");

    function someAsyncFunction() {
        return new Promise(function(resolve, reject){
            setTimeout(function(){
                var value = Math.ceil(Math.random() * 10);
                if (value % 2) {
                        resolve(value);
                    } else {
                        reject(value);
                    }
            }, 0);
        });
    }

    someAsyncFunction()
        .then(function(odd){
            console.log("odd number: " + odd);
            return odd;
        }, function(even) {
            console.log("even number: " + even);
            return even;
        });

#####Chaining
    someAsyncFunction()
        .then(function(odd){
            return odd * 100;
        }, function(even) {
            console.log("rejected!");
            return "I was even: " + even;
            })
        .then(function(onlyOdd){
            console.log ("original value times 100: " + onlyOdd);
        });

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