mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 15:33:12 +09:00
Documented more things with JSDOC
This commit is contained in:
1 parent
96d60e5428
commit
02dc688161
4 files changed
+56
-3
No files matched your search
@@ -13,8 +13,15 @@ const config = require("./../../config");
|
||||
|
||||
const instances = fileOps.getDirectoriesSync("./instances/");
|
||||
/**
|
||||
Lists mods for an instance
|
||||
Lists mods for an instance as a table. Warning, handles printing internally.
|
||||
@param {string} instance - Name of the instance or "shared"
|
||||
@async
|
||||
@example
|
||||
var modManager = require("modManager");
|
||||
modManager.listMods("testInstance");
|
||||
// console.logs table of mods installed on instance
|
||||
modManager.listMods("shared");
|
||||
// console.logs mods located in /sharedMods as a nice table
|
||||
*/
|
||||
module.exports.listMods = function(instance){
|
||||
if(instance && instances.includes(instance)){
|
||||
@@ -67,6 +74,12 @@ module.exports.listMods = function(instance){
|
||||
console.log(JSON.parse(res.getBody()))
|
||||
*/
|
||||
}
|
||||
/**
|
||||
Searches mods.factorio.com for mods matching a search term and prints
|
||||
the results to console as a neat looking table
|
||||
|
||||
@param {string} searchTerm What to search for
|
||||
*/
|
||||
module.exports.findMods = function(searchTerm){
|
||||
factorioAPI.init(false);
|
||||
console.log("Authenticating to factorio.com...")
|
||||
@@ -94,6 +107,12 @@ module.exports.findMods = function(searchTerm){
|
||||
}
|
||||
|
||||
// 'https://api.github.com/repos/Danielv123/factorioClusterioMod/releases'
|
||||
/**
|
||||
Download mod from github repo by looking for the first binary download in
|
||||
the latest release, saving it to /sharedMods
|
||||
|
||||
@param {string} url a github repo URL, for example https://api.github.com/repos/Danielv123/factorioClusterioMod/releases. Must link to /releases
|
||||
*/
|
||||
module.exports.downloadFromGitURL = function(url){
|
||||
console.log("Downloading mod from "+url);
|
||||
// get JSON data about releases
|
||||
|
||||
Reference in new issue
Block a user