UNPKG
qjs
Version:
latest (0.0.2)
0.0.2
0.0.1
0.0.0
Use the await keyword with Q promises to tame your async code
ForbesLindesay/QJS
qjs
/
example.js
12 lines
•
327 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
var
qjs =
require
(
'./'
); qjs.
compile
(
module
,
function
(
) {
//Everybody loves a comment
function
foo
(
) {
for
(
var
x =
1
,y=
10
; x <
11
; x++) {
await
(Q.
delay
(x*
200
));
console
.
log
(x); }
return
'foo'
; }
foo
(Q.
delay
(
'bar'
,
1000
)).
then
(
console
.
log
).
end
(); });