# promixy

> A module help you make sync calling chain on Promise.

Latest version **1.1.2** (published 2016-10-10) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.1.2 |
| Published | 2016-10-10 |
| First published | 2016-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | ngtmuzi |
| Maintainers | ngtmuzi |
| Keywords | Proxy, Promise |

## Links

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

## 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

- 1.1.2 (latest) — 2016-10-10
- 1.1.1 — 2016-08-15
- 1.1.0 — 2016-08-09
- 1.0.0 — 2016-06-20

## README

# promixy
A module help you make sync calling chain on Promise.
Talk is cheap, show you the code.

# Note
This module only can run in Node 6.x because it use `Proxy`.

# Usage
## Get and Apply
You can use it like:

```javascript
var _ = require('promixy');

_({a: 12333})
  .a.toString().split('')[0].toString()
  .then(a=>a + 'yes')
  .replace('1', 'replaceStr')
  .then(console.log, console.error);
```
If you want get the origin promise object just use `a.__promise`,
if you want get the calling chain just use `a.__chainPath`,
otherwise promixy object always return a `Proxy` with `Promise`,
so must attention if you want get the value of `Promise`, you always must use `.then`.

## Set

You can set property value to promixy like that:
```javascript
var a  = _({b: {c: 123}});
var b  = a.b;
var x = a.b.c.toString();

a.b.c = 456;

a.then(console.log, console.error);
b.then(console.log, console.error);
x.then(console.log, console.error);

//{ b: { c: { as: 456 } } }
//{ c: { as: 456 } }
//123
```

# Options
You can set default value through `require('promixy').setDefault` like that:

```javascript
var _ = require('promixy').setDefault({
  methods: ['tap', 'map'],
  Promise: require('bluebird')
});
```
##methods
If you use some module like `bluebird` that provide many method to Promise, you can choose what method can use on promixy.
##Promise
You can define what Promise Library that promixy use.

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