> For the complete documentation index, see [llms.txt](https://n-f9.gitbook.io/quack.js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://n-f9.gitbook.io/quack.js/guide/basic-usage.md).

# Basic Usage

#### Basic Usage

Create a new directory and open a command prompt or a terminal.

First, run `npm i @n-f9/quack.js` to install the package. Also, it would be a great time to install dotenv with `npm i dotenv` to store your Discord bot token (this is optional, however, recommended).

Next, open your favorite code editor or IDE and create a source directory with an `index.js` in the root

**Example Project Structure**

```
src/
├── commands/
│   ├── quote.js
│   └── help.js
├── events/
│   └── ready.js
├── triggers/
│   ├── links.js
│   └── mentions.js
index.js
```

The index.js should follow this format

```javascript
import 'dotenv/config'
import { QuackJS, QuackJSUtils } from '@n-f9/quack.js'

const Quack = new QuackJS(process.env.TOKEN, {
  backups: [
    {
      file: 'database.sqlite',
      scheduling: '0 0 23 * * *'
    }
  ],
  logsFolder: true,
}) 

const files = QuackJSUtils.GetFiles('./src')

for (const file of files) {
  const execute = (await import('./' + file)).default
  execute(Quack)
}

Quack.Start(Quack)
```

And your modules in your source directory should follow this basic format

```javascript
export default (QuackJS) => {
  ...
}
```

To start the bot simply run `node .` or if you want to run this in the background you can install something like [forever](https://github.com/foreversd/forever).
