Toposort performs topological sorting on directed acyclic graphs (DAGs). It accepts a list of edges representing dependencies, where each edge is a pair of nodes. The algorithm then orders the nodes such that for every directed edge from node A to node B, node A comes before node B in the sorted output. This is useful for dependency resolution, task scheduling, and other applications where order matters based on relationships. It throws an error if the input graph contains cycles.
The npm package toposort saw its initial releases in late 2012, with more frequent updates through early 2013. After a period of inactivity, it experienced a minor release in mid-2015, and a major version update in 2016. A flurry of releases occurred throughout 2017 and early 2018. Since then, the package has not been updated as of September 3, 2025.
Toposort npm package downloads show a generally increasing trend from March 2024 (24.8M) to July 2025 (37.1M). August 2025 saw a decrease (33.0M), and September 2025 (2.6M) only represents partial data. Overall, download activity remains high.