Make this almost usable as npm module
Almost there?
....