Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qi

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qi - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

lib/map.coffee

2

package.json
{
"name":"qi",
"description":"A small DSL for async flow control.",
"version":"0.0.6",
"version":"0.0.7",
"homepage":"http://github.com/TorchlightSoftware/qi",

@@ -6,0 +6,0 @@ "repository":"git://github.com/TorchlightSoftware/qi.git",

@@ -19,2 +19,34 @@ # Qi

# High Level Operators
These are convenient functions for common use cases.
## Map
Map over arrays or objects, executing an asynchronous function.
### Example
```coffee-script
should = require 'should'
{map} = require 'qi'
squareAsync = (n, next) ->
next null, n * n
describe 'map', ->
it 'should process an array', (done) ->
map [1, 2, 3], squareAsync, (err, results) ->
results.should.eql [1, 4, 9]
done()
it 'should process an object', (done) ->
map {a: 1, b: 2, c: 3}, squareAsync, (err, results) ->
results.should.eql {a: 1, b: 4, c: 9}
done()
# Fundamental Operators
These are the 3 base operators, from which all others are derived.
## Focus

@@ -26,2 +58,4 @@

You can pass a 'name' to the callback constructor to assign a name to a particular callback. If you do so, the results will become an object, with keys corresponding to the names you assigned.
### Example

@@ -107,2 +141,8 @@

# FAQ
Q: Is focus safe to use on a mixture of synchronous and asynchronous subtasks?
A: Yes. Subtasks return their results on process.nextTick, so as long as you construct all your callbacks synchronously, your results should not be collected prematurely.
## LICENSE

@@ -109,0 +149,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc