Efficiently Manage Node.js Processes and Promise Mapping with p-map and why-is-node-running
Summary of my bookmarked Github repositories from Feb 14th, 2017
Github repositories
- mafintosh/why-is-node-running
why-is-node-running is a helpful tool for identifying the active handles that are keeping a Node process running. By installing it globally using npm, you can easily integrate it into your code. The provided example.js file demonstrates how to use the tool and displays the active handles. It highlights timeouts and TCPSERVERWRAP handles that are preventing the process from exiting. The tool also supports a CLI mode, allowing you to run it as a standalone application. Remember that unrefed timers are not listed in versions above Node v11.0.0, and you can include why-is-node-running using the node -r option. The tool is available under the MIT license.
- sindresorhus/p-map
p-map is a useful tool for concurrently mapping over promises and async functions with different inputs. It provides control over the concurrency and allows you to decide whether to stop iterating when an error occurs. By using p-map, you can run promise-returning and async functions multiple times concurrently. The API offers options like setting the concurrency level and handling errors. The returned promise is fulfilled with an array of the fulfilled values in the same order as the input. It also supports features like aborting promises and skipping values in the returned array. p-map is a versatile tool for efficient promise mapping.