問題タブ [node-async]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
node.js - Node.js/Async - How to avoid callback hell with async?
I'm new to Node.Js and JavaScript web development on the backend. I see that callbacks inside callbacks could be a pain and there are modules to avoid that. One of these modules is async, https://github.com/caolan/async
I've read the documentation but it is hard to start and understand how to do it.
For example, I've this function "check_aut_user", How can I convert this code using async?
Best Regards,
node.js - Zombiejs - リンクのコンテンツを同期してフェッチする
私はnodejsとzombiejsを使って、サイトから個人データを取得してきました。残念ながら、zombiejs が最初のリンクからのみデータを取得し、次にハングアップするという点で立ち往生しています。
私が従う手順は-
- ベースURLに移動
- ページ数を取得する
- 非同期ライブラリを使用して、毎回新しいブラウザ ウィンドウを開いて順番に取得します。注: まったく新しいブラウザー インスタンスを作成するのはコストがかかるため、まったく新しいブラウザー インスタンスではなく、ブラウザー ウィンドウのみを作成します。
これは私のコードです
結果
任意の提案をいただければ幸いです
node.js - 非同期を返す Async.waterfall
async.waterfall
サービスで応答を作成するために使用しようとしていexpress
ます。これが私のコードです:
return ステートメントを にしたいのですres.json(result.user)
が、waterfall
関数は常に上記のコメント付きコードがある場所に戻ります。私は常に使用series
してparallel
機能し、それらは機能します。私は何を間違っていますか?
node.js - いずれかのタスクがエラーになった場合、すべてのタスクが完了した後も async.parallel は最終的なコールバックを呼び出しますか?
コードで、最初のタスクが 2 番目のタスクの前に cb(true) を実行した場合、2 番目のタスクは引き続き実行されますか? もしそうなら、それが終わった後、メインのコールバックはまだ呼び出されますか?
node.js - ノードにコールバックとして2つの関数を追加するには?
ノードで2つの関数をコールバックするにはどうすればよいですか?
例えば:
そのためのモジュールはありますか?