[TIMOB-26670] TiAPI: Create Node-compatible util module API
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-03-07T21:04:22.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-12-19T19:42:31.000+0000 |
| Updated | 2019-06-13T14:03:27.000+0000 |
Description
It'd be useful to create equivalents of some of the core Node modules in Titanium so that users could port/re-use node codebases on mobile devices. Some of the more common modules could map relatively easily to devices, and would be worth investigating.
https://nodejs.org/api/util.html
https://github.com/appcelerator/titanium_mobile/pull/10718
*Closing ticket*, featured verified in SDK version
8.2.0.v20190612155743,8.1.0.v20190612160220. Tested using examples from https://nodejs.org/api/util.html e.g.Test and other information can be found at (Including unit tests): https://github.com/appcelerator/titanium_mobile/pull/10718const util = require('util'); async function fn() { return 'hello world'; } const callbackFunction = util.callbackify(fn); callbackFunction((err, ret) => { if (err) throw err; console.log(ret); });