Skip to content
/ mongodef Public

Utilities to handle Mongoose Schema Definitions, to convert to JSON and vice versa

License

Notifications You must be signed in to change notification settings

klei/mongodef

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

klei-mongodef

klei-mongodef is a utility library for working with Mongoose Schema definitions.

The library can convert a Mongoose Schema definition to JSON or the other way around, which is useful for sending schema definitions via e.g. a REST API or Websockets.

Installation

Install klei-mongodef with npm:

npm install klei-mongodef

Usage

var mongodef = require('klei-mongodef');

Public Methods

toJSON

Convert a Mongoose Schema Definition to a JSON string

  • @param {Object} definition
  • @returns {String}

fromJSON

Get a Schema Definition object from JSON

  • @param {Object|String} json
  • @returns {Object}

Unit tests

Make sure the dev-dependencies are installed, and then run:

npm test

Contributing

klei-mongodef uses the Git Flow branching model so make your pull requests to the develop branch.

About

Utilities to handle Mongoose Schema Definitions, to convert to JSON and vice versa

Resources

License

Stars

Watchers

Forks

Packages

No packages published