New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

easy-crud

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-crud - npm Package Compare versions

Comparing version 0.0.3 to 1.0.3

25

crud.js
class Crud {
constructor(type) {
this.type = type;
constructor(model) {
this.model = model;
}
findAll(query) {
findAll(query, select) {
return new Promise((resolve, reject) => {
this.type.find(query)
.select({
_id: 0,
__v: 0,
password: 0
})
this.model.find(query)
.select(select || {})
.exec()

@@ -31,9 +27,6 @@ .then((docs) => resolve(docs))

findOne(query) {
findOne(query, select) {
return new Promise((resolve, reject) => {
this.type.findOne(query)
.select({
__v: 0,
password: 0
})
this.model.findOne(query)
.select(select || {})
.exec()

@@ -63,3 +56,3 @@ .then((doc) => {

return new Promise((resolve, reject) => {
this.type.findOneAndRemove(query)
this.model.findOneAndRemove(query)
.exec()

@@ -66,0 +59,0 @@ .then((doc) => {

{
"name": "easy-crud",
"version": "0.0.3",
"description": "Crud functions to your mongoose models",
"version": "1.0.3",
"description": "Crud functions to your mongoose models with Promises",
"main": "index.js",
"keywords": ["crud", "mongoose", "promises"],
"homepage": "https://github.com/gsasouza/easy-crud",
"repository": {
"type": "git",
"url": "https://github.com/gsasouza/easy-crud"
},
"scripts": {

@@ -12,4 +18,3 @@ "test": "echo \"Error: no test specified\" && exit 1"

"dependencies": {
}
}
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