How to use ps-list - 7 common examples

To help you get started, we’ve selected a few ps-list examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joelday / papyrus-lang / src / papyrus-lang-vscode / src / ClientServer.ts View on Github external
const clientOptions: LanguageClientOptions = {
            documentSelector: [
                { scheme: 'file', language: 'papyrus' },
                { scheme: 'file', language: 'papyrus-project' },
            ],
            synchronize: {
                fileEvents: this._fsWatcher,
                configurationSection: 'papyrus',
            },
        };

        // In order to find the new process id, we need to exclude any current running instances of the language server.
        let existingProcessIds: number[];
        if (process.platform === 'win32' && process.env['PAPYRUS_EXTENSION_DEBUG']) {
            const processes = await psList();
            existingProcessIds = processes.filter((p) => p.name.startsWith('DarkId.Papyrus.Host')).map((p) => p.pid);
        }

        // Create the language client and start the client.
        this._client = new LanguageClient('papyrus', 'Papyrus Language Service', this._serverOptions, clientOptions);

        this._client.trace = Trace.Verbose;
        this._clientDisposable = this._client.start();

        await this._client.onReady();

        if (!this._clientDisposable) {
            return;
        }

        if (process.platform === 'win32' && process.env['PAPYRUS_EXTENSION_DEBUG']) {
github joelday / papyrus-lang / src / papyrus-lang-vscode / src / ClientServer.ts View on Github external
let existingProcessIds: number[];
        if (process.platform === 'win32' && process.env['PAPYRUS_EXTENSION_DEBUG']) {
            const processes = await psList();
            existingProcessIds = processes.filter((p) => p.name === 'DarkId.Papyrus.Host.exe').map((p) => p.pid);
        }

        // Create the language client and start the client.
        this._client = new LanguageClient('papyrus', 'Papyrus Language Service', this._serverOptions, clientOptions);

        this._client.trace = Trace.Verbose;
        this._client.start();

        await this._client.onReady();

        if (process.platform === 'win32' && process.env['PAPYRUS_EXTENSION_DEBUG']) {
            const processes = await psList();
            const serverProcessId = processes.find(
                (p) => p.name === 'DarkId.Papyrus.Host.exe' && existingProcessIds.indexOf(p.pid) === -1
            )!.pid;

            if (serverProcessId) {
                exec(`vsjitdebugger.exe -p ${serverProcessId}`);
            }
        }
    }
github vinsonchuong / puppet-strings / test / helpers / processes.js View on Github external
export async function findProcess(arg: ChildProcess | number) {
  const pid = typeof arg === 'number' ? arg : arg.pid

  const runningProcesses = await psList()
  return runningProcesses.find(runningProcess => pid === runningProcess.pid)
}
github ganeshrvel / openmtp / app / utils / isGoogleAndroidFileTransferActive.js View on Github external
return new Promise(resolve => {
    psList()
      .then(list => {
        if (
          findLodash(list, { name: 'Android File Transfer' }) &&
          findLodash(list, { name: 'Android File Transfer Agent' })
        ) {
          return resolve(true);
        }

        return resolve(false);
      })
      .catch(e => {
        log.error(e, 'isGoogleAndroidFileTransferActive');
      });
  }).catch(e => {
    log.error(e, 'isGoogleAndroidFileTransferActive -> Promise');
github Razviar / mtgap / src / lib / watchprocess.ts View on Github external
public async getprocesses(): Promise {
    const processes = await psList();
    const res = processes.find(proc => proc.name === this.pname);
    if (res) {
      return res.pid;
    } else {
      return -1;
    }
  }
}
github mathphreak / ReliefValve / src / steps / init.js View on Github external
export function isSteamRunning(searchTarget = 'steam') {
  return Rx.Observable.fromPromise(psList())
    .map(data => _.some(data, x => _.includes(x.name.toLowerCase(), searchTarget)));
}
github joelday / papyrus-lang / src / papyrus-lang-vscode / src / Utilities.ts View on Github external
export async function getGameIsRunning(game: PapyrusGame) {
    const processList = await procList();
    return processList.some((p) => p.name.toLowerCase() === getExecutableNameForGame(game).toLowerCase());
}

ps-list

Get running processes

MIT
Latest version published 2 years ago

Package Health Score

71 / 100
Full package analysis

Popular ps-list functions