Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

papr

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

papr

MongoDB TypeScript-aware Models

  • 15.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.3K
increased by12.23%
Maintainers
4
Weekly downloads
 
Created
Source

Papr

Papr

  • TypeScript-safe schemas
  • JSON Schema MongoDB validation
  • :tada: Lightweight library
  • :rocket: 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

Keywords

FAQs

Package last updated on 20 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc