1<!doctype html> 2<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-api/differences" data-has-hydrated="false"> 3<head> 4<meta charset="UTF-8"> 5<meta name="generator" content="Docusaurus v2.4.3"> 6<title data-rh="true">Node.js APIs differences | Node.js Mobile</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://nodejs-mobile.github.io/docs/api/differences"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Node.js APIs differences | Node.js Mobile"><meta data-rh="true" name="description" content="We support the majority of Node.js upstream APIs, see the official docs."><meta data-rh="true" property="og:description" content="We support the majority of Node.js upstream APIs, see the official docs."><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://nodejs-mobile.github.io/docs/api/differences"><link data-rh="true" rel="alternate" href="https://nodejs-mobile.github.io/docs/api/differences" hreflang="en"><link data-rh="true" rel="alternate" href="https://nodejs-mobile.github.io/docs/api/differences" hreflang="x-default"><link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="Node.js Mobile RSS Feed"> 7<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Node.js Mobile Atom Feed"><link rel="stylesheet" href="/assets/css/styles.9b424035.css"> 8<link rel="preload" href="/assets/js/runtime~main.254e0ee4.js" as="script"> 9<link rel="preload" href="/assets/js/main.c640297b.js" as="script"> 10</head> 11<body class="navigation-with-keyboard">
12<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script>
12<div id="__docusaurus"> 13<div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/nodejs-mobile-logo.png" alt="Node.js Mobile logo" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/nodejs-mobile-logo.png" alt="Node.js Mobile logo" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate">Node.js Mobile</b></a><a class="navbar__item navbar__link" href="/docs/guide/intro">Guide</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/api/differences">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/nodejs-mobile" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="searchBox_ZlJk"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/docs/api/differences">API Reference</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/api/differences">Node.js APIs differences</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/api/react-native-bridge">React Native bridge</a></li></ul></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">API Reference</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Node.js APIs differences</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Node.js APIs differences</h1></header><p>We support the majority of Node.js upstream APIs, see <a href="https://nodejs.org/dist/v18.17.1/docs/api/" target="_blank" rel="noopener noreferrer">the official docs</a>.</p><p>However, some Node.js APIs were designed with the purpose of running on a server/desktop environment, and on mobile they might not work as intended or are not supported at all.</p><p>This page contains a collection of differences for these APIs when running on a mobile environment or a description of the quirks in their behavior. Please <a href="https://github.com/nodejs-mobile/nodejs-mobile/issues/new/choose" target="_blank" rel="noopener noreferrer">file an issue in the core library repo</a> for APIs that you find missing from the list.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="child-processes">
13Child processes<a href="#child-processes" class="hash-link" aria-label="Direct link to Child processes" title="Direct link to Child processes">â</a></h3><div class="theme-admonition theme-admonition-danger alert alert--danger admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>danger</div><div class="admonitionContent_S0QG"><p>Unsupported</p></div></div><p>The <code>child_process</code> and <code>cluster</code> modules are not available. nodejs-mobile runs in a mobile application process, which is expected to be a single process in the mobile operating systems, so forking the nodejs-mobile process results in errors for most cases. iOS doesn't give permissions to spawn new processes in most cases, as well. These modules are not supported in nodejs-mobile for the reasons presented.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="console">Console<a href="#console" class="hash-link" aria-label="Direct link to Console" title="Direct link to Console">â</a></h3><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Supported, with minor differences</p></div></div><p>The global <code>console</code> instance is typically configured to write to <code>process.stdout</code> and <code>process.stderr</code>. On Android, the <code>process.stderr</code> and <code>process.stdout</code> streams output is sent to <code>/dev/null</code>, but it can be redirected to the application <strong>logcat</strong>. The redirection is done automatically in the <code>nodejs-mobile-cordova</code> and <code>nodejs-mobile-react-native</code> plugins. Instructions on how to achieve this in Android applications running the native nodejs-mobile library can be found in the Android <a href="/docs/guide/guide-android/redirect-to-logcat">Redirect Output Streams to logcat</a> guide.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="debugger">Debugger<a href="#debugger" class="hash-link" aria-label="Direct link to Debugger" title="Direct link to Debugger">â</a></h3><div class="theme-admonition theme-admonition-danger alert alert--danger admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>danger</div><div class="admonitionContent_S0QG"><p>Unsupported</p></div></div><p>The V8 inspector is not available on current nodejs-mobile builds, due to a dependency on the <code>intl</code> module. This means you cannot use (Chrome) DevTools to debug your nodejs-mobile app.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="file-system-module">File system module<a href="#file-system-module" class="hash-link" aria-label="Direct link to File system module" title="Direct link to File system module">â</a></h3><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>Supported, with significant differences</p></div></div><p>The <code>fs</code> module provides wrappers around standard POSIX functions, but these might not be available on the mobile OSes, file systems or work differently in a mobile application process context.</p><p>Functions that can take relative paths apply that relative path to the current working directory where the node process was started in server/desktop environments. On mobile environments, nodejs-mobile is started in the context of an application, for which the current working environment is the root of the filesystem on iOS and Android. This can lead to unexpected behavior for code that assumes the current working directory is set to the directory of the starting Node.js script (which also might not be true in a server/desktop environment).</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="fslink-fslinksync"><code>fs.link()</code>, <code>fs.linkSync()</code>
13<a href="#fslink-fslinksync" class="hash-link" aria-label="Direct link to fslink-fslinksync" title="Direct link to fslink-fslinksync">â</a></h4><p>Android does not support these functions because it does not support hard links.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="internationalization-module">Internationalization module<a href="#internationalization-module" class="hash-link" aria-label="Direct link to Internationalization module" title="Direct link to Internationalization module">â</a></h3><div class="theme-admonition theme-admonition-danger alert alert--danger admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>danger</div><div class="admonitionContent_S0QG"><p>Unsupported</p></div></div><p>The <code>intl</code> (internationalization) module is not available on current nodejs-mobile builds.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="operation-system-module">Operation system module<a href="#operation-system-module" class="hash-link" aria-label="Direct link to Operation system module" title="Direct link to Operation system module">â</a></h3><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>Supported, with significant differences</p></div></div><p>The <code>os</code> module provides operating system-related utility methods. Some of these methods are not fully supported on mobile operating systems or behave differently in the context of an application process.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="oscpus"><code>os.cpus()</code><a href="#oscpus" class="hash-link" aria-label="Direct link to oscpus" title="Direct link to oscpus">â</a></h4><p>On iOS, CPU speed values are always 0, due to lack of permissions to read these values.</p><p>On Android, returns undefined since Android 8.0, due to lack of permissions to read these values. On earlier Android versions the CPU values can be inconsistent, since some devices can turn CPU cores on and off as an energy saving strategy. Properties can be returned as zero for cores that have been turned off while getting them.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="oshomedir"><code>os.homedir()</code><a href="#oshomedir" class="hash-link" aria-label="Direct link to oshomedir" title="Direct link to oshomedir">â</a></h4><p>On Android and iOS there isn't the concept of a user home directory. Android sets this value to <code>/data</code> and iOS sets it to root of the Application's sandboxed path.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="osplatform"><code>os.platform()</code><a href="#osplatform" class="hash-link" aria-label="Direct link to osplatform" title="Direct link to osplatform">â</a></h4><p>Returns the strings <code>'android'</code> or <code>'ios'</code> in nodejs-mobile, depending on the platform.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="ostmpdir"><code>os.tmpdir()</code><a href="#ostmpdir" class="hash-link" aria-label="Direct link to ostmpdir" title="Direct link to ostmpdir">â</a></h4><p>On iOS, returns the application's sandboxed temporary directory, equivalent to getting the <code>NSTemporaryDirectory</code> value, since iOS sets the <code>TMPDIR</code> environment variable for the application to that value.</p><p>The Android OS is an outlier in the sense that it doesn't have the concept of a temporary directory. In the nodejs-mobile-cordova and nodejs-mobile-react-native plugins, the nodejs-mobile runtime returns the application context's <code>CacheDir</code> value, which should have a similar behavior to a temporary directory for most situations (on Android, the files in the cache are kept until the system needs space, so it increases the disk foothold of the Application unless the developer deletes them manually).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="process">
13Process<a href="#process" class="hash-link" aria-label="Direct link to Process" title="Direct link to Process">â</a></h3><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>Supported, with significant differences</p></div></div><p>The global <code>process</code> object provides information about the current process where Node.js is running on, which is the application process for nodejs-mobile.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="processcwd"><code>process.cwd()</code><a href="#processcwd" class="hash-link" aria-label="Direct link to processcwd" title="Direct link to processcwd">â</a></h4><p>The current working directory of the process is the same as the current working directory for the mobile application, which is the root of the operating system on Android and iOS applications, i.e. <code>/</code>.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="processexit"><code>process.exit()</code><a href="#processexit" class="hash-link" aria-label="Direct link to processexit" title="Direct link to processexit">â</a></h4><p>In nodejs-mobile, the process is the application, so running <code>process.exit()</code> terminates the application. This is not allowed in the Apple App Store guidelines for iOS.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="processgetegid-processgeteuid-processgetgid-processgetgroups-processgetuid-processsetegid-processseteuid-processsetgid-processsetgroups-processsetuid"><code>process.getegid()</code>, <code>process.geteuid()</code>, <code>process.getgid()</code>, <code>process.getgroups()</code>, <code>process.getuid()</code>, <code>process.setegid()</code>, <code>process.seteuid()</code>, <code>process.setgid()</code>, <code>process.setgroups()</code>, <code>process.setuid()</code><a href="#processgetegid-processgeteuid-processgetgid-processgetgroups-processgetuid-processsetegid-processseteuid-processsetgid-processsetgroups-processsetuid" class="hash-link" aria-label="Direct link to processgetegid-processgeteuid-processgetgid-processgetgroups-processgetuid-processsetegid-processseteuid-processsetgid-processsetgroups-processsetuid" title="Direct link to processgetegid-processgeteuid-processgetgid-processgetgroups-processgetuid-processsetegid-processseteuid-processsetgid-processsetgroups-processsetuid">â</a></h4><p>These functions are only available on POSIX platforms, so they are unavailable on Android.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="processstderr-processstdout"><code>process.stderr</code>, <code>process.stdout</code><a href="#processstderr-processstdout" class="hash-link" aria-label="Direct link to processstderr-processstdout" title="Direct link to processstderr-processstdout">â</a></h4><p>Read above in the <a href="#console">Console</a> section.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="processstdin"><code>process.stdin</code><a href="#processstdin" class="hash-link" aria-label="Direct link to processstdin" title="Direct link to processstdin">â</a></h4><p>nodejs-mobile is running in the context of a mobile application, so you can expect <code>process.stdin</code> to be <strong>unavailable</strong> unless there is some native code added to pipe to it.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="processplatform"><code>process.platform</code><a href="#processplatform" class="hash-link" aria-label="Direct link to processplatform" title="Direct link to processplatform">â</a></h4><p>Like <code>os.platform()</code>, this is the string <code>'android'</code> or <code>'ios'</code>, depending on the platform.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="processversions"><code>process.versions</code>
13<a href="#processversions" class="hash-link" aria-label="Direct link to processversions" title="Direct link to processversions">â</a></h4><p>The <code>process.versions</code> object is supported, but also includes the <code>'mobile'</code> key, containing the version for the nodejs-mobile core library.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="regexp-unicode-property-names">RegExp Unicode Property Names<a href="#regexp-unicode-property-names" class="hash-link" aria-label="Direct link to RegExp Unicode Property Names" title="Direct link to RegExp Unicode Property Names">â</a></h3><div class="theme-admonition theme-admonition-danger alert alert--danger admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>danger</div><div class="admonitionContent_S0QG"><p>Unsupported</p></div></div><p>Nodejs-mobile is compiled with no internationalization which means that Unicode Property Names are not supported, examples:</p><ul><li><code>\p{Letter}</code></li><li><code>\p{L}</code></li><li><code>\p{ID_Start}</code></li><li><code>\p{ID_Continue}</code></li></ul><p>As an alternative, you can unwrap the characters belonging to property names, like this:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> regenerate </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">require</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">'regenerate'</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> codePoints </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">require</span><span class="token punctuation" style="color:#393A34">(</span><span class="token string" style="color:#e3116c">'@unicode/unicode-13.0.0/Binary_Property/ID_Start/code-points.js'</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> set </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">regenerate</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">codePoints</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token console class-name">console</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">log</span><span class="token punctuation" style="color:#393A34">(</span><span class="token keyword" style="color:#00009f">new</span><span class="token plain"> </span><span class="token class-name">RegExp</span><span class="token punctuation" style="color:#393A34">(</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">[$_</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">set</span><span class="token template-string interpolation punctuation" style="color:#393A34">.</span><span class="token template-string interpolation method function property-access" style="color:#d73a49">toString</span><span class="token template-string interpolation punctuation" style="color:#393A34">(</span><span class="token template-string interpolation punctuation" style="color:#393A34">)</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string string" style="color:#e3116c">]</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N">
13<path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Or do such as a dedicated package, like <a href="https://github.com/staltz/unicode-word-regex" target="_blank" rel="noopener noreferrer">unicode-word-regex</a> does.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="webassembly">WebAssembly<a href="#webassembly" class="hash-link" aria-label="Direct link to WebAssembly" title="Direct link to WebAssembly">â</a></h3><div class="theme-admonition theme-admonition-danger alert alert--danger admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>danger</div><div class="admonitionContent_S0QG"><p>Unsupported</p></div></div><p>On iOS, WASM is unsupported because it requires Just-in-time (JIT) interpretation, which is forbidden by Apple's App Store guidelines.</p><p>On Android, WASM <em>may</em> work.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/nodejs-mobile/nodejs-mobile.github.io/tree/main/docs/api/differences.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--next" href="/docs/api/react-native-bridge"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">React Native bridge</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#child-processes" class="table-of-contents__link toc-highlight">Child processes</a></li><li><a href="#console" class="table-of-contents__link toc-highlight">Console</a></li><li><a href="#debugger" class="table-of-contents__link toc-highlight">Debugger</a></li><li><a href="#file-system-module" class="table-of-contents__link toc-highlight">File system module</a></li><li><a href="#internationalization-module" class="table-of-contents__link toc-highlight">Internationalization module</a></li><li><a href="#operation-system-module" class="table-of-contents__link toc-highlight">Operation system module</a></li><li><a href="#process" class="table-of-contents__link toc-highlight">Process</a></li><li><a href="#regexp-unicode-property-names" class="table-of-contents__link toc-highlight">RegExp Unicode Property Names</a></li><li><a href="#webassembly" class="table-of-contents__link toc-highlight">WebAssembly</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/guide/intro">Guide</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/api/differences">API</a></li></ul></div>
13<div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/nodejs-mobile" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/nodejs-mobile/nodejs-mobile/discussions" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discussions<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://opencollective.com/nodejs-mobile" target="_blank" rel="noopener noreferrer" class="footer__link-item">Open Collective<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/blog">Blog</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Node.js Mobile is NOT endorsed by or affiliated with the Node.js Foundation. 14 15 16 Copyright © 2017â2021 Janea Systems, with contributions by 17 Copyright © 2022â2024 André Staltz.</div></div></div></footer></div>
18<script src="/assets/js/runtime~main.254e0ee4.js"></script>
vendor: 1 bytes, line 18
18
19<script src="/assets/js/main.c640297b.js"></script>
19 20</body> 21</html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.