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

mongoose-helper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-helper

A helper to bring more granular structure to your Mongoose models.

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Mongoose Helper

Mongoose Helper is a utility that imposes a granular organisation structure for your Mongoose models and aids in following our style guide for Node.js applications for the following mongoose features:

  • Schema
  • Methods
  • Statics
  • Virtuals
  • Middleware (Post/Pre Saving)
  • Validation

Todo

  • Link to Node.js applicaton style guide
  • Middleware (Post/Pre Saving)
  • Validation
  • Contributing guidelines
  • License

Requirements

You will need to install Mongoose for your application. We do not require any version of Mongoose in this packages dependencies to give you the flexibility to use your own version of Mongoose.

Overview

Mongoose Helper encourages the use of feature folders for organising your application, following the principles of Node.js API Style Guide

Each piece of functionality should live it its own file. E.g. Each method/static will reside in independant files under the methods/statics folder respectively. Here's a sample folder structure.

lib/
  users/
    controller/
    model/
      schema.js
      methods/
        reset-password.js
        update-password.js
      statics/
        signup.js
        find-or-create.js
  posts/
    contoller/
    model/
    ...
    

Structuring your models (and any module) like this aids in testing, maintaining and reusing your Mongoose models.

When you create your model with Mongoose Helper, your model will be automatically loaded and instantiated based on your directory structure.

See the test/fixtures folder of the repository for an example of how to use Mongoose Helper.

FAQs

Package last updated on 26 Nov 2014

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