Welcome to mirror list, hosted at ThFree Co, Russian Federation.

repl.js « lib - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e17a0b6d7a5973248cd461c86c9a61bb1ba5822b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

module.exports = repl

function repl (args, cb) {
  var repl = require("repl")
    , npm = require("../npm")
    , ctx = repl.start("npm> ").context
    , log = require("./utils/log")
  process.env.NODE_NO_READLINE = 1
  // log(npm.commands)
  for (var i in npm.commands) {
    // log(i, "repl")
    ctx[i] = function () {
      npm.commands[i]( Array.prototype.slice.call(arguments)
                     , function (er) { log(er, i) }
                     )
    }
  }
}