v2 / vlib / builtin / js / jsfns_node.js.v
31 lines · 25 sloc · 779 bytes · 763f94388b1ceff59c3e68ebda2c9f57197f32a4
Raw
1// Copyright (c) 2019-2024 Alexander Medvednikov. All rights reserved.
2// Use of this source code is governed by an MIT license
3// that can be found in the LICENSE file.
4
5// This file contains JS functions only present in node.js.
6// They have been ported from their TypeScript definitions.
7
8module builtin
9
10pub struct JS.node_process {
11pub:
12 arch string
13 argsv []string
14 env []string
15 platform string
16 version string
17 // TODO: add all properties
18}
19
20// hack to access process properties
21pub fn js_node_process() JS.node_process {
22 #return process
23
24 return JS.node_process{}
25}
26
27fn JS.process.exit(int)
28fn JS.process.stdout.write(string) bool
29fn JS.process.stdout.writeln(string) bool
30fn JS.process.stderr.write(string) bool
31fn JS.process.stderr.writeln(string) bool
32