{"id":16241495,"url":"https://github.com/rajatady/reduxpress","last_synced_at":"2025-03-19T17:30:33.527Z","repository":{"id":7111119,"uuid":"137186891","full_name":"rajatady/Reduxpress","owner":"rajatady","description":"A utility framework built on top of expressJS to provide single line abstractions for commonly used tasks.","archived":false,"fork":false,"pushed_at":"2022-12-22T09:23:06.000Z","size":835,"stargazers_count":4,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-11T14:07:37.101Z","etag":null,"topics":["expressjs","logging","metrics","nodejs"],"latest_commit_sha":null,"homepage":"https://rajatady.github.io/Reduxpress/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rajatady.png","metadata":{"files":{"readme":"README.hbs","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-13T08:35:20.000Z","updated_at":"2024-04-24T13:25:30.000Z","dependencies_parsed_at":"2023-01-13T14:16:29.575Z","dependency_job_id":null,"html_url":"https://github.com/rajatady/Reduxpress","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajatady%2FReduxpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajatady%2FReduxpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajatady%2FReduxpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajatady%2FReduxpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajatady","download_url":"https://codeload.github.com/rajatady/Reduxpress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221729376,"owners_count":16871005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","logging","metrics","nodejs"],"created_at":"2024-10-10T14:07:49.011Z","updated_at":"2024-10-27T20:25:48.280Z","avatar_url":"https://github.com/rajatady.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eReduxpress\u003c/h1\u003e\n\u003chr\u003e\n\nA utility framework built on top of [expressJS] to provide single line implementations for commonly used tasks.\n\n[![view on npm](https://img.shields.io/npm/v/reduxpress.svg)](https://www.npmjs.org/package/reduxpress)\n[![view on npm](https://img.shields.io/npm/dm/reduxpress.svg)](https://www.npmjs.org/package/reduxpress)\n\n***\n\nIt provides the following functionality\n* Request Validation\n* Formatted Console Logs\n* Authentication\n* Response Handling\n* Error Handling\n* Object Logging in File or DB\n\n### Example Usage\n\n1. Install the reduxpress module\n\n* `npm i reduxpress --save`\n\n2. Configure the module before the endpoints\n\n```javascript\n// server.js\n\nimport reduxpress from 'reduxpress'\n// var reduxpress = require('reduxpress')\nimport api from './api';\n// var api = require('./api');\n\n...\n\nreduxpress.setOptions({\n    saveTrace : true,\n    // default - false | Flag to save the data generated with each request,\n    secret : '\u003cYOUR JWT SECRET HERE\u003e'\n})\n\n    ...\n```\n\n3. Mount the object as a middleware before the endpoints you want to have reduxpress included in\n\n```javascript\n// server.js\n\n...\napp.use(reduxpress.mount);\n// OR app.use('/api', reduxpress.mount);\n\n...\n\napp.post('/api', api);\n\n...\n\n```\n\n4. Access the redux object from the request object directly. Each redux object is unique and is saved separately for all the incoming requests\n\n```javascript\n// api.js\n\nmodule.exports = function(request, response) {\n    var redux = request.redux;\n\n    redux\n        .bodyValidator(response, ['name', '^email'])\n        .then(function(body) {\n            // body should now contain name property and an optional email\n            redux.sendSuccess(response, body, 'body');\n        })\n        .catch(function(err) {\n            // if the name property is not present in the body of the request, an error will be thrown\n            redux.sendError(response, err);\n        })\n}\n\n```\n\n\n    {{\u003emain}}\n\n* * *\n\n\u003ch2\u003eLICENSE\u003c/h2\u003e\nMIT License\n\nCopyright (c) 2017-2018 Kumar DIvya Rajat\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n[expressJS]: (https://github.com/expressjs/express)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajatady%2Freduxpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajatady%2Freduxpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajatady%2Freduxpress/lists"}