# nano-trivial

> TrivialDB adapter for nanoSQL

Latest version **1.3.0** (published 2018-07-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install nano-trivial
pnpm add nano-trivial
yarn add nano-trivial
bun add nano-trivial
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2018-07-23 |
| First published | 2018-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 22 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 789 |
| Author | Scott Lott |
| Maintainers | clicksimply |
| Keywords | json, db, database, storage, nano-sql |

## Links

- npm: https://www.npmjs.com/package/nano-trivial
- Repository: https://github.com/ClickSimply/Nano-SQL
- Homepage: https://nanosql.io
- Issues: https://github.com/ClickSimply/Nano-SQL/issues
- npm.io page: https://npm.io/package/nano-trivial

## Dependencies (2)

- [nano-sql](https://npm.io/package/nano-sql.md) ^1.6.3
- [trivialdb](https://npm.io/package/trivialdb.md) ^3.0.0-rc.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.3.0 (latest) — 2018-07-23
- 1.2.0 — 2018-07-20
- 1.1.0 — 2018-05-28
- 1.0.3 — 2018-05-28
- 1.0.2 — 2018-05-03
- 1.0.1 — 2018-05-03
- 1.0.0 — 2018-05-03

## README

# Nano-Trivial
[TrivialDB](https://www.npmjs.com/package/trivialdb) Driver for [nanoSQL](https://nanosql.io/)

Lets you use TrivialDB as a backend datastore for nanoSQL.

TrivialDB is a simple JSON file storage database.  All changes are saved to disk as JSON files allowing you to easily view and edit database contents.

<img src="https://raw.githubusercontent.com/ClickSimply/Nano-SQL/master/logo.png" alt="nanoSQL Logo">

[![NPM](https://nodei.co/npm/nano-sqlite.png?downloads=true&stars=true)](https://nodei.co/npm/nano-sqlite/)

## [Documentation](https://docs.nanosql.io/)

## Installation
```sh
npm i --save nano-trivial
```

## Usage
```ts
import { nSQL } from "nano-sql";
import { TrivialAdapter } from "nano-trivial";

nSQL("table")
.model([...])
.config({
    mode: new TrivialAdapter(),
    ...other config options
}).connect()...
```

That's it, now everything NanoSQL can do you can do with TrivialDB.

Read about NanoSQL [here](https://nanosql.io/).

# API

When you call `new TrivialAdapter` there are two optional arguments, namespace arguments and database arguments.

The namespace arguments are documented [here](https://github.com/trivialsoftware/trivialdb#creating-a-namespace) and mostly allow you to adjust the location the files are saved to.

The database arguments are documented [here](https://github.com/trivialsoftware/trivialdb#options-1) and allow you to do more advanced things like controlling wethere the JSON files are pretty printed or not.

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