-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNwJsOs.sbi
More file actions
220 lines (195 loc) · 6.36 KB
/
NwJsOs.sbi
File metadata and controls
220 lines (195 loc) · 6.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
EnableExplicit
XIncludeFile "NwJsCommon.sbi"
DeclareModule NwJsOs
EnableExplicit
Declare.s EOL()
Declare.s Arch()
Declare Constants()
Declare Cpus()
Declare.s Endianness()
Declare Freemem()
Declare.s Homedir()
Declare.s Hostname()
Declare LoadAvg()
Declare NetworkInterfaces()
Declare.s Platform()
Declare.s Release()
Declare.s Tmpdir()
Declare Totalmem()
Declare.s Type()
Declare Uptime()
Declare UserInfo(Options = #PB_Ignore)
EndDeclareModule
Module NwJsOs
EnableExplicit
Procedure.s EOL()
; https://nodejs.org/api/os.html#os_os_eol
; A string constant defining the operating system-specific end-of-line marker:
! try {
! var os = nw.require('os');
! return os.EOL;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure.s Arch()
; https://nodejs.org/api/os.html#os_os_arch
; The os.arch() method returns a string identifying the operating system CPU architecture for which the Node.js binary was compiled.
! try {
! var os = nw.require('os');
! return os.arch;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure Constants()
; https://nodejs.org/api/os.html#os_os_constants
; Returns an object containing commonly used operating system specific constants for error codes, process signals, and so on.
! try {
! var os = nw.require('os');
! return os.constants;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure Cpus()
; https://nodejs.org/api/os.html#os_os_cpus
; The os.cpus() method returns an array of objects containing information about each logical CPU core.
! try {
! var os = nw.require('os');
! return os.cpus();
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure.s Endianness()
; https://nodejs.org/api/os.html#os_os_endianness
; The os.endianness() method returns a string identifying the endianness of the CPU for which the Node.js binary was compiled.
! try {
! var os = nw.require('os');
! return os.endianness;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure Freemem()
; https://nodejs.org/api/os.html#os_os_freemem
; The os.freemem() method returns the amount of free system memory in bytes as an integer.
! try {
! var os = nw.require('os');
! return os.freemem;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure.s Homedir()
; https://nodejs.org/api/os.html#os_os_homedir
; The os.homedir() method returns the home directory of the current user as a string.
! try {
! var os = nw.require('os');
! return os.homedir;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure.s Hostname()
; https://nodejs.org/api/os.html#os_os_hostname
; The os.hostname() method returns the hostname of the operating system as a string.
! try {
! var os = nw.require('os');
! return os.hostname;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure LoadAvg()
; https://nodejs.org/api/os.html#os_os_loadavg
; The os.loadavg() method returns an array containing the 1, 5, and 15 minute load averages.
! try {
! var os = nw.require('os');
! return os.loadavg();
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure NetworkInterfaces()
; https://nodejs.org/api/os.html#os_os_networkinterfaces
; The os.networkInterfaces() method returns an object containing only network interfaces that have been assigned a network address.
! try {
! var os = nw.require('os');
! return os.networkInterfaces();
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure.s Platform()
; https://nodejs.org/api/os.html#os_os_platform
; The os.platform() method returns a string identifying the operating system platform as set during compile time of Node.js.
! try {
! var os = nw.require('os');
! return os.platform;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure.s Release()
; https://nodejs.org/api/os.html#os_os_release
; The os.release() method returns a string identifying the operating system release.
! try {
! var os = nw.require('os');
! return os.release;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure.s Tmpdir()
; https://nodejs.org/api/os.html#os_os_tmpdir
; The os.tmpdir() method returns a string specifying the operating system's default directory for temporary files.
! try {
! var os = nw.require('os');
! return os.tmpdir;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure Totalmem()
; https://nodejs.org/api/os.html#os_os_totalmem
; The os.totalmem() method returns the total amount of system memory in bytes as an integer.
! try {
! var os = nw.require('os');
! return os.totalmem;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure.s Type()
; https://nodejs.org/api/os.html#os_os_type
; The os.type() method returns a string identifying the operating system name as returned by uname(3). For example 'Linux' on Linux, 'Darwin' on macOS and 'Windows_NT' on Windows.
! try {
! var os = nw.require('os');
! return os.type;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure Uptime()
; https://nodejs.org/api/os.html#os_os_uptime
; The os.uptime() method returns the system uptime in number of seconds.
! try {
! var os = nw.require('os');
! return os.uptime;
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
Procedure UserInfo(Options = #PB_Ignore)
; https://nodejs.org/api/os.html#os_os_userinfo_options
; The os.userInfo() method returns information about the currently effective user
! try {
! var os = nw.require('os');
! return os.userInfo();
! } catch (err) {
! spider.debug.Print(err.message);
! }
EndProcedure
EndModule