debug purposes: reloads all the js scripts that matches a wildcard
961916
function(folder_wildcard) {
            var tmp = document.getElementsByTagName("script");
            //weird, this array changes by its own, so we use a copy
            var script_files = [];
            for (var i in tmp) {
                script_files.push(tmp[i]);
            }

            var docHeadObj = document.getElementsByTagName("head")[0];
            folder_wildcard = document.location.href + folder_wildcard;

            for (var i in script_files) {
                var src = script_files[i].src;
                if (
                    !src ||
                    src.substr(0, folder_wildcard.length) != folder_wildcard
                ) {
                    continue;
                }

                try {
                    if (LiteGraph.debug) {
                        console.log("Reloading: " + src);
                    }
                    var dynamicScript = document.createElement("script");
                    dynamicScript.type = "text/javascript";
                    dynamicScript.src = src;
                    docHeadObj.appendChild(dynamicScript);
                    docHeadObj.removeChild(script_files[i]);
                } catch (err) {
                    if (LiteGraph.throw_errors) {
                        throw err;
                    }
                    if (LiteGraph.debug) {
                        console.log("Error while reloading " + src);
                    }
                }
            }

            if (LiteGraph.debug) {
                console.log("Nodes reloaded");
            }
        }
1168981
function ScriptRunner() {
  this.flush();

  function onMessage(msg, handle) {
    var script, digest;
    switch(msg.event) {
      case 'loglevel':
        log.level(msg.level);
        break;
      case 'eval':
        try {
          script = this.load(msg.source).script;
          this.run(script, msg.args);
        }catch(e) {
          process.send({err: true, data: e.message});
        }
        break;
      case 'evalsha':
        try {
          script = this._cache[msg.sha];
          if(!script) throw NoScript;
          this.run(script, msg.args);
        }catch(e) {
          process.send({err: true, data: e.message});
        }
        break;
      case 'load':
        try {
          digest = this.load(msg.source).sha;
          process.send({data: digest});
        }catch(e) {
          process.send({err: true, data: e.message});
        }
        break;
      case 'exists':
        process.send({data: this.exists(msg.args)});
        break;
      case 'flush':
        this.flush();
        process.send({data: Constants.OK});
        break;
    }
  }

  process.on('message', onMessage.bind(this));
}
149422
function remove_script_tags(){
      html = html.replace(/<script[^>]*>.*?<\/script>/g, function(str){
        if (str.match(/ type=/) && ! str.match(/text\/javascript/)) { return str; }
        else if (str.match(/src=['"]?(https?)/)) { return str; }
        else if (str.match(/src=['"]?\/\//)) { return str; }
        else if (! options.clean_scripts && str.match(/src=['"]/)) { return str; }
        else { return ""; }
      });
    }
658143
function extractScripts($) {
  var scripts = [];
  $('script[src]').each(function() {
    var el  = $(this);
    var src = el.attr('src');
    if(ABS.test(src)) return;
    scripts.push(/^\./.test(src) ? src : './' + src);
    el.remove();
  })
  return scripts;
}
107610
function watchjs(sources, outdir, outfile, opt_options) {
  var bundler = watchify(browserify({
    entries: sources,
    debug: false,
    // Watchify options:
    cache: {},
    packageCache: {},
    fullPaths: true
  }));

  bundler.on('update', function() {
    gutil.log('recompiling js...');
    rebundle_(bundler, outdir, outfile, opt_options);
    gutil.log('finished recompiling js');
  });
  return rebundle_(bundler, outdir, outfile, opt_options);
}
897186
function replacer(match, quote, require) {
        var replacement = 'require(' + quote;
        try {
            resolve.sync(require);
        } catch (exc) {
            try {
                // Try to resolve the require statement starting from the root folder
                resolve.sync(require, {paths: ['.']});
                replacement += relativeToRoot + path.sep;
            } catch (exc2) {
            }
        }
        replacement += require + quote + ')';
//        console.log(replacement);
        return replacement;
    }
509093
function expandWildcard (name, scripts) {
  const n = swapColonAndSlash(name)
  return Object.keys(scripts)
    .map(swapColonAndSlash)
    .filter(x => minimatch(x, n))
    .map(swapColonAndSlash)
}
445599
function getRunScripts (cmd) {
  const re = new RegExp("(?:npm run" + RE_NAME + ")+", "gi")
  return unique(getMatches(re, cmd).map(m => m.match))
}
1097876
function scripts (src, dest, watch) {
  var bundleOpts = _.extend({}, watchify.args)
  if (watch) bundleOpts.debug = true

  var bundle = browserify(src, bundleOpts)

  if (watch) {
    bundle = watchify(bundle)

    bundle.on('update', function () { compileBundle(bundle, dest) }) // when a dependency changes, recompile
    bundle.on('log', gutil.log) // output build logs to terminal
  } else {
    bundle.transform({ global: true }, 'uglifyify')
  }

  return compileBundle(bundle, dest)
}
627728
function (path) {
            var foundPath = self.PathTool.findLibScript(path);
            if (foundPath) {
                self.scriptList.push(foundPath);
            } else {
                self.logger.warn('script:%s not found!', path);
            }
        }
1258574
private function js() {
		foreach ($this->localStatic[ __FUNCTION__ ] as $jswip) {
			
			// r.js optimization
			if($this->compress) {
				$rjsBuild = $jswip .DIRECTORY_SEPARATOR. self::RJS_BUILD;
				if(is_file($rjsBuild)) {
					$this	->start('Optimizing '. self::RJS_BUILD .' with r.js')
							->runLocal(['r.js.cmd',
								'-o', $rjsBuild,
							])->finish();

					// temp destination directory
					$jswip .= DIRECTORY_SEPARATOR . 'dist';
					$this->wipe[] = $jswip;
				}
			}
			
			// make file for each sub folder
			foreach (glob($jswip . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR) as $v) {
				if ($this->compress) {
					$output = $this->tmp[ __FUNCTION__ ] . basename($v) . '.js';
					self::readyDir($output);

					$this->start('Minifing ' . basename($v) . ' with closure');

					$this->runLocal([self::BIN . 'closure.bat',
						'--language_in', 'ECMASCRIPT5',
						'--js_output_file', $output,
						$v . DIRECTORY_SEPARATOR . '**',
					]);

					$this->finish();
				} else {
					$this->start('Merging ' . basename($v) . '\'s JS files');

					$full = $this->tmp[ __FUNCTION__ ] . basename($v) . '.js';

					//remove compiled file
					if (is_file($full))
						unlink($full);

					// append to new js file
					self::readyDir($full);
					$f = fopen($full, 'a'); //match with $g!
										// get js files
					$g = self::rglob($v . DIRECTORY_SEPARATOR . '*.js');

					// add js files
					foreach ($g as $vv) {
						//$this->start('Adding in '. basename($vv) .' to '. basename($v));
												// start buffer
						ob_start();

						// nice title
						echo "\n\n\n/*** ", basename($vv), " ***/\n\n";

						// output file
						require $vv;

						// save the executed css file
						$file = ob_get_clean();

						// add to file
						fwrite($f, $file);

						//$this->finish();
					}

					fclose($f);
					$this->finish();
				}
			}
		}
		
		return $this;
	}
318378
function () {                                                                                  // 1023
    var self = this;                                                                                              // 1024
    _.each(_.clone(self._subscriptions), function (sub, id) {                                                     // 1025
      // Avoid killing the autoupdate subscription so that developers                                             // 1026
      // still get hot code pushes when writing tests.                                                            // 1027
      //                                                                                                          // 1028
      // XXX it's a hack to encode knowledge about autoupdate here,                                               // 1029
      // but it doesn't seem worth it yet to have a special API for                                               // 1030
      // subscriptions to preserve after unit tests.                                                              // 1031
      if (sub.name !== 'meteor_autoupdate_clientVersions') {                                                      // 1032
        self._subscriptions[id].stop();                                                                           // 1033
      }                                                                                                           // 1034
    });                                                                                                           // 1035
  }
1107330
function runScripts() {
  var scripts = document.getElementsByTagName('script');

  // Array.prototype.slice cannot be used on NodeList on IE8
  var jsxScripts = [];
  for (var i = 0; i < scripts.length; i++) {
    if (/^text\/jsx(;|$)/.test(scripts.item(i).type)) {
      jsxScripts.push(scripts.item(i));
    }
  }

  if (jsxScripts.length < 1) {
    return;
  }

  console.warn(
    'You are using the in-browser JSX transformer. Be sure to precompile ' +
    'your JSX for production - ' +
    'http://facebook.github.io/react/docs/tooling-integration.html#jsx'
  );

  loadScripts(jsxScripts);
}
989509
def load_dynamic(self, matches):
        '''
        
        '''
        if not self.opts['autoload_dynamic_modules']:
            return
        syncd = self.state.functions['saltutil.sync_all'](list(matches),
                                                          refresh=False)
        if syncd['grains']:
            self.opts['grains'] = salt.loader.grains(self.opts)
            self.state.opts['pillar'] = self.state._gather_pillar()
        self.state.module_refresh()
224259
def process_scripts (out)
      out.gsub /(<script\b[^>]*?>([\s\S]*?)<\/script>)\s*/i do
        js = $2
        m = $1.gsub /^<script\s([^>]+)>/i do |m|
          attrs(m, 'script', true)
        end
        begin
          js_compressed = HtmlPress.js_compressor js, @options[:js_minifier_options]
          m.gsub!(">#{js}<\/script>", ">#{js_compressed}<\/script>")
        rescue MultiJs::ParseError => e
          log e.message
        end
        reserve m
      end
    end
1009493
function queryTargetScripts(targetDir) {
        var scripts = [];
        fs.readdirSync(targetDir).forEach(function (file) {
            if (!path.basename(file).toLowerCase().match(/.d.ts/g) && path.basename(file).toLowerCase().match(/\.ts$/i)) {
                scripts.push(path.basename(file, path.extname(file)));
            }
        });
        return scripts;
    }
817559
function execute() {

    if (dryRun) {
        console.log(`In ${destDir}, this script would...`);
    } else {
        console.log(`Generating API documentation using TypeDoc...`);
    }

    const packages = path.resolve(rootDir, srcDir);

    glob(packages, {realpath:true}, function(error, srcFiles) {
       
        srcFiles.forEach((srcPath) => {    
            
            var valid = true;

            var packageName = srcPath
                .split(path.sep)
                .pop();

            excludedPackages.forEach((excludedPackageName) => {
                if (packageName === excludedPackageName) {
                    console.log(chalk.yellow(`...skip generating TypeDoc API files for ${packageName}`));
                    valid = false;
                }
            });

            if(valid) {
                dryRun ? console.log(`...generate TypeDoc API files for ${packageName}`) : createAPIFiles(packageName, srcPath);
            }

        });

    });
}