# File `[Shared]`

A module to work with files in both client and server side

## JO Functions

### jo.file.isExist()

Checks if a file exists <br>

#### Syntax

```lua
jo.file.isExist(...)
```

#### Parameters

`modname` : _string_
> The file location
>

#### Return Value

Type : _boolean_

> Returns `true` if the file exists, `false` otherwise

---

### jo.file.load()

Loads and executes a Lua file <br>

#### Syntax

```lua
jo.file.load(modname)
```

#### Parameters

`modname` : _string_
> The file location
>

#### Return Value

Type : _any_

> The result of the executed file, or `false` if there was an error

---

### jo.file.loadJson()

Loads a JSON file and returns it decoded <br>

#### Syntax

```lua
jo.file.loadJson(...)
```

#### Parameters

`...` : _string_
> path of the file, without the `.json` extension
>

#### Return Value

Type : _table|boolean_

> The decoded content of the file, or `false` if there was an error

---

### jo.file.read()

Read a file and return it if it's exist or `false`. The function accept one or two arguments. <br>
One argument: the filepath <br>
Two argument: the resource AND the filepath <br>

#### Syntax

```lua
jo.file.read(...)
```

#### Parameters

`...` : _string_
> path of the file
>

#### Return Value

Type : _file|boolean,resource|string,modpath|string_

---

### jo.file.readJson()

Read a JSON file and return its content if it's exist or `false`. The function accept one or two arguments. <br>
One argument: the filepath <br>
Two argument: the resource AND the filepath <br>

#### Syntax

```lua
jo.file.readJson(...)
```

#### Parameters

`...` : _string_
> path of the file, without the `.json` extension
>

#### Return Value

Type : _file|boolean,resource|string,modpath|string_
