MISC: Support JSX, TS, TSX script files (#1216)

This commit is contained in:
catloversg
2024-07-15 04:47:10 +07:00
committed by GitHub
parent 783120c886
commit 864613c616
38 changed files with 895 additions and 201 deletions

View File

@@ -28,7 +28,7 @@ Data in the specified text file.
RAM cost: 0 GB
This function is used to read data from a text file (.txt) or script (.js or .script).
This function is used to read data from a text file (.txt, .json) or script (.js, .jsx, .ts, .tsx, .script).
This function will return the data in the specified file. If the file does not exist, an empty string will be returned.

View File

@@ -30,7 +30,7 @@ True if the data was successfully retrieved from the URL, false otherwise.
RAM cost: 0 GB
Retrieves data from a URL and downloads it to a file on the specified server. The data can only be downloaded to a script (.js or .script) or a text file (.txt). If the file already exists, it will be overwritten by this command. Note that it will not be possible to download data from many websites because they do not allow cross-origin resource sharing (CORS).
Retrieves data from a URL and downloads it to a file on the specified server. The data can only be downloaded to a script (.js, .jsx, .ts, .tsx, .script) or a text file (.txt, .json). If the file already exists, it will be overwritten by this command. Note that it will not be possible to download data from many websites because they do not allow cross-origin resource sharing (CORS).
IMPORTANT: This is an asynchronous function that returns a Promise. The Promises resolved value will be a boolean indicating whether or not the data was successfully retrieved from the URL. Because the function is async and returns a Promise, it is recommended you use wget in NetscriptJS (Netscript 2.0).

View File

@@ -28,7 +28,7 @@ void
RAM cost: 0 GB
This function can be used to write data to a text file (.txt) or a script (.js or .script).
This function can be used to write data to a text file (.txt, .json) or a script (.js, .jsx, .ts, .tsx, .script).
This function will write data to that file. If the specified file does not exist, then it will be created. The third argument mode defines how the data will be written to the file. If mode is set to “w”, then the data is written in “write” mode which means that it will overwrite all existing data on the file. If mode is set to any other value then the data will be written in “append” mode which means that the data will be added at the end of the file.