Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a770a35

Browse filesBrowse files
committed
src: make InitializeNodeWithArgs() official public API
This is a decent replacement for the to-be-deprecated Init() API. Backport-PR-URL: #35241 PR-URL: #30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 8005e63 commit a770a35
Copy full SHA for a770a35

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,20 @@ NODE_EXTERN int Stop(Environment* env);
223223

224224
// TODO(addaleax): Officially deprecate this and replace it with something
225225
// better suited for a public embedder API.
226+
// It is recommended to use InitializeNodeWithArgs() instead as an embedder.
227+
// Init() calls InitializeNodeWithArgs() and exits the process with the exit
228+
// code returned from it.
226229
NODE_EXTERN void Init(int* argc,
227230
const char** argv,
228231
int* exec_argc,
229232
const char*** exec_argv);
233+
// Set up per-process state needed to run Node.js. This will consume arguments
234+
// from argv, fill exec_argv, and possibly add errors resulting from parsing
235+
// the arguments to `errors`. The return value is a suggested exit code for the
236+
// program; If it is 0, then initializing Node.js succeeded.
237+
NODE_EXTERN int InitializeNodeWithArgs(std::vector<std::string>* argv,
238+
std::vector<std::string>* exec_argv,
239+
std::vector<std::string>* errors);
230240

231241
enum OptionEnvvarSettings {
232242
kAllowedInEnvironment,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.