Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
docs(Capacitor-NodeJS): 馃摑 Improve manual start example
Browse files Browse the repository at this point in the history
  • Loading branch information
hampoelz committed Sep 7, 2023
1 parent 79ec23b commit 83307f6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/02_Capacitor-NodeJS/04_Benutzung/02_ComplexProjects.tex
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ \subsubsection{Complex Projects}

// Starts the Node.js engine.
NodeJS.start();

// Waits for the Node.js process to initialize.
NodeJS.whenReady().then(() => {
// Communicate with the Node.js process.
});
\end{minted}

Manually starting the Node.js runtime provides options to override the \code{nodeDir} configuration or even the path for the main script.
Expand All @@ -260,6 +265,11 @@ \subsubsection{Complex Projects}
NodeJS.start(options);
\end{minted}

\begin{note}[Note]
Due to limitations in the Node.js for Mobile Apps toolkit, restarting the runtime after it has finished is not supported.
\cite{nodejs-mobile:docs}
\end{note}

\newpage

\paragraph{Data storage}
Expand Down

0 comments on commit 83307f6

Please sign in to comment.