lune 0.2.0

A Luau script runner
Documentation
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
{
  "@roblox/global/console": {
    "code_sample": "",
    "documentation": "Logging & formatting",
    "keys": {
      "console": "@roblox/global/console.console"
    },
    "learn_more_link": ""
  },
  "@roblox/global/console.error": {
    "code_sample": "",
    "documentation": "Prints arguments as a human-readable string with syntax highlighting for tables to stderr.\n\nThis will also prepend an [ERROR] tag at the beginning of the message.\n\nUsing this function will automatically set the exit code of the process\nto 1, unless it gets manually specified afterwards using `process.exit`.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/console.error/param/0",
        "name": "..."
      }
    ],
    "returns": []
  },
  "@roblox/global/console.error/param/0": {
    "documentation": "The values to print out to stderr"
  },
  "@roblox/global/console.format": {
    "code_sample": "",
    "documentation": "Formats arguments into a human-readable string with syntax highlighting for tables.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/console.format/param/0",
        "name": "..."
      }
    ],
    "returns": [
      "@roblox/global/console.format/return/0"
    ]
  },
  "@roblox/global/console.format/param/0": {
    "documentation": "The values to format"
  },
  "@roblox/global/console.format/return/0": {
    "documentation": "The formatted string"
  },
  "@roblox/global/console.info": {
    "code_sample": "",
    "documentation": "Prints arguments as a human-readable string with syntax highlighting for tables to stdout.\n\nThis will also prepend an [INFO] tag at the beginning of the message.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/console.info/param/0",
        "name": "..."
      }
    ],
    "returns": []
  },
  "@roblox/global/console.info/param/0": {
    "documentation": "The values to print out"
  },
  "@roblox/global/console.log": {
    "code_sample": "",
    "documentation": "Prints arguments as a human-readable string with syntax highlighting for tables to stdout.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/console.log/param/0",
        "name": "..."
      }
    ],
    "returns": []
  },
  "@roblox/global/console.log/param/0": {
    "documentation": "The values to print out"
  },
  "@roblox/global/console.resetColor": {
    "code_sample": "",
    "documentation": "Resets the current persistent output color.",
    "learn_more_link": "",
    "params": [],
    "returns": []
  },
  "@roblox/global/console.resetStyle": {
    "code_sample": "",
    "documentation": "Resets the current persistent output style.",
    "learn_more_link": "",
    "params": [],
    "returns": []
  },
  "@roblox/global/console.setColor": {
    "code_sample": "",
    "documentation": "Sets the current persistent output color.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/console.setColor/param/0",
        "name": "color"
      }
    ],
    "returns": []
  },
  "@roblox/global/console.setColor/param/0": {
    "documentation": "The color to set"
  },
  "@roblox/global/console.setStyle": {
    "code_sample": "",
    "documentation": "Sets the current persistent output style.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/console.setStyle/param/0",
        "name": "style"
      }
    ],
    "returns": []
  },
  "@roblox/global/console.setStyle/param/0": {
    "documentation": "The style to set"
  },
  "@roblox/global/console.warn": {
    "code_sample": "",
    "documentation": "Prints arguments as a human-readable string with syntax highlighting for tables to stdout.\n\nThis will also prepend an [INFO] tag at the beginning of the message.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/console.warn/param/0",
        "name": "..."
      }
    ],
    "returns": []
  },
  "@roblox/global/console.warn/param/0": {
    "documentation": "The values to print out"
  },
  "@roblox/global/fs": {
    "code_sample": "",
    "documentation": "Filesystem",
    "keys": {
      "fs": "@roblox/global/fs.fs"
    },
    "learn_more_link": ""
  },
  "@roblox/global/fs.isDir": {
    "code_sample": "",
    "documentation": "Checks if a given path is a directory.\n\nAn error will be thrown in the following situations:\n\n* The current process lacks permissions to read at `path`.\n* Some other I/O error occurred.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/fs.isDir/param/0",
        "name": "path"
      }
    ],
    "returns": [
      "@roblox/global/fs.isDir/return/0"
    ]
  },
  "@roblox/global/fs.isDir/param/0": {
    "documentation": "The directory path to check"
  },
  "@roblox/global/fs.isDir/return/0": {
    "documentation": "If the path is a directory or not"
  },
  "@roblox/global/fs.isFile": {
    "code_sample": "",
    "documentation": "Checks if a given path is a file.\n\nAn error will be thrown in the following situations:\n\n* The current process lacks permissions to read at `path`.\n* Some other I/O error occurred.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/fs.isFile/param/0",
        "name": "path"
      }
    ],
    "returns": [
      "@roblox/global/fs.isFile/return/0"
    ]
  },
  "@roblox/global/fs.isFile/param/0": {
    "documentation": "The file path to check"
  },
  "@roblox/global/fs.isFile/return/0": {
    "documentation": "If the path is a file or not"
  },
  "@roblox/global/fs.readDir": {
    "code_sample": "",
    "documentation": "Reads entries in a directory at `path`.\n\nAn error will be thrown in the following situations:\n\n* `path` does not point to an existing directory.\n* The current process lacks permissions to read the contents of the directory.\n* Some other I/O error occurred.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/fs.readDir/param/0",
        "name": "path"
      }
    ],
    "returns": [
      "@roblox/global/fs.readDir/return/0"
    ]
  },
  "@roblox/global/fs.readDir/param/0": {
    "documentation": "The directory path to search in"
  },
  "@roblox/global/fs.readDir/return/0": {
    "documentation": "A list of files & directories found"
  },
  "@roblox/global/fs.readFile": {
    "code_sample": "",
    "documentation": "Reads a file at `path`.\n\nAn error will be thrown in the following situations:\n\n* `path` does not point to an existing file.\n* The current process lacks permissions to read the file.\n* The contents of the file cannot be read as a UTF-8 string.\n* Some other I/O error occurred.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/fs.readFile/param/0",
        "name": "path"
      }
    ],
    "returns": [
      "@roblox/global/fs.readFile/return/0"
    ]
  },
  "@roblox/global/fs.readFile/param/0": {
    "documentation": "The path to the file to read"
  },
  "@roblox/global/fs.readFile/return/0": {
    "documentation": "The contents of the file"
  },
  "@roblox/global/fs.removeDir": {
    "code_sample": "",
    "documentation": "Removes a directory and all of its contents.\n\nAn error will be thrown in the following situations:\n\n* `path` is not an existing and empty directory.\n* The current process lacks permissions to remove the directory.\n* Some other I/O error occurred.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/fs.removeDir/param/0",
        "name": "path"
      }
    ],
    "returns": []
  },
  "@roblox/global/fs.removeDir/param/0": {
    "documentation": "The directory to remove"
  },
  "@roblox/global/fs.removeFile": {
    "code_sample": "",
    "documentation": "Removes a file.\n\nAn error will be thrown in the following situations:\n\n* `path` does not point to an existing file.\n* The current process lacks permissions to remove the file.\n* Some other I/O error occurred.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/fs.removeFile/param/0",
        "name": "path"
      }
    ],
    "returns": []
  },
  "@roblox/global/fs.removeFile/param/0": {
    "documentation": "The file to remove"
  },
  "@roblox/global/fs.writeDir": {
    "code_sample": "",
    "documentation": "Creates a directory and its parent directories if they are missing.\n\nAn error will be thrown in the following situations:\n\n* `path` already points to an existing file or directory.\n* The current process lacks permissions to create the directory or its missing parents.\n* Some other I/O error occurred.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/fs.writeDir/param/0",
        "name": "path"
      }
    ],
    "returns": []
  },
  "@roblox/global/fs.writeDir/param/0": {
    "documentation": "The directory to create"
  },
  "@roblox/global/fs.writeFile": {
    "code_sample": "",
    "documentation": "Writes to a file at `path`.\n\nAn error will be thrown in the following situations:\n\n* The file's parent directory does not exist.\n* The current process lacks permissions to write to the file.\n* Some other I/O error occurred.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/fs.writeFile/param/0",
        "name": "path"
      },
      {
        "documentation": "@roblox/global/fs.writeFile/param/1",
        "name": "contents"
      }
    ],
    "returns": []
  },
  "@roblox/global/fs.writeFile/param/0": {
    "documentation": "The path of the file"
  },
  "@roblox/global/fs.writeFile/param/1": {
    "documentation": "The contents of the file"
  },
  "@roblox/global/net": {
    "code_sample": "",
    "documentation": "Networking",
    "keys": {
      "net": "@roblox/global/net.net"
    },
    "learn_more_link": ""
  },
  "@roblox/global/net.jsonDecode": {
    "code_sample": "",
    "documentation": "Decodes the given JSON string into a lua value.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/net.jsonDecode/param/0",
        "name": "encoded"
      }
    ],
    "returns": [
      "@roblox/global/net.jsonDecode/return/0"
    ]
  },
  "@roblox/global/net.jsonDecode/param/0": {
    "documentation": "The JSON string to decode"
  },
  "@roblox/global/net.jsonDecode/return/0": {
    "documentation": "The decoded lua value"
  },
  "@roblox/global/net.jsonEncode": {
    "code_sample": "",
    "documentation": "Encodes the given value as JSON.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/net.jsonEncode/param/0",
        "name": "value"
      },
      {
        "documentation": "@roblox/global/net.jsonEncode/param/1",
        "name": "pretty"
      }
    ],
    "returns": [
      "@roblox/global/net.jsonEncode/return/0"
    ]
  },
  "@roblox/global/net.jsonEncode/param/0": {
    "documentation": "The value to encode as JSON"
  },
  "@roblox/global/net.jsonEncode/param/1": {
    "documentation": "If the encoded JSON string should include newlines and spaces. Defaults to false"
  },
  "@roblox/global/net.jsonEncode/return/0": {
    "documentation": "The encoded JSON string"
  },
  "@roblox/global/net.request": {
    "code_sample": "",
    "documentation": "Sends an HTTP request using the given url and / or parameters, and returns a dictionary that describes the response received.\n\nOnly throws an error if a miscellaneous network or I/O error occurs, never for unsuccessful status codes.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/net.request/param/0",
        "name": "config"
      }
    ],
    "returns": [
      "@roblox/global/net.request/return/0"
    ]
  },
  "@roblox/global/net.request/param/0": {
    "documentation": "The URL or request config to use"
  },
  "@roblox/global/net.request/return/0": {
    "documentation": "A dictionary representing the response for the request"
  },
  "@roblox/global/process": {
    "code_sample": "",
    "documentation": "Current process & child processes",
    "keys": {
      "process": "@roblox/global/process.process"
    },
    "learn_more_link": ""
  },
  "@roblox/global/process.args": {
    "code_sample": "",
    "documentation": "The arguments given when running the Lune script.",
    "learn_more_link": "",
    "params": [],
    "returns": []
  },
  "@roblox/global/process.cwd": {
    "code_sample": "",
    "documentation": "The current working directory in which the Lune script is running.",
    "learn_more_link": "",
    "params": [],
    "returns": []
  },
  "@roblox/global/process.env": {
    "code_sample": "",
    "documentation": "Current environment variables for this process.\n\nSetting a value on this table will set the corresponding environment variable.",
    "learn_more_link": "",
    "params": [],
    "returns": []
  },
  "@roblox/global/process.exit": {
    "code_sample": "",
    "documentation": "Exits the currently running script as soon as possible with the given exit code.\n\nExit code 0 is treated as a successful exit, any other value is treated as an error.\n\nSetting the exit code using this function will override any otherwise automatic exit code.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/process.exit/param/0",
        "name": "code"
      }
    ],
    "returns": []
  },
  "@roblox/global/process.exit/param/0": {
    "documentation": "The exit code to set"
  },
  "@roblox/global/process.spawn": {
    "code_sample": "",
    "documentation": "Spawns a child process that will run the program `program`, and returns a dictionary that describes the final status and ouput of the child process.\n\nThe second argument, `params`, can be passed as a list of string parameters to give to the program.\n\nThe third argument, `options`, can be passed as a dictionary of options to give to the child process.\nThe available options inside of the `options` dictionary are:\n* `cwd` - The current working directory for the process\n* `env` - Extra environment variables to give to the process\n* `shell` - Whether to run in a shell or not - set to `true` to run using the default shell, or a string to run using a specific shell\n* `stdio` - How to treat output and error streams from the child process - set to \"inherit\" to pass output and error streams to the current process",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/process.spawn/param/0",
        "name": "program"
      },
      {
        "documentation": "@roblox/global/process.spawn/param/1",
        "name": "params"
      },
      {
        "documentation": "@roblox/global/process.spawn/param/2",
        "name": "options"
      }
    ],
    "returns": [
      "@roblox/global/process.spawn/return/0"
    ]
  },
  "@roblox/global/process.spawn/param/0": {
    "documentation": "The program to spawn as a child process"
  },
  "@roblox/global/process.spawn/param/1": {
    "documentation": "Additional parameters to pass to the program"
  },
  "@roblox/global/process.spawn/param/2": {
    "documentation": "A dictionary of options for the child process"
  },
  "@roblox/global/process.spawn/return/0": {
    "documentation": "A dictionary representing the result of the child process"
  },
  "@roblox/global/task": {
    "code_sample": "",
    "documentation": "Task scheduler & thread spawning",
    "keys": {
      "task": "@roblox/global/task.task"
    },
    "learn_more_link": ""
  },
  "@roblox/global/task.cancel": {
    "code_sample": "",
    "documentation": "Stops a currently scheduled thread from resuming.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/task.cancel/param/0",
        "name": "thread"
      }
    ],
    "returns": []
  },
  "@roblox/global/task.cancel/param/0": {
    "documentation": "The thread to cancel"
  },
  "@roblox/global/task.defer": {
    "code_sample": "",
    "documentation": "Defers a thread or function to run at the end of the current task queue.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/task.defer/param/0",
        "name": "functionOrThread"
      }
    ],
    "returns": [
      "@roblox/global/task.defer/return/0"
    ]
  },
  "@roblox/global/task.defer/param/0": {
    "documentation": "The function or thread to defer"
  },
  "@roblox/global/task.defer/return/0": {
    "documentation": "The thread that will be deferred"
  },
  "@roblox/global/task.delay": {
    "code_sample": "",
    "documentation": "Delays a thread or function to run after `duration` seconds.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/task.delay/param/0",
        "name": "functionOrThread"
      }
    ],
    "returns": [
      "@roblox/global/task.delay/return/0"
    ]
  },
  "@roblox/global/task.delay/param/0": {
    "documentation": "The function or thread to delay"
  },
  "@roblox/global/task.delay/return/0": {
    "documentation": "The thread that will be delayed"
  },
  "@roblox/global/task.spawn": {
    "code_sample": "",
    "documentation": "Instantly runs a thread or function.\n\nIf the spawned task yields, the thread that spawned the task\nwill resume, letting the spawned task run in the background.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/task.spawn/param/0",
        "name": "functionOrThread"
      }
    ],
    "returns": [
      "@roblox/global/task.spawn/return/0"
    ]
  },
  "@roblox/global/task.spawn/param/0": {
    "documentation": "The function or thread to spawn"
  },
  "@roblox/global/task.spawn/return/0": {
    "documentation": "The thread that was spawned"
  },
  "@roblox/global/task.wait": {
    "code_sample": "",
    "documentation": "Waits for the given duration, with a minimum wait time of 10 milliseconds.",
    "learn_more_link": "",
    "params": [
      {
        "documentation": "@roblox/global/task.wait/param/0",
        "name": "duration"
      }
    ],
    "returns": [
      "@roblox/global/task.wait/return/0"
    ]
  },
  "@roblox/global/task.wait/param/0": {
    "documentation": "The amount of time to wait"
  },
  "@roblox/global/task.wait/return/0": {
    "documentation": "The exact amount of time waited"
  }
}