> For the complete documentation index, see [llms.txt](https://wastefuldb.gitbook.io/wastefuldb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wastefuldb.gitbook.io/wastefuldb/constructor-setup.md).

# Constructor Setup

### Quick Setup

```javascript
const Wasteful = require("wastefuldb");
const db = new Wasteful();
```

***

### Setup w/ Options

```javascript
const Wasteful = require("wastefuldb");
const db = new Wasteful({
    feedback: true,  
    log: { enabled: true, dir: "./logger/" },
    path: `./data/`,
    serial: true,
    kill: true
});
```

#### feedback

When `feedback` is **true**, a message will be logged to the console (*stdout*) either confirming execution or displaying an error.

#### log

The `log` option will generate a text document and catalogs every execution of functions, errors, and the timestamps of when every event occurs.

The option argument can be a straight Boolean, or you can specify a directory you want your log file to be generated in by specifying a `dir` key and enabled the option with an `enabled` key.

#### path

When specifying a directory `path`, whatever given will become the location where functions will create, retrieve, and modify documents. Specifying a `path` has no effect on the log path option.

#### serial

`serial`, or serialization, allows entries to be created without being required to specify an **id** key. While **true**, entries created will have an identifier assigned based on the size of the directory, but you may still specify an identifier which takes priority over serialization identifiers.

#### kill

Setting this option to **true** will cause the current process running the database to terminate, throwing an error to the console (*stderr*). While **false**, the error is simply logged to the console (*stdout*).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wastefuldb.gitbook.io/wastefuldb/constructor-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
