add genPrj and addNpmModule functions, and related test in test2