What is `LS` and what is Electron?

when I look at the code:

// If debug isn"t set in LS, and we"re in Electron, try to load $DEBUG
  if (!r && typeof process !== "undefined" && "env" in process) {
    r = process.env.DEBUG;
  }

how do you understand this sentence?

If debug isn"t set in LS, and we"re in Electron

what is LS and what is Electron?

Mar.10,2021

electron the official description is " Electron is based on Chromium and Node.js, so that you can build applications using HTML, CSS and JavaScript. " is to use front-end technology to write desktop programs, such as vscode.
the simplest thing is that you can write a few html pages and package them in Electron to get a desktop application. However, if you use Electron, it is best to know some knowledge of nodejs first, otherwise you might as well open html with a browser.

LS look at the context. This is the source code of debug.js , and the LS here refers to localstorage .

  exports.storage = 'undefined' != typeof chrome
                 && 'undefined' != typeof chrome.storage
                    ? chrome.storage.local
                    : localstorage();

process , module.export these are all concepts related to nodejs. If you don't know nodejs, you are not recommended to read this source code.

Menu