[TIMOB-26571] TiAPI: Global process object compatible with Node.js
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-04-15T15:15:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 8.1.0 |
Components | TiAPI |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2018-11-16T16:12:35.000+0000 |
Updated | 2019-06-26T12:43:15.000+0000 |
Description
Node has a top-level global
process
object which we should attempt to emulate to some degree. A large amount of it's API is not particularly relevant to us, but for compatibility reasons we should support/expose it and try to implement as much as we can that makes sense.
https://nodejs.org/api/process.html
Notable are:
- process.arch - equivalent to Ti.Platform.architecture
- process.cwd()
- process.debugPort
- process.hrtime([time])
- process.mainModule
- process.memoryUsage()
- process.nextTick(callback[, ...args])
- process.pid
- process.platform - Probably equivalent to Ti.Platform.name
- process.release
- process.setUncaughtExceptionCaptureCallback(fn)
- process.stderr
- process.stdin
- process.stdout
- process.title
- process.uptime()
- process.version - Equivalent to Ti.version
- process.versions
"setUncaughtExceptionCaptureCallback" could reuse the API for the
Ti.App
event [uncaughtException
](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.App-event-uncaughtException).https://github.com/appcelerator/titanium_mobile/pull/10782
*Closing ticket*, feature verified in SDK version
8.1.0.v20190619134801
and SDK version8.2.0.v20190624144716
. Tested using some of the examples from https://nodejs.org/api/process.html. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10782