In the node path core build in module of node js there is the path parse method. This is a method that can be used to parse a path string into an object with properties for each of the parts of a typical file system path. Properties of a path like the dir to a file as well as the filename and file extension.
There is also a user space npm package called path-parse that aims to be a so called ponyfill of this native nodejs path module method. However I do not see much of a need for such a package as this is something that was introduced a long time ago and seems to work just fine.
This is a canvas example that makes use of what I am calling a pointer manager. Maybe there are other names for such a thing but until I am aware of a better name that is what I am going to call it. Anyway say you want to make a canvas project that will work well with both mouse and touch events. So in other words you do not want to do anything with muti touch on touch devices, and you want all events for both mouse and touch events to be mapped to certain events that are the same. However in order to do so a bit of parsing, adjusting values, and other things need to be preformed before calling some uniform handers that are to be called for both mouse and touch events.
So thins will be a quick post on such a project that does what I just described so lets take a look.