我需要Promise.each在蓝鸟上使用.但是当我看到捆绑文件时,我实际上是在考虑使用蓝鸟.
任何人都可以使用像bluebird这样 Promise.each没有依赖关系的函数给我一个例子.
nodemon -w abc -x echo '只看 abc 文件夹' && nodemon -i abc -x echo '看除 abc 文件夹之外的所有文件夹'
如果您查看上面的脚本,我正在尝试查看我的abc文件夹,当其中的某些内容发生变化时,它将在echo 'just watch abc folder'没有 run 的情况下运行echo 'watch all folder except abc folder'。我今天所知道的是 nodemon 只是在发生变化时重新启动漏洞。
我需要的是它会在特定文件夹发生更改时运行特定命令。我怎样才能做到这一点?
我有一个处理来自列表的请求的异步函数,但是当每个请求完成时,它的排序不像之前声明的那样(因为它是异步的)。如何异步获取但保留原始顺序?
这是小提琴http://jsbin.com/papunixume/edit?html,js,console
// clear console every single run
console.clear()
// create promise
const cp = (msg, timeout) => {
return new Promise(resolve => {
setTimeout(() => {
resolve(msg)
}, timeout)
})
}
const a = cp('a', 1000)
const b = cp('b', 500)
const c = cp('c', 800)
Rx.Observable.of([a, b, c]).subscribe(val => {
val.map(res => {
res.then(x => console.log(x))
})
})
Run Code Online (Sandbox Code Playgroud)
结果是
"b"
"c"
"a"
Run Code Online (Sandbox Code Playgroud)
预期的
"a"
"b"
"c"
Run Code Online (Sandbox Code Playgroud) 如果您在jQuery Cropit中查看默认设置,则代码如下
<div class="image-editor">
<div class="cropit-image-preview"></div>
<div class="image-size-label"> Resize image </div>
<input type="range" class="cropit-image-zoom-input">
<input type="hidden" name="image-data" class="hidden-image-data" />
<input type="file" class="cropit-image-input">
<button type="submit">Submit</button>
</div>
Run Code Online (Sandbox Code Playgroud)
是的,它使用输入文件上传新图像。但是,我要插入没有输入文件的图像,需要插入输入文本并解析一些URL。我怎样才能做到这一点?
javascript ×4
asynchronous ×1
bluebird ×1
jquery ×1
node.js ×1
nodemon ×1
promise ×1
rxjs ×1
watch ×1