Skip to content

Commit

Permalink
Merge branch 'v1' into add_noconflict
Browse files Browse the repository at this point in the history
Conflicts:
	q.js
  • Loading branch information
kahnvex committed Apr 27, 2015
2 parents 80c7666 + b26cace commit 3575854
Show file tree
Hide file tree
Showing 8 changed files with 592 additions and 100 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ q.min.js
.coverage_data/
.coverage_debug/
cover_html/

# IntelliJ IDEA project files
.idea
*.iml
1 change: 1 addition & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"unused": true,

"globals": {
"self": false,
"bootstrap": false,
"cajaVM": false,
"define": false,
Expand Down
23 changes: 0 additions & 23 deletions .npmignore

This file was deleted.

45 changes: 43 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
<!-- vim:ts=4:sts=4:sw=4:et:tw=70 -->

## 1.3.0

- Add tracking for unhandled and handled rejections in Node.js (@benjamingr).

## 1.2.1

- Fix Node.js environment detection for modern Browserify (@kahnjw).

## 1.2.0

- Added Q.any(promisesArray) method (@vergara).
Returns a promise fulfilled with the value of the first resolved promise in
promisesArray. If all promises in promisesArray are rejected, it returns
a rejected promise.

## 1.1.2

- Removed extraneous files from the npm package by using the "files"
whitelist in package.json instead of the .npmignore blacklist.
(@anton-rudeshko)

## 1.1.1

- Fix a pair of regressions in bootstrapping, one which precluded
WebWorker support, and another that precluded support in
``<script>`` usage outright. #607

## 1.1.0

- Adds support for enabling long stack traces in node.js by setting
environment variable `Q_DEBUG=1`.
- Introduces the `tap` method to promises, which will see a value
pass through without alteration.
- Use instanceof to recognize own promise instances as opposed to
thenables.
- Construct timeout errors with `code === ETIMEDOUT` (Kornel Lesiński)
- More descriminant CommonJS module environment detection.
- Dropped continuous integration for Node.js 0.6 and 0.8 because of
changes to npm that preclude the use of new `^` version predicate
operator in any transitive dependency.
- Users can now override `Q.nextTick`.

## 1.0.1

- Adds support for `Q.Promise`, which implements common usage of the
Expand Down Expand Up @@ -82,7 +124,7 @@ have been distributed far and wide and demand long term support.

## 0.9.4

- `isPromise` and `isPromiseAlike` now always returns a boolean
- `isPromise` and `isPromiseAlike` now always returns a boolean
(even for falsy values). #284 @lfac-pt
- Support for ES6 Generators in `async` #288 @andywingo
- Clear duplicate promise rejections from dispatch methods #238 @SLaks
Expand Down Expand Up @@ -732,4 +774,3 @@ Their replacements are listed here:
## 0.0.1

- initial version

23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,18 @@ Q.allSettled(promises)
});
```

The ``any`` function accepts an array of promises and returns a promise that is
fulfilled by the first given promise to be fulfilled, or rejected if all of the
given promises are rejected.

```javascript
Q.any(promises)
.then(function (first) {
// Any of the promises was fulfilled.
}, function (error) {
// All of the promises were rejected.
});
```

### Sequences

Expand Down Expand Up @@ -843,6 +855,15 @@ stack trace! This is very helpful for debugging, as otherwise you end up getting
only the first line, plus a bunch of Q internals, with no sign of where the
operation started.

In node.js, this feature can also be enabled through the Q_DEBUG environment
variable:

```
Q_DEBUG=1 node server.js
```

This will enable long stack support in every instance of Q.

This feature does come with somewhat-serious performance and memory overhead,
however. If you're working with lots of promises, or trying to scale a server
to many users, you should probably keep it off. But in development, go for it!
Expand All @@ -855,6 +876,6 @@ You can view the results of the Q test suite [in your browser][tests]!

## License

Copyright 2009–2014 Kristopher Michael Kowal
Copyright 2009–2015 Kristopher Michael Kowal and contributors
MIT License (enclosed)

21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "q",
"version": "1.0.1",
"version": "1.3.0",
"description": "A library for promises (CommonJS/Promises/A,B,D)",
"homepage": "https://github.com/kriskowal/q",
"author": "Kris Kowal <[email protected]> (https://github.com/kriskowal)",
Expand Down Expand Up @@ -32,6 +32,11 @@
"url": "http://github.com/kriskowal/q/raw/master/LICENSE"
},
"main": "q.js",
"files": [
"LICENSE",
"q.js",
"queue.js"
],
"repository": {
"type": "git",
"url": "git://github.com/kriskowal/q.git"
Expand All @@ -42,22 +47,22 @@
},
"dependencies": {},
"devDependencies": {
"jshint": "~2.1.9",
"cover": "*",
"jasmine-node": "1.11.0",
"opener": "*",
"promises-aplus-tests": "1.x",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-contrib-uglify": "~0.2.2",
"matcha": "~0.2.0"
"grunt-contrib-uglify": "~0.9.1",
"jasmine-node": "1.11.0",
"jshint": "~2.1.9",
"matcha": "~0.2.0",
"opener": "*",
"promises-aplus-tests": "1.x"
},
"scripts": {
"test": "jasmine-node spec && promises-aplus-tests spec/aplus-adapter",
"test-browser": "opener spec/q-spec.html",
"benchmark": "matcha",
"lint": "jshint q.js",
"cover": "cover run node_modules/jasmine-node/bin/jasmine-node spec && cover report html && opener cover_html/index.html",
"cover": "cover run jasmine-node spec && cover report html && opener cover_html/index.html",
"minify": "grunt",
"prepublish": "grunt"
},
Expand Down
Loading

0 comments on commit 3575854

Please sign in to comment.