# Utils

These are some core utilities that can be useful throughout the modules.

## Usage

```javascript
const utils = require('core/server/utils');

// Bool, returns `true` if in devmode, `false` if in production
utils.isDevMode();

// Returns the absolute path to the publicly available directory
utils.getPublicDirectory();

// Returns the absolute path to the `assets` directory
utils.getAssetsDirectory();

// Returns the absolute path to the `modules` directory
utils.getModulesDirectory();

// Returns the absolute path to the project root directory
utils.getProjectRootPath();

// Creates an absolute path from a project relative
utils.convertProjectRelativePathToAbsolute(path);
utils.convertProjectRelativePathToAbsolute('core/client'); // /home/user/react-starter/core/client

// Returns a file's content relative to the project
utils.getFileContentInProject(file);
utils.getFileContentInProject('config/config.json'); // Returns the json file's content
```
