...
github-icon
GitHub
483star-icon
Created 4 years ago, last commit a month ago
24 contributors
861 commits
Stars added on GitHub, month by month
0
7
8
9
10
11
12
1
2
3
4
5
6
2024
2025
Stars added on GitHub, per day, on average
Yesterday
+1star-icon
Last week
+0.1
star-icon /day
Last month
+0.2
star-icon /day
Last 12 months
+0.1
star-icon /day
npmPackage on NPM
Monthly downloads on NPM
7
8
9
10
11
12
1
2
3
4
5
6
2024
2025
No dependencies
README

Papr

Papr

  • TypeScript-safe schemas
  • JSON Schema MongoDB validation
  • 🎉 Lightweight library
  • 🚀 Blazing fast

Github Actions NPM version Install size

papr is a lightweight library built around the MongoDB NodeJS driver, written in TypeScript.

papr uses MongoDB's JSON Schema validation feature to enable validation of document writes at runtime (requires MongoDB 3.6+).

papr has a familiar API - if you have used the raw mongodb methods to query and change documents before, then you already know how to use papr.

Sample code

import Papr, { schema, types } from 'papr';

const papr = new Papr();

const User = papr.model('users', schema({
  age: types.number(),
  firstName: types.string({ required: true }),
  lastName: types.string({ required: true }),
}));

const johnWick = await User.find({ firstName: 'John', lastName: 'Wick' });

Documentation

Read the documentation at: plexinc.github.io/papr

Contributing

Please read the contributing guidelines.

Before contributing, please read the Code of conduct.

License

MIT

Inspiration