Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
# 1.7.1 with generators

```coffee
spawn -->
x = -->
console.log "I am starting"
yield delay 500
console.log "Just waited for a bit, no worries"
yield from jabber()
console.log "Enough now"
yield 'a'
y = yield 'b'
console.log "result:", y
yield 'c'
return 'end'

g = x()

console.log g.next() # 'a'
console.log g.next() # 'b'
# pass arg as return of 2nd yield
console.log g.next({prop: 'foobar'}) # 'c'
console.log g.next() # 'end'
```

## Install

Use

```bash
npm install xixixao/coffee-script
node_modules/coffee-script/bin/coffee someFile
npm install xixixao/coffee-script --save
node --harmony node_modules/.bin/coffee myScript.coffee
```