Generate package.json from js object written out as json

taking a stab at fixing #3. could probably be better but feedback is welcome