Skip to content

plexinc/papr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a0d43a3 ยท Apr 22, 2025
Jan 22, 2025
Jan 29, 2024
Jun 2, 2023
Nov 15, 2024
Jun 2, 2023
Apr 15, 2025
Jul 10, 2023
Jan 20, 2025
Jan 14, 2025
Aug 17, 2023
Jun 2, 2023
Jan 14, 2025
Jul 10, 2023
May 20, 2024
Feb 7, 2023
Jun 2, 2023
May 10, 2021
Feb 7, 2023
May 10, 2021
Jun 2, 2023
Feb 22, 2023
Jan 14, 2025
May 20, 2024
Apr 22, 2025
Apr 22, 2025
Jan 23, 2024
Nov 15, 2024
May 10, 2021
May 10, 2021
Jan 14, 2025

Repository files navigation

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