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

crud.js

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

crud.js

Crud module compatible with mongoDB

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by1100%
Maintainers
1
Weekly downloads
 
Created
Source

crud.js

crud.js easily install crud on your node server Based only on mongoDB

Installation

npm install crud.js

Crud.js

var bodyParser      = require('body-parser');
var express         = require('express');
var cors            = require('cors');

var MongoClient = require('mongodb').MongoClient;

var crud = require('crud.js');

var port = 5000;
var app = module.exports = express();
var url = 'mongodb://localhost:27017/test';

app.use(cors());
app.use(bodyParser.json({limit: '1mb'}));
app.use(bodyParser.urlencoded({limit: '1mb', extended: false}));

MongoClient.connect(url, function(err, client) {
    if (err) {
        console.log(err);
    } else {
        console.log('successful connection on mongoDB ', url);
        crud.init(client); // initialize the database on crud Object
    }
});

app.all('/crud/:collection?', crud.crud);

app.listen(port, function() {
    console.log('Server on http://localhost:' + port);
});
  

Notes

If you want to only manage specific collections you have to add it on lib/crud.js on the variable mappingCollection. It will be extended on the futurs realase.

Keywords

FAQs

Package last updated on 15 Aug 2016

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