Skip to content

Commit

Permalink
Scaffold: Normalize readme/description/license/config
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed May 17, 2016
1 parent 3e8e9fd commit 7b66aab
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 31 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
6 changes: 4 additions & 2 deletions .gitignore
Expand Up @@ -16,12 +16,14 @@ coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

.DS_Store
25 changes: 13 additions & 12 deletions LICENSE
@@ -1,20 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Blaine Bublitz
Copyright (c) 2015 Blaine Bublitz, Eric Schoffstall and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 39 additions & 14 deletions README.md
@@ -1,11 +1,14 @@
async-done
==========
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>

[![build status](https://secure.travis-ci.org/gulpjs/async-done.png)](http://travis-ci.org/gulpjs/async-done)
# async-done

Handles completion and errors for callbacks, promises, observables, child processes and streams.
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]

Will run call the function on `nextTick`. This will cause all functions to be async.
Force async using `nextTick` and normalize completion/errors for callbacks, promises, observables, child processes and streams.

## Usage

Expand Down Expand Up @@ -49,21 +52,21 @@ Optionally takes a callback to call when async tasks are complete.

#### Completion and Error Resolution

* `Callback` called
* `Callback` (`done`) called
- Completion: called with null error
- Error: called with non-null error
* `Stream` or `EventEmitter` returned
- Completion: [end-of-stream](https://www.npmjs.org/package/end-of-stream) module
- Error: [domains](http://nodejs.org/api/domain.html)
- Completion: [end-of-stream][end-of-stream] module
- Error: [domains][domains]
* `Child Process` returned
- Completion [end-of-stream](https://www.npmjs.org/package/end-of-stream) module
- Error: [domains](http://nodejs.org/api/domain.html)
- Completion [end-of-stream][end-of-stream] module
- Error: [domains][domains]
* `Promise` returned
- Completion: [onFulfilled](http://promisesaplus.com/#point-26) method called
- Error: [onRejected](http://promisesaplus.com/#point-30) method called
- Completion: [onFulfilled][promise-onfulfilled] method called
- Error: [onRejected][promise-onrejected] method called
* `Observable` returned
- Completion: [onCompleted](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/observable.md#rxobservableprototypesubscribeobserver--onnext-onerror-oncompleted) method called
- Error: [onError](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/observable.md#rxobservableprototypesubscribeobserver--onnext-onerror-oncompleted) method called
- Completion: [onCompleted][observable-subscribe] method called
- Error: [onError][observable-subscribe] method called

__Warning:__ Sync tasks are __not supported__ and your function will never complete if the one of the above strategies is not used to signal completion. However, thrown errors will be caught by the domain.

Expand All @@ -84,3 +87,25 @@ Errors can be caused by:
## License

MIT

[end-of-stream]: https://www.npmjs.org/package/end-of-stream
[domains]: http://nodejs.org/api/domain.html
[promise-onfulfilled]: http://promisesaplus.com/#point-26
[promise-onrejected]: http://promisesaplus.com/#point-30
[observable-subscribe]: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/subscribe.md

[downloads-image]: http://img.shields.io/npm/dm/async-done.svg
[npm-url]: https://npmjs.org/package/async-done
[npm-image]: http://img.shields.io/npm/v/async-done.svg

[travis-url]: https://travis-ci.org/gulpjs/async-done
[travis-image]: http://img.shields.io/travis/gulpjs/async-done.svg?label=travis-ci

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/async-done
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/async-done.svg?label=appveyor

[coveralls-url]: https://coveralls.io/r/gulpjs/async-done
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/async-done/master.svg

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
25 changes: 25 additions & 0 deletions appveyor.yml
@@ -0,0 +1,25 @@
# http://www.appveyor.com/docs/appveyor-yml
# http://www.appveyor.com/docs/lang/nodejs-iojs

environment:
matrix:
# node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "5"
- nodejs_version: "6"

install:
- ps: Install-Product node $env:nodejs_version
- npm install

test_script:
- node --version
- npm --version
- cmd: npm test

build: off

# build version format
version: "{build}"
6 changes: 3 additions & 3 deletions package.json
@@ -1,10 +1,10 @@
{
"name": "async-done",
"version": "1.2.0",
"description": "Handles completion and errors for callbacks, promises, observables and streams.",
"author": "Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",
"description": "Force async using nextTick and normalize completion/errors for callbacks, promises, observables, child processes and streams.",
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
"contributors": [
"Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",
"Blaine Bublitz <blaine.bublitz@gmail.com>",
"Pawel Kozlowski <pkozlowski.opensource@gmail.com>",
"Matthew Podwysocki <matthew.podwysocki@gmail.com>"
],
Expand Down

0 comments on commit 7b66aab

Please sign in to comment.