@gjsify/process 0.3.20 → 0.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/esm/index.js +1 -1
  2. package/package.json +6 -6
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{EventEmitter as e}from"@gjsify/events";import{ensureMainLoop as t,quitMainLoop as n}from"@gjsify/utils";import{nativeTerminal as r}from"@gjsify/terminal-native";const i=new TextEncoder;function a(){return globalThis}function o(){try{let e=a().imports?.system;if(e?.version!==void 0){let t=Number(e.version);return`${Math.floor(t/1e4)}.${Math.floor(t%1e4/100)}.${t%100}`}}catch{}}function s(){if(typeof globalThis.process?.versions?.node==`string`)return globalThis.process.versions.node}function c(){if(s())return{version:globalThis.process.version,versions:{...globalThis.process.versions},title:globalThis.process?.title||`node`};let e=o(),t={node:`20.0.0`};return e&&(t.gjs=e),{version:`v20.0.0`,versions:t,title:`gjs`}}function l(){if(typeof globalThis.process?.ppid==`number`)return globalThis.process.ppid;try{let e=a().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/status`);if(t){let e=new TextDecoder().decode(t).match(/PPid:\s+(\d+)/);if(e)return parseInt(e[1],10)}}}catch{}return 0}function u(){try{let e=a().imports?.gi?.GLib;if(e&&e.get_os_info(`ID`))return`linux`}catch{}return a().imports?.system===void 0&&typeof globalThis.process?.platform==`string`?globalThis.process.platform:`linux`}function d(){return typeof globalThis.process?.arch==`string`?globalThis.process.arch:`x64`}function f(){try{let e=a().imports?.gi?.GLib;if(e?.get_current_dir)return e.get_current_dir()}catch{}return`/`}function p(){if(typeof globalThis.process?.env==`object`)return globalThis.process.env;try{let e=a().imports?.gi?.GLib;if(e)return new Proxy({},{get(t,n){if(typeof n==`string`)return e.getenv(n)??void 0},set(t,n,r){return typeof n==`string`?(e.setenv(n,String(r),!0),!0):!1},deleteProperty(t,n){return typeof n==`string`?(e.unsetenv(n),!0):!1},has(t,n){return typeof n==`string`?e.getenv(n)!==null:!1},ownKeys(t){return e.listenv()},getOwnPropertyDescriptor(t,n){if(typeof n!=`string`)return;let r=e.getenv(n);if(r!==null)return{configurable:!0,enumerable:!0,writable:!0,value:r}}})}catch{}return{}}function m(){if(globalThis.process?.argv!==void 0)return globalThis.process.argv;try{let e=a().imports?.system;if(e?.programArgs)return[`gjs`,e.programInvocationName||``,...e.programArgs]}catch{}return[`gjs`]}function h(){if(typeof globalThis.process?.execPath==`string`)return globalThis.process.execPath;try{let e=a().imports?.system;if(e?.programInvocationName)return e.programInvocationName}catch{}return`/usr/bin/gjs`}function g(){if(typeof globalThis.process?.pid==`number`)return globalThis.process.pid;try{let e=a().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/stat`);if(t){let e=new TextDecoder().decode(t),n=parseInt(e,10);if(!isNaN(n))return n}}}catch{}return 0}const _=Date.now();function v(){let e=globalThis.imports?.gi;if(!e)return null;let t=null;try{t=e.GioUnix}catch{}if(!t)try{t=e.Gio}catch{}return t}var y=class extends e{fd;writable=!0;_outGio=null;constructor(e){super(),this.fd=e;let t=v();if(t){let e=t.UnixOutputStream??t.OutputStream;if(e)try{this._outGio=e.new(this.fd,!1)}catch{}}}write(e){if(this._outGio)try{let t=typeof e==`string`?i.encode(e):e;return this._outGio.write_all(t,null),!0}catch{}return this.fd===2?console.error(e):console.log(e),!0}get isTTY(){if(r)return r.Terminal.is_tty(this.fd);try{let e=a().imports?.gi?.GLib;if(e)return!!e.log_writer_supports_color(this.fd)}catch{}return!1}get columns(){if(r){let[e,,t]=r.Terminal.get_size(this.fd);if(e&&t>0)return t}try{let e=a().imports?.gi?.GLib;if(e){let t=parseInt(e.getenv(`COLUMNS`)??`0`,10);if(t>0)return t}}catch{}return 80}end(){}destroy(){}get rows(){if(r){let[e,t]=r.Terminal.get_size(this.fd);if(e&&t>0)return t}try{let e=a().imports?.gi?.GLib;if(e){let t=parseInt(e.getenv(`LINES`)??`0`,10);if(t>0)return t}}catch{}return 24}},b=class extends e{fd;isRaw=!1;_gio=null;_stdinGio=null;_reading=!1;_flowing=!1;_sttyCleanupRegistered=!1;_mainLoopHeld=!1;_pendingRead=!1;constructor(e){super(),this.fd=e,this._gio=v()}get isTTY(){return r?r.Terminal.is_tty(this.fd):!1}setRawMode(e){return r&&r.Terminal.set_raw_mode(this.fd,e)?(this.isRaw=e,this):(this._setRawModeViaStty(e),this.isRaw=e,this)}_setRawModeViaStty(e){try{let t=globalThis.imports?.gi,n=t?.Gio??t?.Gio;if(!n)return;let r=n.SubprocessFlags?.STDIN_INHERIT??2,i=e?[`stty`,`-icanon`,`-echo`,`-icrnl`,`min`,`1`,`time`,`0`]:[`stty`,`icanon`,`echo`,`icrnl`];if(new n.SubprocessLauncher({flags:r}).spawnv(i).wait(null),e&&!this._sttyCleanupRegistered){this._sttyCleanupRegistered=!0;let e=globalThis.process;e?.once&&typeof e.once==`function`&&e.once(`exit`,()=>this._setRawModeViaStty(!1))}}catch{}}setEncoding(e){return this}resume(){return this._flowing=!0,this._gio&&this.fd===0&&!this._reading&&this._startReading(),this}pause(){if(this._flowing=!1,this._reading=!1,this._mainLoopHeld){this._mainLoopHeld=!1;let e=globalThis.imports?.gi,t=e?.GLib??e?.GLib;t?.idle_add?t.idle_add(300,()=>(this._mainLoopHeld||n(),!1)):n()}return this}read(){return null}_startReading(){if(!this._gio||this._reading)return;if(this._pendingRead){this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,t());return}if(this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,t()),!this._stdinGio){let e=this._gio.UnixInputStream??this._gio.InputStream;if(!e){this._reading=!1;return}try{this._stdinGio=e.new(this.fd,!1)}catch{this._reading=!1;return}}let e=()=>{if(!this._reading){this._pendingRead=!1;return}this._pendingRead=!0,this._stdinGio.read_bytes_async(4096,0,null,(t,n)=>{this._pendingRead=!1;try{let e=t.read_bytes_finish(n)?.get_data?.()??null;if(e&&e.byteLength>0)this.emit(`data`,Buffer.from(e));else if(e!==null&&e.byteLength===0){this._reading=!1,this.emit(`end`);return}}catch{this._reading=!1;return}this._reading&&e()})};e()}};function x(){try{let e=a().imports?.gi?.GLib;if(e?.get_monotonic_time)return BigInt(e.get_monotonic_time())*1000n}catch{}return typeof performance?.now==`function`?BigInt(Math.round(performance.now()*1e6)):BigInt(Date.now())*1000000n}const S=x();var C=class extends e{platform;arch;env;argv;argv0;execPath;pid;ppid;version;versions;title;execArgv;config;exitCode;constructor(){super(),this.platform=u(),this.arch=d(),this.env=p(),this.argv=m(),this.argv0=this.argv[0]||`gjs`,this.execPath=h(),this.execArgv=globalThis.process?.execArgv??[],this.config=globalThis.process?.config??{target_defaults:{},variables:{}},this.pid=g(),this.ppid=l();let e=c();this.version=e.version,this.versions=e.versions,this.title=e.title}cwd(){return f()}chdir(e){try{let t=a().imports?.gi?.GLib;if(t?.chdir){if(!t.file_test(e,16)){let t=Error(`ENOENT: no such file or directory, chdir '${e}'`);throw t.code=`ENOENT`,t.syscall=`chdir`,t.path=e,t}t.chdir(e);return}}catch(e){if(e&&typeof e==`object`&&e.code===`ENOENT`)throw e}let t=globalThis.process;if(t&&t!==this&&typeof t.chdir==`function`){t.chdir(e);return}throw Error(`process.chdir() is not supported in this environment`)}kill(e,t){let n=globalThis.process;if(n&&n!==this&&typeof n.kill==`function`)return n.kill(e,t);try{let n=a().imports?.gi?.GLib;if(n){let r=typeof t==`number`?String(t):t||`SIGTERM`,i=r.startsWith(`SIG`)?`-${r.slice(3)}`:`-${r}`;return n.spawn_command_line_sync(`kill ${i} ${e}`),!0}}catch{}throw Error(`process.kill() is not supported in this environment`)}exit(e){this.exitCode=e??this.exitCode??0,this.emit(`exit`,this.exitCode);let r=a().imports,i=r?.gi?.GLib,o=r?.system,s=i?.idle_add,c=i?.SOURCE_REMOVE,l=i?.PRIORITY_DEFAULT;if(o?.exit&&s&&typeof l==`number`&&typeof c==`boolean`){let e=this.exitCode;return t(),s(l,()=>(n(),o.exit(e),c)),new Promise(()=>{})}try{o?.exit&&o.exit(this.exitCode)}catch{}let u=globalThis.process;throw u&&u!==this&&typeof u.exit==`function`&&u.exit(this.exitCode),Error(`process.exit(${this.exitCode})`)}nextTick(e,...t){typeof queueMicrotask==`function`?queueMicrotask(()=>e(...t)):Promise.resolve().then(()=>e(...t))}hrtime(e){let t=x()-S,n=Number(t/1000000000n),r=Number(t%1000000000n);if(e){let t=n-e[0],i=r-e[1];return i<0&&(t--,i+=1e9),[t,i]}return[n,r]}uptime(){return(Date.now()-_)/1e3}memoryUsage(){try{let e=a().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/status`);if(t){let e=new TextDecoder().decode(t).match(/VmRSS:\s+(\d+)/),n=e?parseInt(e[1],10)*1024:0;return{rss:n,heapTotal:n,heapUsed:n,external:0,arrayBuffers:0}}}}catch{}let e=globalThis.process;return e&&e!==this&&typeof e.memoryUsage==`function`?e.memoryUsage():{rss:0,heapTotal:0,heapUsed:0,external:0,arrayBuffers:0}}cpuUsage(e){let t=globalThis.process;return t&&t!==this&&typeof t.cpuUsage==`function`?t.cpuUsage(e):{user:0,system:0}}stdout=new y(1);stderr=new y(2);stdin=new b(0);abort(){this.exit(1)}umask(e){return 18}emitWarning(e,t){console.warn(typeof e==`string`?`(${t||`Warning`}): ${e}`:e.message)}};C.prototype.hrtime.bigint=function(){return x()-S};const w=new C;if(r)try{let e=new r.ResizeWatcher;e.connect(`resized`,(e,t,n)=>{w.stdout.emit(`resize`),w.stderr.emit(`resize`)}),e.start()}catch{}const T=w.platform,E=w.arch,D=w.env,O=w.argv,k=w.argv0,A=w.execPath,j=w.pid,M=w.ppid,N=w.version,P=w.versions,F=w.cwd.bind(w),I=w.chdir.bind(w),L=w.exit.bind(w),R=w.nextTick.bind(w),z=w.hrtime.bind(w),B=w.uptime.bind(w),V=w.memoryUsage.bind(w),H=w.cpuUsage.bind(w),U=w.kill.bind(w),W=w.abort.bind(w),G=w.umask.bind(w),K=w.emitWarning.bind(w),q=w.execArgv,J=w.config,Y=w.stdout,X=w.stderr,Z=w.stdin;export{W as abort,E as arch,O as argv,k as argv0,I as chdir,J as config,H as cpuUsage,F as cwd,w as default,K as emitWarning,D as env,q as execArgv,A as execPath,L as exit,z as hrtime,U as kill,V as memoryUsage,R as nextTick,j as pid,T as platform,M as ppid,X as stderr,Z as stdin,Y as stdout,G as umask,B as uptime,N as version,P as versions};
1
+ import{EventEmitter as e}from"@gjsify/events";import{ensureMainLoop as t,quitMainLoop as n}from"@gjsify/utils";import{nativeTerminal as r}from"@gjsify/terminal-native";const i=new TextEncoder;function getGjsGlobal(){return globalThis}function detectGjsVersion(){try{let e=getGjsGlobal().imports?.system;if(e?.version!==void 0){let t=Number(e.version);return`${Math.floor(t/1e4)}.${Math.floor(t%1e4/100)}.${t%100}`}}catch{}}function detectNodeVersion(){if(typeof globalThis.process?.versions?.node==`string`)return globalThis.process.versions.node}function detectVersionInfo(){if(detectNodeVersion())return{version:globalThis.process.version,versions:{...globalThis.process.versions},title:globalThis.process?.title||`node`};let e=detectGjsVersion(),t={node:`20.0.0`};return e&&(t.gjs=e),{version:`v20.0.0`,versions:t,title:`gjs`}}function detectPpid(){if(typeof globalThis.process?.ppid==`number`)return globalThis.process.ppid;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/status`);if(t){let e=new TextDecoder().decode(t).match(/PPid:\s+(\d+)/);if(e)return parseInt(e[1],10)}}}catch{}return 0}function detectPlatform(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e&&e.get_os_info(`ID`))return`linux`}catch{}return getGjsGlobal().imports?.system===void 0&&typeof globalThis.process?.platform==`string`?globalThis.process.platform:`linux`}function detectArch(){return typeof globalThis.process?.arch==`string`?globalThis.process.arch:`x64`}function getCwd(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e?.get_current_dir)return e.get_current_dir()}catch{}return`/`}function getEnvProxy(){if(typeof globalThis.process?.env==`object`)return globalThis.process.env;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e)return new Proxy({},{get(t,n){if(typeof n==`string`)return e.getenv(n)??void 0},set(t,n,r){return typeof n==`string`?(e.setenv(n,String(r),!0),!0):!1},deleteProperty(t,n){return typeof n==`string`?(e.unsetenv(n),!0):!1},has(t,n){return typeof n==`string`?e.getenv(n)!==null:!1},ownKeys(t){return e.listenv()},getOwnPropertyDescriptor(t,n){if(typeof n!=`string`)return;let r=e.getenv(n);if(r!==null)return{configurable:!0,enumerable:!0,writable:!0,value:r}}})}catch{}return{}}function getArgv(){if(globalThis.process?.argv!==void 0)return globalThis.process.argv;try{let e=getGjsGlobal().imports?.system;if(e?.programArgs)return[`gjs`,e.programInvocationName||``,...e.programArgs]}catch{}return[`gjs`]}function getExecPath(){if(typeof globalThis.process?.execPath==`string`)return globalThis.process.execPath;try{let e=getGjsGlobal().imports?.system;if(e?.programInvocationName)return e.programInvocationName}catch{}return`/usr/bin/gjs`}function getPid(){if(typeof globalThis.process?.pid==`number`)return globalThis.process.pid;try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/stat`);if(t){let e=new TextDecoder().decode(t),n=parseInt(e,10);if(!isNaN(n))return n}}}catch{}return 0}const a=Date.now();function getGioNamespace(){let e=globalThis.imports?.gi;if(!e)return null;let t=null;try{t=e.GioUnix}catch{}if(!t)try{t=e.Gio}catch{}return t}var ProcessWriteStream=class extends e{fd;writable=!0;_outGio=null;constructor(e){super(),this.fd=e;let t=getGioNamespace();if(t){let e=t.UnixOutputStream??t.OutputStream;if(e)try{this._outGio=e.new(this.fd,!1)}catch{}}}write(e){if(this._outGio)try{let t=typeof e==`string`?i.encode(e):e;return this._outGio.write_all(t,null),!0}catch{}return this.fd===2?console.error(e):console.log(e),!0}get isTTY(){if(r)return r.Terminal.is_tty(this.fd);try{let e=getGjsGlobal().imports?.gi?.GLib;if(e)return!!e.log_writer_supports_color(this.fd)}catch{}return!1}get columns(){if(r){let[e,,t]=r.Terminal.get_size(this.fd);if(e&&t>0)return t}try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let t=parseInt(e.getenv(`COLUMNS`)??`0`,10);if(t>0)return t}}catch{}return 80}end(){}destroy(){}get rows(){if(r){let[e,t]=r.Terminal.get_size(this.fd);if(e&&t>0)return t}try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let t=parseInt(e.getenv(`LINES`)??`0`,10);if(t>0)return t}}catch{}return 24}},ProcessReadStream=class extends e{fd;isRaw=!1;_gio=null;_stdinGio=null;_reading=!1;_flowing=!1;_sttyCleanupRegistered=!1;_mainLoopHeld=!1;_pendingRead=!1;constructor(e){super(),this.fd=e,this._gio=getGioNamespace()}get isTTY(){return r?r.Terminal.is_tty(this.fd):!1}setRawMode(e){return r&&r.Terminal.set_raw_mode(this.fd,e)?(this.isRaw=e,this):(this._setRawModeViaStty(e),this.isRaw=e,this)}_setRawModeViaStty(e){try{let t=globalThis.imports?.gi,n=t?.Gio??t?.Gio;if(!n)return;let r=n.SubprocessFlags?.STDIN_INHERIT??2,i=e?[`stty`,`-icanon`,`-echo`,`-icrnl`,`min`,`1`,`time`,`0`]:[`stty`,`icanon`,`echo`,`icrnl`];if(new n.SubprocessLauncher({flags:r}).spawnv(i).wait(null),e&&!this._sttyCleanupRegistered){this._sttyCleanupRegistered=!0;let e=globalThis.process;e?.once&&typeof e.once==`function`&&e.once(`exit`,()=>this._setRawModeViaStty(!1))}}catch{}}setEncoding(e){return this}resume(){return this._flowing=!0,this._gio&&this.fd===0&&!this._reading&&this._startReading(),this}pause(){if(this._flowing=!1,this._reading=!1,this._mainLoopHeld){this._mainLoopHeld=!1;let e=globalThis.imports?.gi,t=e?.GLib??e?.GLib;t?.idle_add?t.idle_add(300,()=>(this._mainLoopHeld||n(),!1)):n()}return this}read(){return null}_startReading(){if(!this._gio||this._reading)return;if(this._pendingRead){this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,t());return}if(this._reading=!0,this._mainLoopHeld||(this._mainLoopHeld=!0,t()),!this._stdinGio){let e=this._gio.UnixInputStream??this._gio.InputStream;if(!e){this._reading=!1;return}try{this._stdinGio=e.new(this.fd,!1)}catch{this._reading=!1;return}}let loop=()=>{if(!this._reading){this._pendingRead=!1;return}this._pendingRead=!0,this._stdinGio.read_bytes_async(4096,0,null,(e,t)=>{this._pendingRead=!1;try{let n=e.read_bytes_finish(t)?.get_data?.()??null;if(n&&n.byteLength>0)this.emit(`data`,Buffer.from(n));else if(n!==null&&n.byteLength===0){this._reading=!1,this.emit(`end`);return}}catch{this._reading=!1;return}this._reading&&loop()})};loop()}};function getMonotonicTime(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e?.get_monotonic_time)return BigInt(e.get_monotonic_time())*1000n}catch{}return typeof performance?.now==`function`?BigInt(Math.round(performance.now()*1e6)):BigInt(Date.now())*1000000n}const o=getMonotonicTime();var Process=class extends e{platform;arch;env;argv;argv0;execPath;pid;ppid;version;versions;title;execArgv;config;exitCode;constructor(){super(),this.platform=detectPlatform(),this.arch=detectArch(),this.env=getEnvProxy(),this.argv=getArgv(),this.argv0=this.argv[0]||`gjs`,this.execPath=getExecPath(),this.execArgv=globalThis.process?.execArgv??[],this.config=globalThis.process?.config??{target_defaults:{},variables:{}},this.pid=getPid(),this.ppid=detectPpid();let e=detectVersionInfo();this.version=e.version,this.versions=e.versions,this.title=e.title}cwd(){return getCwd()}chdir(e){try{let t=getGjsGlobal().imports?.gi?.GLib;if(t?.chdir){if(!t.file_test(e,16)){let t=Error(`ENOENT: no such file or directory, chdir '${e}'`);throw t.code=`ENOENT`,t.syscall=`chdir`,t.path=e,t}t.chdir(e);return}}catch(e){if(e&&typeof e==`object`&&e.code===`ENOENT`)throw e}let t=globalThis.process;if(t&&t!==this&&typeof t.chdir==`function`){t.chdir(e);return}throw Error(`process.chdir() is not supported in this environment`)}kill(e,t){let n=globalThis.process;if(n&&n!==this&&typeof n.kill==`function`)return n.kill(e,t);try{let n=getGjsGlobal().imports?.gi?.GLib;if(n){let r=typeof t==`number`?String(t):t||`SIGTERM`,i=r.startsWith(`SIG`)?`-${r.slice(3)}`:`-${r}`;return n.spawn_command_line_sync(`kill ${i} ${e}`),!0}}catch{}throw Error(`process.kill() is not supported in this environment`)}exit(e){this.exitCode=e??this.exitCode??0,this.emit(`exit`,this.exitCode);let r=getGjsGlobal().imports,i=r?.gi?.GLib,a=r?.system,o=i?.idle_add,s=i?.SOURCE_REMOVE,c=i?.PRIORITY_DEFAULT;if(a?.exit&&o&&typeof c==`number`&&typeof s==`boolean`){let e=this.exitCode;return t(),o(c,()=>(n(),a.exit(e),s)),new Promise(()=>{})}try{a?.exit&&a.exit(this.exitCode)}catch{}let l=globalThis.process;throw l&&l!==this&&typeof l.exit==`function`&&l.exit(this.exitCode),Error(`process.exit(${this.exitCode})`)}nextTick(e,...t){typeof queueMicrotask==`function`?queueMicrotask(()=>e(...t)):Promise.resolve().then(()=>e(...t))}hrtime(e){let t=getMonotonicTime()-o,n=Number(t/1000000000n),r=Number(t%1000000000n);if(e){let t=n-e[0],i=r-e[1];return i<0&&(t--,i+=1e9),[t,i]}return[n,r]}uptime(){return(Date.now()-a)/1e3}memoryUsage(){try{let e=getGjsGlobal().imports?.gi?.GLib;if(e){let[,t]=e.file_get_contents(`/proc/self/status`);if(t){let e=new TextDecoder().decode(t).match(/VmRSS:\s+(\d+)/),n=e?parseInt(e[1],10)*1024:0;return{rss:n,heapTotal:n,heapUsed:n,external:0,arrayBuffers:0}}}}catch{}let e=globalThis.process;return e&&e!==this&&typeof e.memoryUsage==`function`?e.memoryUsage():{rss:0,heapTotal:0,heapUsed:0,external:0,arrayBuffers:0}}cpuUsage(e){let t=globalThis.process;return t&&t!==this&&typeof t.cpuUsage==`function`?t.cpuUsage(e):{user:0,system:0}}stdout=new ProcessWriteStream(1);stderr=new ProcessWriteStream(2);stdin=new ProcessReadStream(0);abort(){this.exit(1)}umask(e){return 18}emitWarning(e,t){console.warn(typeof e==`string`?`(${t||`Warning`}): ${e}`:e.message)}};Process.prototype.hrtime.bigint=function(){return getMonotonicTime()-o};const s=new Process;if(r)try{let e=new r.ResizeWatcher;e.connect(`resized`,(e,t,n)=>{s.stdout.emit(`resize`),s.stderr.emit(`resize`)}),e.start()}catch{}const c=s.platform,l=s.arch,u=s.env,d=s.argv,f=s.argv0,p=s.execPath,m=s.pid,h=s.ppid,g=s.version,_=s.versions,v=s.cwd.bind(s),y=s.chdir.bind(s),b=s.exit.bind(s),x=s.nextTick.bind(s),S=s.hrtime.bind(s),C=s.uptime.bind(s),w=s.memoryUsage.bind(s),T=s.cpuUsage.bind(s),E=s.kill.bind(s),D=s.abort.bind(s),O=s.umask.bind(s),k=s.emitWarning.bind(s),A=s.execArgv,j=s.config,M=s.stdout,N=s.stderr,P=s.stdin;export{D as abort,l as arch,d as argv,f as argv0,y as chdir,j as config,T as cpuUsage,v as cwd,s as default,k as emitWarning,u as env,A as execArgv,p as execPath,b as exit,S as hrtime,E as kill,w as memoryUsage,x as nextTick,m as pid,c as platform,h as ppid,N as stderr,P as stdin,M as stdout,O as umask,C as uptime,g as version,_ as versions};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/process",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
4
4
  "description": "Node.js process module for Gjs",
5
5
  "module": "lib/esm/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -30,13 +30,13 @@
30
30
  "process"
31
31
  ],
32
32
  "dependencies": {
33
- "@gjsify/events": "^0.3.20",
34
- "@gjsify/terminal-native": "^0.3.20",
35
- "@gjsify/utils": "^0.3.20"
33
+ "@gjsify/events": "^0.3.21",
34
+ "@gjsify/terminal-native": "^0.3.21",
35
+ "@gjsify/utils": "^0.3.21"
36
36
  },
37
37
  "devDependencies": {
38
- "@gjsify/cli": "^0.3.20",
39
- "@gjsify/unit": "^0.3.20",
38
+ "@gjsify/cli": "^0.3.21",
39
+ "@gjsify/unit": "^0.3.21",
40
40
  "@types/node": "^25.6.2",
41
41
  "typescript": "^6.0.3"
42
42
  }