Skip to content

Commit 0535f46

Browse files
committed
chore: update readme
1 parent 220a09b commit 0535f46

File tree

6 files changed

+88
-17
lines changed

6 files changed

+88
-17
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ pnpm add stenodb
2020
| ------- | ------ | ----------- |
2121
| [@stenodb/node](./packages/node) | [![](https://img.shields.io/npm/v/@stenodb/node)](https://npm.im/@stenodb/node) | Node.js |
2222
| [@stenodb/browser](./packages/browser) | [![](https://img.shields.io/npm/v/@stenodb/browser)](https://npm.im/@stenodb/browser) | Browser (localStorage, sessionStorage) |
23-
| [@stenodb/nest](./packages/nest) | [![](https://img.shields.io/npm/v/@stenodb/nest)](https://npm.im/@stenodb/nest) | Nest.js |
24-
| [@stenodb/lodash](./packages/lodash) | [![](https://img.shields.io/npm/v/@stenodb/lodash)](https://npm.im/@stenodb/lodash) | Lodash wrapper |
23+
| [@stenodb/nest](./packages/nest) | [![](https://img.shields.io/npm/v/@stenodb/nest)](https://npm.im/@stenodb/nest) | Nest.js module |
24+
| [@stenodb/fastify](./packages/fastify) | [![](https://img.shields.io/npm/v/@stenodb/fastify)](https://npm.im/@stenodb/fastify) | Fastify plugin |
25+
| [@stenodb/lodash](./packages/lodash) | [![](https://img.shields.io/npm/v/@stenodb/lodash)](https://npm.im/@stenodb/lodash) | Lodash wrapper for Node.js and Browser |
2526
| [@stenodb/logger](./packages/logger) | [![](https://img.shields.io/npm/v/@stenodb/logger)](https://npm.im/@stenodb/logger) | Logger |
2627

2728
## Examples
@@ -194,8 +195,11 @@ pnpm add stenodb
194195
## Credits
195196

196197
- [steno](https://github.com/typicode/steno) - Specialized fast async file writer.
198+
- [fastify-plugin](https://github.com/fastify/fastify-plugin) - Plugin helper for Fastify.
199+
- [nest](https://github.com/nestjs/nest) - A progressive Node.js framework for building efficient and scalable server-side applications.
197200
- [class-transformer](https://github.com/typestack/class-transformer) - Decorator-based transformation, serialization, and deserialization between objects and classes.
198201
- [class-validator](https://github.com/typestack/class-validator) - Decorator-based property validation for classes.
202+
- [class-validator-jsonschema](https://github.com/epiphone/class-validator-jsonschema) - Convert `class-validator` decorated classes into JSON schema.
199203
- [json-difference](https://github.com/lukascivil/json-difference) - A simple way to find the difference between two objects or json diff.
200204
- [tslog](https://github.com/fullstack-build/tslog) - Universal Logger for TypeScript and JavaScript.
201205

packages/browser/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ db.write()
7575
- [steno](https://github.com/typicode/steno) - Specialized fast async file writer.
7676
- [class-transformer](https://github.com/typestack/class-transformer) - Decorator-based transformation, serialization, and deserialization between objects and classes.
7777
- [class-validator](https://github.com/typestack/class-validator) - Decorator-based property validation for classes.
78-
- [json-difference](https://github.com/lukascivil/json-difference) - A simple way to find the difference between two objects or json diff.
79-
- [tslog](https://github.com/fullstack-build/tslog) - Universal Logger for TypeScript and JavaScript.
8078

8179
## License
8280

packages/fastify/README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# @stenodb/fastify [![](https://img.shields.io/npm/v/@stenodb/fastify)](https://www.npmjs.org/package/@stenodb/fastify)
2+
3+
> ✍ Easy to use local JSON database for [Fastify](https://fastify.io)
4+
5+
## Install
6+
7+
```sh
8+
npm install @stenodb/fastify
9+
```
10+
11+
```sh
12+
yarn add @stenodb/fastify
13+
```
14+
15+
```sh
16+
pnpm add @stenodb/fastify
17+
```
18+
19+
## Usage
20+
21+
```ts
22+
// index.ts
23+
import Fastify from 'fastify'
24+
import { resolve } from 'node:path'
25+
import { AsyncAdapter, FastifySteno } from '@stenodb/fastify'
26+
import { Users, User } from './entities.js'
27+
28+
const fastify = Fastify()
29+
30+
const initialData = new Users(
31+
new User('John'),
32+
new User('Alice')
33+
)
34+
35+
const usersAdapter = new AsyncAdapter(
36+
'users',
37+
Users,
38+
initialData
39+
)
40+
41+
fastify.register(FastifySteno, {
42+
path: resolve(dirname(fileURLToPath(import.meta.url)), '..', 'db'),
43+
entities: [User, Post],
44+
adapters: [usersAdapter]
45+
})
46+
47+
fastify.get('/users', () => {
48+
const users = fastify.steno.get<Users>('users')
49+
return users.data
50+
})
51+
52+
fastify.listen({ host: '0.0.0.0', port: 3000 }, (err, address) => {
53+
if (err) throw err
54+
console.log(address)
55+
})
56+
```
57+
58+
## Credits
59+
60+
- [steno](https://github.com/typicode/steno) - Specialized fast async file writer.
61+
- [fastify-plugin](https://github.com/fastify/fastify-plugin) - Plugin helper for Fastify.
62+
- [class-transformer](https://github.com/typestack/class-transformer) - Decorator-based transformation, serialization, and deserialization between objects and classes.
63+
- [class-validator](https://github.com/typestack/class-validator) - Decorator-based property validation for classes.
64+
- [class-validator-jsonschema](https://github.com/epiphone/class-validator-jsonschema) - Convert `class-validator` decorated classes into JSON schema.
65+
- [json-difference](https://github.com/lukascivil/json-difference) - A simple way to find the difference between two objects or json diff.
66+
- [tslog](https://github.com/fullstack-build/tslog) - Universal Logger for TypeScript and JavaScript.
67+
68+
## License
69+
70+
MIT - [crashmax](https://github.com/crashmax-dev)

packages/nest/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ export class UsersService implements OnModuleInit {
9696
## Credits
9797

9898
- [steno](https://github.com/typicode/steno) - Specialized fast async file writer.
99+
- [nest](https://github.com/nestjs/nest) - A progressive Node.js framework for building efficient and scalable server-side applications.
99100
- [class-transformer](https://github.com/typestack/class-transformer) - Decorator-based transformation, serialization, and deserialization between objects and classes.
100-
- [class-validator](https://github.com/typestack/class-validator) - Decorator-based property validation for classes.
101-
- [json-difference](https://github.com/lukascivil/json-difference) - A simple way to find the difference between two objects or json diff.
102-
- [tslog](https://github.com/fullstack-build/tslog) - Universal Logger for TypeScript and JavaScript.
103101

104102
## License
105103

packages/node/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ await db.write()
7777

7878
- [steno](https://github.com/typicode/steno) - Specialized fast async file writer.
7979
- [class-transformer](https://github.com/typestack/class-transformer) - Decorator-based transformation, serialization, and deserialization between objects and classes.
80-
- [class-validator](https://github.com/typestack/class-validator) - Decorator-based property validation for classes.
81-
- [json-difference](https://github.com/lukascivil/json-difference) - A simple way to find the difference between two objects or json diff.
82-
- [tslog](https://github.com/fullstack-build/tslog) - Universal Logger for TypeScript and JavaScript.
8380

8481
## License
8582

packages/stenodb/README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ pnpm add stenodb
1818

1919
| Package | Version | Description |
2020
| ------- | ------ | ----------- |
21-
| [@stenodb/node](../packages/node) | [![](https://img.shields.io/npm/v/@stenodb/node)](https://npm.im/@stenodb/node) | Node.js |
22-
| [@stenodb/browser](../packages/browser) | [![](https://img.shields.io/npm/v/@stenodb/browser)](https://npm.im/@stenodb/browser) | Browser (localStorage, sessionStorage) |
23-
| [@stenodb/nest](../packages/nest) | [![](https://img.shields.io/npm/v/@stenodb/nest)](https://npm.im/@stenodb/nest) | Nest.js |
24-
| [@stenodb/lodash](../packages/lodash) | [![](https://img.shields.io/npm/v/@stenodb/lodash)](https://npm.im/@stenodb/lodash) | Lodash wrapper |
25-
| [@stenodb/logger](../packages/logger) | [![](https://img.shields.io/npm/v/@stenodb/logger)](https://npm.im/@stenodb/logger) | Logger |
21+
| [@stenodb/node](./packages/node) | [![](https://img.shields.io/npm/v/@stenodb/node)](https://npm.im/@stenodb/node) | Node.js |
22+
| [@stenodb/browser](./packages/browser) | [![](https://img.shields.io/npm/v/@stenodb/browser)](https://npm.im/@stenodb/browser) | Browser (localStorage, sessionStorage) |
23+
| [@stenodb/nest](./packages/nest) | [![](https://img.shields.io/npm/v/@stenodb/nest)](https://npm.im/@stenodb/nest) | Nest.js module |
24+
| [@stenodb/fastify](./packages/fastify) | [![](https://img.shields.io/npm/v/@stenodb/fastify)](https://npm.im/@stenodb/fastify) | Fastify plugin |
25+
| [@stenodb/lodash](./packages/lodash) | [![](https://img.shields.io/npm/v/@stenodb/lodash)](https://npm.im/@stenodb/lodash) | Lodash wrapper for Node.js and Browser |
26+
| [@stenodb/logger](./packages/logger) | [![](https://img.shields.io/npm/v/@stenodb/logger)](https://npm.im/@stenodb/logger) | Logger |
2627

2728
## Examples
2829

29-
> **Note**
30-
> You can find more detailed examples [here](../../examples)
30+
> **Note**\
31+
> You can find more detailed examples [here](./examples)
3132
3233
<details>
3334
<summary>class-transformer entity</summary>
@@ -194,8 +195,11 @@ pnpm add stenodb
194195
## Credits
195196

196197
- [steno](https://github.com/typicode/steno) - Specialized fast async file writer.
198+
- [fastify-plugin](https://github.com/fastify/fastify-plugin) - Plugin helper for Fastify.
199+
- [nest](https://github.com/nestjs/nest) - A progressive Node.js framework for building efficient and scalable server-side applications.
197200
- [class-transformer](https://github.com/typestack/class-transformer) - Decorator-based transformation, serialization, and deserialization between objects and classes.
198201
- [class-validator](https://github.com/typestack/class-validator) - Decorator-based property validation for classes.
202+
- [class-validator-jsonschema](https://github.com/epiphone/class-validator-jsonschema) - Convert `class-validator` decorated classes into JSON schema.
199203
- [json-difference](https://github.com/lukascivil/json-difference) - A simple way to find the difference between two objects or json diff.
200204
- [tslog](https://github.com/fullstack-build/tslog) - Universal Logger for TypeScript and JavaScript.
201205

0 commit comments

Comments
 (0)