# itchdb

> An all-in-one Scratch cloudserver and database

Latest version **1.0.2** (published 2021-02-05) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install itchdb
pnpm add itchdb
yarn add itchdb
bun add itchdb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-02-05 |
| First published | 2021-02-05 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | YodaLightsabr |
| Maintainers | yodalightsabr |
| Keywords | scratch, database, cloud |

## Links

- npm: https://www.npmjs.com/package/itchdb
- Repository: https://github.com/YodaLightsabr/itchdb
- Homepage: https://github.com/YodaLightsabr/itchdb#readme
- Issues: https://github.com/YodaLightsabr/itchdb/issues
- npm.io page: https://npm.io/package/itchdb

## Dependencies (4)

- [express](https://npm.io/package/express.md) ^4.17.1
- [quick.db](https://npm.io/package/quick.db.md) ^7.1.3
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [scratch-api](https://npm.io/package/scratch-api.md) ^1.1.11

## Recent versions

- 1.0.2 (latest) — 2021-02-05
- 1.0.1 — 2021-02-05

## README

# ItchDB
ItchDB is a Scratch Cloud Interface for making HTTP requests, managing a Cloud Database, and doing various things with the Scratch API. It allows for easy setup, but rich customizability. With just 4 lines of code, you can set up ItchDB in the Repl.it environment as an always-online cloud solution.

NOTE: If it's confusing, feel free to contact me on Discord at YodaLightsabr#6565.

## Documentation
#### `Itch.Database(config)`
Creates a new Itch Database using the specified configuration object. Example:
```js
var Database = new Itch.Database({
	username: "YodaLightsabr",  // The Scratch username to use when accessing the API
	password: "123456",         // The Scratch password to use when accessing the API
	project: "12345678",        // The Scratch project to connect to
	webserver: "true",          // Weather or not to enable the default webserver
	port: 8080                  // Only required if webserver is true; the port to open the webserver on
});
```
#### `Database.start()`
Initializes the database and cloud server. Example:
```js
Database.start();
```
#### `Database.query`
Provides a set of functions for direct access to the database. (Uses the Quick.db database.) Example:
```js
var Query = Database.query;
```
#### `Query.get(key)`
Get a key from Quick.db. Example:
```js
console.log(Query.get("users"));
```
#### `Query.set(key, value)`
Set a key in Quick.db. Example:
```js
Query.set("users", {});
```
#### `Query.push(key, value)`
Push to an array in Quick.db. Example:
```js
Query.push("users.active", "YodaLightsabr");
```
#### `Query.delete(key)`
Delete a key from Quick.db. Example:
```js
Query.delete("users");
```

## Quick Setup
To quickly get set up, make sure you are using the latest stable ItchDB sprite in your Scratch project and that all cloud variables are properly linked. Then, make sure your `index.js`, or main file, contains:
```js
const ItchDB = require('./itch.db.js');
const config = {
  username: "YodaLightsabr",
  password: process.env.PASSWORD,
  project: "483796537",
  webserver: true,
  port: 8080
};
var database = new ItchDB.Database(config);
database.start();
```
Make sure to update it to match your project.

## Development
ItchDB is full of bugs and issues, and we need people like you to help find them! Please open an issue if you come across any bugs, flaws, deprecations, or just things to improve in general. I'm also open for pull requests!

---
_Source: https://npm.io/package/itchdb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
