JavaScript program that gives statistics on facebook messenger messages
Download archive of all you data from Facebook using their awesome export tool.
Go to Facebook settings, then click on Your Facebook Information tab. Choose item Download Your Information.
Choose format JSON and media quality Low. Make sure at least Messages and Profile Information items are selected.
Then click Create File. Facebook will then prepare ZIP archive with selected information, which you can feed into this script.
Unzip contents of the archive to folder of your choice.