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