Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26571] TiAPI: Global process object compatible with Node.js

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-04-15T15:15:18.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.1.0
ComponentsTiAPI
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2018-11-16T16:12:35.000+0000
Updated2019-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

Comments

  1. Hans Knöchel 2018-11-16

    "setUncaughtExceptionCaptureCallback" could reuse the API for the Ti.App event [uncaughtException](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.App-event-uncaughtException).
  2. Christopher Williams 2019-03-27

    https://github.com/appcelerator/titanium_mobile/pull/10782
  3. Samir Mohammed 2019-06-26

    *Closing ticket*, feature verified in SDK version 8.1.0.v20190619134801 and SDK version 8.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

JSON Source