# tiny-database

> Simple Database - Tiny Database

Latest version **5.3.3** (published 2020-03-23) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install tiny-database
pnpm add tiny-database
yarn add tiny-database
bun add tiny-database
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 5.3.3 |
| Published | 2020-03-23 |
| First published | 2020-03-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 56.7 MB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 172 |
| Author | Evelyne Lachance |
| Maintainers | brahaha1435 |
| Keywords | sqlite, better-sqlite3, database, caching, storing, db, easy, sql, sqlite3, wrapper, slicewire, tiny-database, enmap, map, enmap5, prebuilt, simple, tiny, true, true-database |

## Links

- npm: https://www.npmjs.com/package/tiny-database
- Repository: https://github.com/eslachance/enmap
- Homepage: https://enmap.evie.codes/
- Issues: https://github.com/eslachance/enmap/issues
- npm.io page: https://npm.io/package/tiny-database

## Dependencies (6)

- [tar](https://npm.io/package/tar.md) ^6.0.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [integer](https://npm.io/package/integer.md) ^3.0.1
- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [file-uri-to-path](https://npm.io/package/file-uri-to-path.md) ^2.0.0
- [prebuild-install](https://npm.io/package/prebuild-install.md) ^5.3.3

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 5.3.3 (latest) — 2020-03-23
- 5.3.2 — 2020-03-23
- 9.2.8 — 2020-03-20
- 9.2.6 — 2020-03-20
- 9.2.5 — 2020-03-20
- 5.3.1 — 2020-03-20
- 5.2.8 — 2020-03-19
- 5.2.7 — 2020-03-19
- 5.2.6 — 2020-03-19
- 5.2.4 — 2020-03-19

## README

# Tiny-Database
![Node](https://raw.githubusercontent.com/SliceWire/True-Captcha/master/data/Logos/Badges/Node.png) ![Browser](https://raw.githubusercontent.com/SliceWire/True-Captcha/master/data/Logos/Badges/Browser.png) ![Version](https://raw.githubusercontent.com/SliceWire/True-Captcha/master/data/Logos/Badges/Version.png) ![Build](https://raw.githubusercontent.com/SliceWire/True-Captcha/master/data/Logos/Badges/Build.png)

**Simplified Database - Tiny Database** 

 - Human Friendly
 - Easy To Learn
 - Configurable
 - Offline
 - Adaptive
 - Secure
 - Prebuilt
 - Lightning Fast API
 - API
 - High-Level
 - 1 Terabyte+ Database
 - Large Capacity
 - Based Off Of The Map API
 
### Installation

**Tiny-Database Works Best With Node 10**

###### NPM
$ npm install tiny-database
##### Yarn
$ yarn add tiny-database
##### Pnpm
$ pnpm install tiny-database

### Usage

**Basic Usage:**

```js
const Database = require('tiny-database');

const database = new Database({
	name: 'tiny-database',
	autoFetch: true,
	fetchAll: false
});

database.set('hello', 'world');

console.log(database.get('hello'));
//=> world
```

**Usage With JSON:**

```js
const Database = require('tiny-database');

const database = new Database({
	name: 'tiny-database',
	autoFetch: true,
	fetchAll: false
});

database.set('User 193729481083', {
	Password: 'Xz5g7[86]5!v/',
	Username: 'The King',
	Messages: 1932,
	Stars: 530,
	XP: 3942,
	Rank: 'Elite'
});

console.log(database.get('User 193729481083'));
//=> {
//====> Password: 'Xz5g7[86]5!v/',
//====> Username: 'The King',
//====> Messages: 1932,
//====> Stars: 530,
//====> XP: 3942,
//====> Rank: 'Elite'
//=> }
```

**Editing JSON**

```js
const Database = require('tiny-database');

const database = new Database({
	name: 'tiny-database',
	autoFetch: true,
	fetchAll: false
});

database.set('User 193729481083', {
	Password: 'Xz5g7[86]5!v/',
	Username: 'The King',
	Messages: 1932,
	Stars: 530,
	XP: 3942,
	Rank: 'Elite'
});

console.log(database.get('User 193729481083'));
//=> {
//====> Password: 'Xz5g7[86]5!v/',
//====> Username: 'The King',
//====> Messages: 1932,
//====> Stars: 530,
//====> XP: 3942,
//====> Rank: 'Elite'
//=> }

// Edit User 193729481083's XP
database.set('User 193729481083', 4278, 'XP');

console.log(database.get('User 193729481083'));
//=> {
//====> Password: 'Xz5g7[86]5!v/',
//====> Username: 'The King',
//====> Messages: 1932,
//====> Stars: 530,
//====> XP: 4278,
//====> Rank: 'Elite'
//=> }
```

**Usage With Arrays:**

```js
const Database = require('tiny-database');

const database = new Database({
	name: 'tiny-database',
	autoFetch: true,
	fetchAll: false
});

database.set('Items For Sale', ['Shotgun', 'X-Crystals', 'MX564 Anti-Armor Rifle']);

console.log(database.get('Items For Sale'));
//=> ['Shotgun', 'X-Crystals', 'MX564 Anti-Armor Rifle']
```

**Usage With Multiple Files:

moduleHUB.js:

```js
const Database = require('tiny-database');

module.exports = new Database({
	name: 'tiny-database',
	autoFetch: true,
	fetchAll: false
});
```

Then Require The Database In Another File:

```js
const database = require('moduleHUB.js');

database.set('hello', 'world');

//===> Do Whatever You Want...
```

**Authors: SliceWire, Evelyne Lachance**

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