How to use process.title:
93 94 95 96 97 98 99 100 101 102
const $1 = cheerio.load(html); // console.log('url === ' + value) const title = $1('.card_title').text().trim(); // title = title.trim() // title('.card_title') console.log('Title === ' + title) // await $1('.adsbygoogle').remove(); const data = $1('.entry-content').html() // .('.adsbygoogle').remove();
How to use process.abort:
GitHub: BBpezsgo/DiscordBot
2270 2271 2272 2273 2274 2275 2276 2277 2278 2279
process.exit() }, 500) }) this.app.post('/Process/Abort', (req, res) => { process.abort() }) this.app.post('/Process/Disconnect', (req, res) => { process.disconnect()
How to use process.disconnect:
344 345 346 347 348 349 350 351 352 353
} } } } async disconnect(wait = true){ await this.unsubscribe(wait); if (this.isConnected()){ if(this._connection != null) { try{
How to use process.uptime:
GitHub: gx0r/agilegps
89 90 91 92 93 94 95 96 97 98
date: new Date(), stack: err.stack, argv: process.argv, cwd: process.cwd(), memory: process.memoryUsage(), uptime: process.uptime(), promise: false, uid: process.getuid && process.getuid(), groups: process.getgroups && process.getgroups(), load: os.loadavg()
See more examples
How to use process.config:
GitHub: Raval-Arth/NodeJs_pr
3 4 5 6 7 8 9 10 11 12 13 14
console.log("argv --> " + process.argv); console.log("argv0 --> " + process.argv0); console.log("config --> " + process.config); var no_conf = 0; var conf = process.config; for (var key in conf) { console.log(key); var sub_conf = conf[key];
How to use process.emit:
GitHub: fibjs/fibjs
115 116 117 118 119 120 121 122 123 124
process.emitWarning('Something happened!', { code: 'MY_WARNING', detail: 'This is some additional information', }); process.emit("warning", 100); process.on('warning', (warning) => { warnings.push(warning); ev.set();
See more examples
How to use process.versions:
GitHub: DerpWerp/dogeunblocker
829 830 831 832 833 834 835 836 837 838
// Default to using process.argv if (argv === undefined) { argv = process.argv; // @ts-ignore: unknown property if (process.versions && process.versions.electron) { parseOptions.from = 'electron'; } } this.rawArgs = argv.slice();
How to use process.getgroups:
29 30 31 32 33 34 35 36 37 38 39
const process = require('process') console.log( process.pid, process.ppid, process.getuid(), process.getgroups(), 'PID' ) const MOCHA_LATEX_TIMEOUT = 60 * 1000
How to use process.setgid:
83 84 85 86 87 88 89 90 91 92
// nothing to do for non-posix system if (!process.setgid) { return; } let gid = null; try { gid = await Utils.getGID(this.options.processOwner); process.setgid(gid); } catch(e) { // throw PattyError.other() this.logError(`Could not change process owner group to "${gid}"`, e); }
How to use process.setuid:
93 94 95 96 97 98 99 100 101 102
// set user-id // nothing to do for non-posix system if (!process.setuid) { return; } try { process.setuid(this.options.processOwner); } catch(e) { // throw PattyError.other() this.logError(`Could not change process owner to "${this.options.processOwner}"`, e); }
How to use process.ppid:
GitHub: gamejolt/gamejolt
12 13 14 15 16 17 18 19 20 21
export type ASGController = Awaited<ReturnType<typeof startDesktopAudioCapture>>; export async function startDesktopAudioCapture(writableStream: WritableStream<AudioData>) { // We get the parent process's pid since it would also contain all the child // pids under it then. const appPid = process.ppid; const writer = markRaw(writableStream.getWriter()); const emitter = markRaw(new EventEmitter()); const uid = ref('');
See more examples
How to use process.emitWarning:
39 40 41 42 43 44 45 46 47
// Process args const args = process.argv.slice(2); // Log a warning if there are more than 0 arguments if (args.length > 0) { emitWarning( 'No parameters needed, all the additional parameters will be ignored.', ); }
See more examples
How to use process.execPath:
GitHub: IBM/innovate-digital-bank
15 16 17 18 19 20 21 22 23
const request = require('request'); const path = require('path'); const chalk = require('chalk'); const node = process.execPath; // Array of args passed to idt.js. const args = process.argv.slice(2); let win = (process.platform === 'win32');
See more examples
How to use process.cpuUsage:
GitHub: Raval-Arth/NodeJs_pr
17 18 19 20 21 22 23 24 25 26 27 28
} } console.log("total no of configuration available is " + no_conf); const usage = process.cpuUsage(); console.log("\ncpuUsage --> " + JSON.stringify(usage)); console.log("Current working directory: ", process.cwd()); console.log("debug port is " + process.debugPort); console.log(process.env);
How to use process.send:
108 109 110 111 112 113 114 115 116 117
addedMessages: added, campaignId: rssCampaign.id }); log.verbose('Feed', `Found ${added} new campaigns messages from feed ${rssCampaign.id}`); process.send({ type: 'entries-added' }); } else { checkStatus = tLog('foundNothingNewFromTheFeed');
See more examples
How to use process.version:
GitHub: apostrophecms/apostrophe
201 202 203 204 205 206 207 208 209 210
} process.exit(code); }; try { const matches = process.version.match(/^v(\d+)/); const version = parseInt(matches[1]); if (version < 12) { throw new Error('Apostrophe 3.x requires at least Node.js 12.x.'); }
See more examples
How to use process.getProcessMemoryInfo:
20 21 22 23 24 25 26 27 28 29
} return totalProcessorUsagePercent; }); electron.ipcMain.handle(PROCESS_UTILS_GET_MEMORY_INFO, async _ => { return process.getProcessMemoryInfo(); }); electron.ipcMain.handle(PROCESS_UTILS_FLUSH_DNS_CACHE, async _ => { const defaultSession = electron.session.defaultSession; if (!defaultSession || !defaultSession.clearHostResolverCache) return;
See more examples
How to use process.binding:
GitHub: dependents/node-precinct
17 18 19 20 21 22 23 24 25 26 27 28
const detectiveStylus = require('detective-stylus'); const detectiveTypeScript = require('detective-typescript'); const debug = debuglog('precinct'); // eslint-disable-next-line n/no-deprecated-api const natives = process.binding('natives'); /** * Finds the list of dependencies for the given file *
See more examples
How to use process.getgid:
366 367 368 369 370 371 372 373 374 375 376
return true; /* owned by root */ /* Permit based on group membership */ if (statBuf.gid === fun.mainStat.gid) return true; /* conf and program in same group */ if ((fun.mainStat.mode & 0o020) && (statBuf.gid === process.getgid())) return true; /* program is group-writeable and we are in group */ throw new Error('did not load configuration file due to invalid permissions: ' + fullPath); }
How to use process.platform:
GitHub: sinedied/backslide
31 32 33 34 35 36 37 38 39
const CssRelativeURLRegExp = /(url\("?)((?!\/|data:|http:\/\/|https:\/\/|file:\/\/)[^")]+)("?\))/gm; const MdImagesRegExp = /(!\[.*?]\()(file:\/{3}.+?)((?=\)))/gm; const HtmlImagesRegExp = /(<img[^>]+src=["'])(file:\/{3}.[^">]+?)(["'])/gm; const CssImagesRegExp = /(url\("?)((file:\/\/)[^")]+)("?\))/gm; const isWindows = process.platform.startsWith('win'); const help = `${pkg.name} ${pkg.version} Usage: bs [init|serve|export|pdf] [options]
See more examples
How to use process.getuid:
42 43 44 45 46 47 48 49 50 51 52
console.log('*** ' + msg); process.exit(1); } function main() { var uid = process.getuid(); if (process.env.OS !== 'LINUX') { fail('This script works on linux only.'); } console.log([
How to use process.nextTick:
GitHub: stkevintan/Cube
195 196 197 198 199 200 201 202 203 204
return v.name; }).join(); songList.push(new SongM(o));//modefy here! } var that = this; process.nextTick(function () { // >100时分批查询 var num = Math.ceil(idArray.length / 100); for (var k = 0; k < num; k++) { var idTmp = idArray.slice(k * 100, Math.min((k + 1) * 100, idArray.length));
See more examples
How to use process.chdir:
GitHub: ZhangGe6/onnx-modifier
23 24 25 26 27 28 29 30 31 32
return; } electron.app.on('second-instance', (event, commandLine, workingDirectory) => { const currentDirectory = process.cwd(); process.chdir(workingDirectory); const open = this._parseCommandLine(commandLine); process.chdir(currentDirectory); if (!open) { if (this._views.count > 0) {
See more examples
How to use process.memoryUsage:
GitHub: gx0r/agilegps
88 89 90 91 92 93 94 95 96 97
pid: process.pid, date: new Date(), stack: err.stack, argv: process.argv, cwd: process.cwd(), memory: process.memoryUsage(), uptime: process.uptime(), promise: false, uid: process.getuid && process.getuid(), groups: process.getgroups && process.getgroups(),
See more examples
How to use process.default:
GitHub: gethexon/hexon
2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149
// node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/vendor/supports-color/index.js var import_node_process = __toESM(require("process"), 1); var import_node_os = __toESM(require("os"), 1); var import_node_tty = __toESM(require("tty"), 1); function hasFlag(flag, argv = import_node_process.default.argv) { const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; const position = argv.indexOf(prefix + flag); const terminatorPosition = argv.indexOf("--"); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
See more examples
How to use process.stdin:
GitHub: APTrust/dart
107 108 109 110 111 112 113 114 115 116
// This is used as a fallback, in case the standard method fails. // With this in place, all tests pass under Node 13.7. function readStdin() { let promise = new Promise((resolve, reject) => { var chunks = []; process.stdin .on("data", function(chunk) { chunks.push(chunk); }) .on("end", function() {
See more examples
How to use process.stderr:
GitHub: getsentry/sentry-cli
34 35 36 37 38 39 40 41 42 43
if (logStream === 'stdout') { return process.stdout; } if (logStream === 'stderr') { return process.stderr; } throw new Error( `Incorrect SENTRYCLI_LOG_STREAM env variable. Possible values: 'stdout' | 'stderr'`
See more examples
How to use process.kill:
161 162 163 164 165 166 167 168 169 170
function checkProcess (pid) { if (!pid) { return false; } try { nodeProcess.kill(pid, 0); return true; } catch (err) { // there is no such a process... return false;
See more examples
How to use process.hrtime:
126 127 128 129 130 131 132 133 134 135
// Now for each worker pool we ask the providers to do stuff const workerPools = (await this.db.fns.get_worker_pools_with_capacity_and_counts_by_state(null, null)) .map(row => WorkerPool.fromDb(row)); for (const workerPool of workerPools) { const start = process.hrtime.bigint(); const { providerId, previousProviderIds, workerPoolId } = workerPool; const provider = this.providers.get(providerId); if (!provider) { this.monitor.warning(
See more examples