1.0.17 ā¢ Published 3 years ago
arjuna v1.0.17
Arjuna š
Death simple nodejs boilerplate & utility wrapper
ā Motivations
- Provide easy to use interfaces for nodejs application
- Standarize coding style among teams and applications
- Decrease repeatable things, write once run everywhere (DRY)
- Increase software quality by using well tested utility library
š Usage
Using npm
npm install arjuna
In NodeJS
/** file: app.js **/
const { Text } = require('arjuna');
const randomText2 = Text.random(30); //ifjaok89ewsmapxbgiodkap75nnmkvc
š Docs
Complete documentations are available here
Legends:
- āļø Available with test
- ā ļø Available without test (Use with your own risk š)
- ā Unavailable yet
- ā Ideation/request
Status | Facade | Method | Description |
---|---|---|---|
Datastore Package | |||
āļø | Redis | get | supported: redis |
āļø | set | ||
āļø | del | ||
āļø | expire | ||
āļø | increment | ||
āļø | decrement | ||
āļø | resetCounter | ||
āļø | flushCurrentDb | ||
āļø | Config | set | Set object data by a unique key into file |
āļø | get | get object data by a unique key from a file | |
āļø | all | get all object data from file | |
Log Package | |||
āļø | Log | report | supported: slack |
āļø | consoleReport | ||
āļø | localReport | ||
āļø | onlineReport | ||
ā | setConfig | ||
Manipulator Package | |||
āļø | Date | getFullDate | get date (Format: YYYY-MM-DD HH:mm:ss, Default: Current Date) |
āļø | getOnlyDate | get date (Format: YYYY-MM-DD, Default: Current Date) | |
āļø | moment | return moment instance | |
āļø | wait | ||
āļø | Html | encode | encode html tag into html entity |
āļø | decode | decode html entity into html tag | |
āļø | toText | convert html tag into plain text | |
āļø | Number | random | |
āļø | currency | ||
āļø | Text | random | |
āļø | isValidYoutubeUrl | ||
āļø | getYoutubeVideoId | ||
āļø | slugify | ||
āļø | uuid | ||
āļø | isValidUuid | ||
āļø | getUuidVersion | ||
āļø | mask | ||
āļø | Security | createRandomKey | |
āļø | createRandomSecret | ||
āļø | encrypt | ||
āļø | decrypt | ||
āļø | Object | renameKey | |
Network Package | |||
āļø | Event | publish | supported: rabbitmq |
āļø | subscribe | ||
āļø | enqueue | ||
āļø | dequeue | ||
āļø | Request | get | perform http get request |
āļø | post | perform http post request | |
āļø | put | perform http put request | |
āļø | patch | perform http patch request | |
āļø | delete | perform http delete request | |
āļø | multiple | perform multiple http request | |
āļø | Response | setCode | |
āļø | setStatus | ||
āļø | setMessage | ||
āļø | setData | ||
āļø | setError | ||
āļø | toObject | ||
āļø | toJson | ||
āļø | success | ||
āļø | error | ||
āļø | invalid | ||
āļø | forbidden | ||
āļø | notFound | ||
āļø | unauthenticate | ||
āļø | badGateway | ||
āļø | requestTimeout | ||
Pattern Package | |||
āļø | Command | execute | |
āļø | Query | get | |
āļø | Factory | create | |
āļø | Operation | run | |
āļø | Provider | register | |
āļø | Repository | all | |
āļø | get | ||
āļø | create | ||
āļø | first | ||
āļø | update | ||
āļø | delete | ||
āļø | insert | ||
āļø | findByIdentifier | ||
āļø | generateQueryFromParams | ||
āļø | getTransactionFromParams | ||
āļø | registerStaticFunctions | ||
āļø | registerStaticFunction | ||
āļø | getMethodNames | ||
ā | last | ||
Serialization Package | |||
āļø | Protobuf | encode | |
āļø | decode | ||
āļø | verify | ||
āļø | createSchema | ||
āļø | Base64 | encode | |
āļø | decode | ||
Structure Package | |||
āļø | Entity | setParams | set entity property from an object |
āļø | SqlModel | instance | |
āļø | registerDefaultStaticFunctions | ||
āļø | registerStaticFunctions | ||
āļø | createSqlModel | ||
āļø | getOption | ||
āļø | ViewModel | setParams | |
āļø | toObject | ||
āļø | toJson | ||
Unavailable packages - coming soon, maybe? | |||
ā | Controller | constructor | supported: express req/res |
ā | Middleware | validation | supported: express req/res |
ā | logger | ||
ā | monitoring | supported: prometheus | |
ā | Builder | build | |
ā | toObject | ||
ā | toJson |
āļø Test & Coverages
Running test without coverage + watchers
npm run test-minimal
Running test with coverage
npm run test
Running unit test
npm run test-unit
Running integration test (make sure you setup .env.test, check .env.example for more info)
npm run test-integration
Test Coverages
š Dependencies
1. Utility: moment, numeral, uuid, nodemon, lodash, body-parser, dotenv, protobufjs, slugify, html-entities, html-to-text
2. ORM: sequelize, mysql2, mongoose
3. Networking: axios
4. Messaging: amqplib
5. Security: bcryptjs, jsonwebtoken
6. Logging: morgan, rotating-file-stream
7. Testing: mocha, nyc, chai, chai-like, chai-things, supertest
š¤© Contributor
Feel free to contribute
š Support
This is open source project feel free to contributes and supporting us through: Idaman
š License
MIT