diff --git a/README.md b/README.md index 3d95515f2e..b6f0f88941 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,21 @@ # 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 @@ -14,6 +23,6 @@ spawn --> 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 ```