"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/lib/utils/no-progress-while-running.js" (7 Feb 2017, 541 Bytes) of archive /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 'use strict'
    2 var log = require('npmlog')
    3 var progressEnabled
    4 var running = 0
    5 
    6 var startRunning = exports.startRunning = function () {
    7   if (progressEnabled == null) progressEnabled = log.progressEnabled
    8   if (progressEnabled) log.disableProgress()
    9   ++running
   10 }
   11 
   12 var stopRunning = exports.stopRunning = function () {
   13   --running
   14   if (progressEnabled && running === 0) log.enableProgress()
   15 }
   16 
   17 exports.tillDone = function noProgressTillDone (cb) {
   18   startRunning()
   19   return function () {
   20     stopRunning()
   21     cb.apply(this, arguments)
   22   }
   23 }