query demo files from drive to cache
Requires: module:path
, module:fs
, module:colors
, module:modules/printer
, module:modules/Timer
- modules/cacheDemos
- ~createdDate(file) ⇒
String
- ~getFilesizeInBytes(filename) ⇒
Number
- ~bytesToSize(bytes) ⇒
String
- ~getDemos() ⇒
Promise.<Arrray>
- ~cacheDemos() ⇒
Promise.<Array>
- ~createdDate(file) ⇒
returns created date of a file
Kind: inner method of modules/cacheDemos
Returns: String
- date file was modified
Param | Type | Description |
---|---|---|
file | String |
path to the file |
Example (Example usage of createdDate() function.)
const created = createdDate('somedemo.dem');
// console.log(created); = '2020-12-29T07:45:12.737Z'
returns file size in bytes
Kind: inner method of modules/cacheDemos
Returns: Number
- file size in bytes
Param | Type | Description |
---|---|---|
filename | String |
file path |
Example (Example usage of getFilesileInBytes() function.)
const bytes = getFilesileInBytes('somedemo.dem');
// console.log(bytes); = 14567809
converts bytes to a readable string
Kind: inner method of modules/cacheDemos
Returns: String
- readable file size
Param | Type | Description |
---|---|---|
bytes | Number |
file size yay |
Example (Example usage of bytesToSize() function.)
const size = bytesToSize('somedemo.dem');
// console.log(size); = '13MB'
returns array of demo files from game server dir
Kind: inner method of modules/cacheDemos
Returns: Promise.<Arrray>
- list of demo files
Example (Example usage of getDemos() function.)
getDemos().then(demos => {
// demos = [ list of demo files ];
});
caches list of avaliable demo files
Kind: inner method of modules/cacheDemos
Returns: Promise.<Array>
- list of files with readable date and file size
Example (Example usage of cacheDemos() function.)
cacheDemos().then(demoList => {
// demoList = [ list of demos with readable details ];
});