Integrated the doc generation logic with npm(1).