Giter VIP home page Giter VIP logo

tabber's Introduction

tabber

A library of mongodb helper functions to make manipulating your db and its collections better (er).

Installation

npm install tabber --save

Usage

Initialize inParallel like so:

//require tabber
var Tabber = require('tabber');

//create a new instance of tabber
var tabber = new Tabber(true);

###A Simple Example You could use tabber to find one user by a unique key-value pair in your mongodb and then use tabber again to find all notifications that belong to that user.

    tabber.findOneByAndRun(db, "usersCollection", {
      email: "[email protected]"
    }, function(user){
      //success
      if(user) {
        //do something with it
        tabber.findByAndRun(db, "notificationsCollection", {
          userId: user._id
        }, function(notifications){
          //success
          if(notifications) {
            //do something with the user's notifications
          }
        }, function(err){
          //handle the error
        });
      }
    }, function(err){
      //handle the error
    });

Config

###Debug Messages Debug messages are NOT printed to the console by default but you can choose to have them printed like so:

	var tabber = new Tabber(false);

  //OR 

  var tabber = new Tabber();

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Release History

  • 0.1.0 Initial release

##Credits I used this article to learn how to publish npm articles: https://quickleft.com/blog/creating-and-publishing-a-node-js-module/

tabber's People

Contributors

lwdthe1 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.