"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/node-gyp/lib/list.js" (11 Apr 2017, 718 Bytes) of package /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

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