# q-lazy

> Q lazy promise resolution

Latest version **1.0.2** (published 2014-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install q-lazy
pnpm add q-lazy
yarn add q-lazy
bun add q-lazy
```

## 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.0.2 |
| Published | 2014-01-07 |
| First published | 2013-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dmitry Bashkatov |
| Maintainers | nailgun |
| Keywords | q, promise, promises, lazy |

## Links

- npm: https://www.npmjs.com/package/q-lazy
- Repository: https://github.com/nailgun/q-lazy
- Issues: https://github.com/nailgun/q-lazy/issues
- npm.io page: https://npm.io/package/q-lazy

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2014-01-07
- 1.0.1 — 2013-12-24
- 1.0.0 — 2013-12-24

## README

# Q.lazy()

<a href="http://promises-aplus.github.com/promises-spec">
    <img src="http://promises-aplus.github.com/promises-spec/assets/logo-small.png"
         align="right" alt="Promises/A+ logo" />
</a>

*Resolves promises idly.*

[![Build Status](https://travis-ci.org/nailgun/q-lazy.png?branch=master)](https://travis-ci.org/nailgun/q-lazy)
[![NPM version](https://badge.fury.io/js/q-lazy.png)](http://badge.fury.io/js/q-lazy)

```npm install q-lazy```

## About

It's a simple plugin for [Q](https://github.com/kriskowal/q) allowing you to create lazy
promises. Such promises start to resolve only after calling `.then()` on them.

## Usage

```js
var Q = require('q');
require('q-lazy'); // extends Q

function heavyFunc () {
    // ...
    return ret; // the return value can be a promise or a plain value
}

var promise = Q.lazy(heavyFunc); // doesn't execute heavyFunc

promise.then(function (ret) {    // executes heavyFunc
    // use ret
});
```

For specification take a look at provided [testsuite](test/test.q-lazy.js). It's short.

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