Front end of the Slack clone application.

list.js 718B

12345678910111213141516171819202122232425262728293031323334
  1. module.exports = exports = list
  2. exports.usage = 'Prints a listing of the currently installed node development files'
  3. /**
  4. * Module dependencies.
  5. */
  6. var fs = require('graceful-fs')
  7. , path = require('path')
  8. , log = require('npmlog')
  9. function list (gyp, args, callback) {
  10. var devDir = gyp.devDir
  11. log.verbose('list', 'using node-gyp dir:', devDir)
  12. // readdir() the node-gyp dir
  13. fs.readdir(devDir, onreaddir)
  14. function onreaddir (err, versions) {
  15. if (err && err.code != 'ENOENT') {
  16. return callback(err)
  17. }
  18. if (Array.isArray(versions)) {
  19. versions = versions.filter(function (v) { return v != 'current' })
  20. } else {
  21. versions = []
  22. }
  23. callback(null, versions)
  24. }
  25. }