PathFinding.js
A comprehensive path-finding library for grid based games
...Note that this project only provides path-finding algorithms for 2D space. If you need to work in a 3D environment, then you may use @schteppe's fork. When instantiating path-finders, you may pass in additional parameters to indicate which specific strategies to use. For all path-finders, you may indicate whether diagonal movement is allowed. The default value is false, which means that the path can only go orthogonally. When diagonal movement is enabled, you might want to prevent the path from touching the corners of the occupied grid blocks. ...