Front end of the Slack clone application.

index.js 491B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. var findUp = require('find-up');
  3. var readPkg = require('read-pkg');
  4. module.exports = function (opts) {
  5. return findUp('package.json', opts).then(function (fp) {
  6. if (!fp) {
  7. return {};
  8. }
  9. return readPkg(fp, opts).then(function (pkg) {
  10. return {
  11. pkg: pkg,
  12. path: fp
  13. };
  14. });
  15. });
  16. };
  17. module.exports.sync = function (opts) {
  18. var fp = findUp.sync('package.json', opts);
  19. if (!fp) {
  20. return {};
  21. }
  22. return {
  23. pkg: readPkg.sync(fp, opts),
  24. path: fp
  25. };
  26. };