getFolder

.getFolder() will return the contents of a folder.

.read(SessionID, path)

Gets the contents of a folder.

Parameter

Type

Required

Description

SessionID

string

true

The session ID that you want to perform this action on

path

string

true

The path of the folder you wish to get the contents of

Example:

// Dependencies
const CubedCraft = require('./index.js');

// Reading the folder
CubedCraft.files.getFolder('53tkvq5a3tl80dj3ve2m3fg7t6', '/plugins/Skript/scripts/').then(folder => {
    console.log(folder)
});

Example Response:

[
  {
    name: '-Rover.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/-Rover.sk',
    size: '6.671 kilobytes'
  },
  {
    name: '-RoverNoFly.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/-RoverNoFly.sk',
    size: '3.947 kilobytes'
  },
  {
    name: '-events.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/-events.sk',
    size: '8.927 kilobytes'
  },
  {
    name: 'Claiming.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/Claiming.sk',
    size: '3.208 kilobytes'
  },
  {
    name: 'Core.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/Core.sk',
    size: '9.42 kilobytes'
  },
  {
    name: 'LootCrates.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/LootCrates.sk',
    size: '4.173 kilobytes'
  },
  {
    name: 'Raiding.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/Raiding.sk',
    size: '2.56 kilobytes'
  },
  {
    name: 'Resources.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/Resources.sk',
    size: '1.923 kilobytes'
  },
  {
    name: 'WeakAC.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/WeakAC.sk',
    size: '2.811 kilobytes'
  },
  {
    name: 'WildTP.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/WildTP.sk',
    size: '2.389 kilobytes'
  },
  {
    name: 'chat.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/chat.sk',
    size: '92 bytes'
  },
  {
    name: 'event.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/event.sk',
    size: '15.438 kilobytes'
  },
  {
    name: 'hi.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/hi.sk',
    size: '39 bytes'
  },
  {
    name: 'qs.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/qs.sk',
    size: '3.012 kilobytes'
  },
  {
    name: 'staffmode.sk',
    type: 'sk',
    path: '/plugins/Skript/scripts/staffmode.sk',
    size: '20.915 kilobytes'
  }
]

Last updated

Was this helpful?