Comparing version 0.0.0 to 1.0.0
122
package.json
{ | ||
"name": "papr", | ||
"version": "0.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"description": "MongoDB TypeScript-aware Models", | ||
"author": "Plex Inc.", | ||
"version": "1.0.0", | ||
"keywords": [ | ||
"mongodb", | ||
"database", | ||
"model", | ||
"schema", | ||
"json", | ||
"json-schema", | ||
"validation", | ||
"typescript", | ||
"types" | ||
], | ||
"license": "MIT", | ||
"engines": { | ||
"node": "^14.0.0 || >=15.0.0" | ||
}, | ||
"type": "module", | ||
"types": "./esm/index.d.ts", | ||
"main": "./cjs/index.js", | ||
"exports": { | ||
"import": "./esm/index.js", | ||
"require": "./cjs/index.js" | ||
}, | ||
"files": [ | ||
"cjs/*", | ||
"esm/*" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/plexinc/papr.git" | ||
}, | ||
"homepage": "https://plexinc.github.io/papr/", | ||
"bugs": { | ||
"url": "https://github.com/plexinc/papr/issues/new" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build": "tsc --project ./tsconfig-esm.json && tsc --project ./tsconfig-cjs.json && echo \"{\\\"type\\\":\\\"commonjs\\\"}\" > ./cjs/package.json", | ||
"docs": "node docs/build.js && docsify serve ./docs", | ||
"benchmark": "yarn build && node --experimental-specifier-resolution=node ./benchmark/run.js", | ||
"lint": "eslint --ext .ts ./src", | ||
"prepack": "yarn build", | ||
"prepare": "husky install", | ||
"pretty": "prettier '**/*.ts' --write", | ||
"pretty:ci": "prettier '**/*.ts' --check", | ||
"release": "standard-version --infile docs/CHANGELOG.md", | ||
"test": "jest", | ||
"test:build": "./tests/build.sh", | ||
"test:types": "tsc" | ||
}, | ||
"author": "Plex Inc.", | ||
"license": "MIT" | ||
"devDependencies": { | ||
"@babel/core": "7.13.16", | ||
"@babel/preset-env": "7.13.15", | ||
"@babel/preset-typescript": "7.13.0", | ||
"@commitlint/cli": "12.1.1", | ||
"@commitlint/config-conventional": "12.1.1", | ||
"@types/jest": "26.0.22", | ||
"@types/mongodb": "3.6.12", | ||
"@typescript-eslint/eslint-plugin": "4.22.0", | ||
"@typescript-eslint/parser": "4.22.0", | ||
"docsify-cli": "4.4.3", | ||
"eslint": "7.24.0", | ||
"eslint-config-prettier": "8.2.0", | ||
"eslint-config-standard": "16.0.2", | ||
"eslint-plugin-import": "2.22.1", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-prettier": "3.4.0", | ||
"eslint-plugin-promise": "5.1.0", | ||
"husky": "6.0.0", | ||
"jest": "26.6.3", | ||
"jsdoc-api": "7.0.1", | ||
"jsdoc-parse": "6.0.0", | ||
"lint-staged": "10.5.4", | ||
"mongodb": "3.6.6", | ||
"mongodb-memory-server-global-4.4": "6.9.6", | ||
"mongoose": "5.12.5", | ||
"prettier": "2.2.1", | ||
"standard-version": "9.2.0", | ||
"ts-expect": "1.3.0", | ||
"ts-node": "9.1.1", | ||
"typescript": "4.2.4" | ||
}, | ||
"peerDependencies": { | ||
"mongodb": "3.x" | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
], | ||
"rules": { | ||
"subject-case": [ | ||
2, | ||
"always", | ||
[ | ||
"sentence-case" | ||
] | ||
] | ||
} | ||
}, | ||
"lintstaged": { | ||
"*.ts": [ | ||
"eslint --fix" | ||
], | ||
"src/*.ts": [ | ||
"node docs/build.js", | ||
"git add docs/" | ||
] | ||
}, | ||
"prettier": { | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
}, | ||
"volta": { | ||
"node": "14.16.0", | ||
"yarn": "1.22.10" | ||
} | ||
} |
# papr | ||
TBA | ||
![](https://github.com/plexinc/papr/actions/workflows/ci.yaml/badge.svg) | ||
`papr` is a lightweight library built around the MongoDB NodeJS driver, written in TypeScript. | ||
`papr` uses MongoDB's [JSON Schema validation](https://docs.mongodb.com/manual/core/schema-validation/#json-schema) 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 | ||
<!-- prettier-ignore --> | ||
```ts | ||
import { 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](https://plexinc.github.io/papr/) | ||
## Contributing | ||
This repository is following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. | ||
## License | ||
MIT | ||
## Inspiration | ||
- [Mongoose](https://mongoosejs.com/) | ||
- [ts-mongoose](https://github.com/lstkz/ts-mongoose) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
144242
28
3815
0
0
44
0
Yes
1
30