You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
252 B

3 months ago
  1. const fs = require('fs')
  2. const path = require('path')
  3. const readPkg = require('read-pkg')
  4. exports.resolvePkg = function (context) {
  5. if (fs.existsSync(path.join(context, 'package.json'))) {
  6. return readPkg.sync({ cwd: context })
  7. }
  8. return {}
  9. }