Forked and packaged for npm