UNPKG

3.48 kBMarkdownView Raw
1# predefine
2
3[![Build Status](https://travis-ci.org/lykmapipo/predefine.svg?branch=master)](https://travis-ci.org/lykmapipo/predefine)
4[![Dependencies Status](https://david-dm.org/lykmapipo/predefine.svg)](https://david-dm.org/lykmapipo/predefine)
5[![Coverage Status](https://coveralls.io/repos/github/lykmapipo/predefine/badge.svg?branch=master)](https://coveralls.io/github/lykmapipo/predefine?branch=master)
6[![GitHub License](https://img.shields.io/github/license/lykmapipo/predefine)](https://github.com/lykmapipo/predefine/blob/master/LICENSE)
7[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/lykmapipo/predefine/tree/master)
8
9[![Commitizen Friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
11[![Code Style](https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb)](https://github.com/airbnb/javascript)
12[![npm version](https://img.shields.io/npm/v/@lykmapipo/predefine)](https://www.npmjs.com/package/@lykmapipo/predefine)
13
14A representation of stored and retrieved information that does not qualify to belongs to their own domain model.
15
16**Note!: v1+ is not compactible with all previous version**
17
18## Requirements
19
20- [NodeJS v12+](https://nodejs.org)
21- [Npm v6+](https://www.npmjs.com/)
22- [MongoDB v4+](https://www.mongodb.com/)
23- [Mongoose v5.6+](https://github.com/Automattic/mongoose)
24
25## Installation
26
27```sh
28npm install @lykmapipo/predefine --save
29```
30
31## Usage
32
33```js
34import { start } from '@lykmapipo/predefine';
35
36// fire the http server
37start(error => { ... });
38```
39
40## Environment
41```js
42MONGODB_URI=
43DEFAULT_LOCALE = 'en';
44LOCALES = 'en,sw';
45PREDEFINE_NAMESPACES =
46PREDEFINE_STRINGS =
47PREDEFINE_NUMBERS =
48PREDEFINE_DATES =
49PREDEFINE_BOOLEANS =
50PREDEFINE_RELATIONS =
51PREDEFINE_RELATIONS_IGNORED =
52```
53
54## Testing
55
56- Clone this repository
57
58- Install all development dependencies
59
60```sh
61npm install
62```
63
64- Run example
65
66```sh
67npm run dev
68```
69
70- Then run test
71
72```sh
73npm test
74```
75
76## Contribute
77
78It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.
79
80## License
81
82The MIT License (MIT)
83
84Copyright (c) lykmapipo & Contributors
85
86Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
87
88The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
89
90THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.