# egg-nedb

> egg plugin for nedb

Latest version **0.1.1** (published 2019-12-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install egg-nedb
pnpm add egg-nedb
yarn add egg-nedb
bun add egg-nedb
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-12-28 |
| First published | 2019-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | wellfrog |
| Maintainers | wellfrog16 |
| Keywords | egg, eggPlugin, egg-plugin |

## Links

- npm: https://www.npmjs.com/package/egg-nedb
- Repository: https://github.com/wellfrog16/egg-nedb
- Homepage: https://github.com/wellfrog16/egg-nedb#readme
- Issues: https://github.com/wellfrog16/egg-nedb/issues
- npm.io page: https://npm.io/package/egg-nedb

## Dependencies (1)

- [nedb-promises](https://npm.io/package/nedb-promises.md) ^4.0.0

## Recent versions

- 0.1.1 (latest) — 2019-12-28
- 0.1.0 — 2019-12-28

## README

# egg-nedb

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/egg-nedb.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-nedb
[travis-image]: https://img.shields.io/travis/eggjs/egg-nedb.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-nedb
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-nedb.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/egg-nedb?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-nedb.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-nedb
[snyk-image]: https://snyk.io/test/npm/egg-nedb/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-nedb
[download-image]: https://img.shields.io/npm/dm/egg-nedb.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-nedb

<!--
Description here.
-->

## Install

```bash
$ npm i egg-nedb --save
```

## Usage

```js
// {app_root}/config/plugin.js
exports.nedb = {
  enable: true,
  package: 'egg-nedb',
};
```

## Configuration

```js
// {app_root}/config/config.default.js
exports.nedb = {
  client: {
    // nedb的文件夹路径，nedb文件为*.db
    path: path.join(process.cwd(), '../nedb'),
  },
};
```

see [config/config.default.js](config/config.default.js) for more detail.

## Example

```js
// 直接文件
const db = app.nedb['account'];
const doc = await db.findOne({ username: username });

// 文件夹下文件访问
const db = app.nedb['security/account'];
const doc = await db.findOne({ _id: id });
```

语法参考 [nedb-promises](https://github.com/bajankristof/nedb-promises)

## Questions & Suggestions

Please open an issue [here](https://github.com/eggjs/egg/issues).

## License

[MIT](LICENSE)

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