Skip to content
/ option Public

A Wordpress like option module for Mongodb in Javascript.

License

Notifications You must be signed in to change notification settings

muftjs/option

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Wordpress Like Option Module for Node.js

  • Database Support: Mongodb
  • Flexibilty: Can be used with any Node.js App and any kind of Node.js Framework

Parameters

  • args [Object] args
    • args.db [Array] Mongodb DB instance if not provided it will take default mongodb uri 'mongodb://127.0.0.1:27017/jgdb' (optional, default null)

Examples

Check examples/ directory and simply run any example using node example1.js

How to Install

npm install @jeoga/option
yarn add @jeoga/opttion

How to USE

const _Option = require('@jeoga/option');
let Option = new Option({
    db: <Mongo DB Instance>
})
Option.init()

Note: Check examples how to pass Mongo DB Instance

Get key value

Option.get('key', defaultValue=null)

Returns [Promise]<[string]>

Update key value

Option.update('key', value)

Returns [Promise]<[Boolean]>

Add new key value

Option.add('key', value)

Returns [Promise]<[object]> if Error returns Returns [Promise]<[Boolean]>

Remove key value

Option.remove('key')

Returns [Promise]<[Boolean]>

About

A Wordpress like option module for Mongodb in Javascript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published