{"id":18483717,"url":"https://github.com/ashetm/npm-cont_roller","last_synced_at":"2025-05-13T20:35:18.369Z","repository":{"id":47931097,"uuid":"226829861","full_name":"AsheTM/npm-cont_roller","owner":"AsheTM","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-05T02:37:30.000Z","size":165,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-25T14:07:21.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AsheTM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-09T09:09:26.000Z","updated_at":"2020-07-16T23:08:04.000Z","dependencies_parsed_at":"2023-02-03T06:31:36.726Z","dependency_job_id":null,"html_url":"https://github.com/AsheTM/npm-cont_roller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsheTM%2Fnpm-cont_roller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsheTM%2Fnpm-cont_roller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsheTM%2Fnpm-cont_roller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsheTM%2Fnpm-cont_roller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AsheTM","download_url":"https://codeload.github.com/AsheTM/npm-cont_roller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239201384,"owners_count":19599074,"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":[],"created_at":"2024-11-06T12:37:01.526Z","updated_at":"2025-02-16T21:31:37.787Z","avatar_url":"https://github.com/AsheTM.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cont Roller\n=============\n\nA library for ExpressJS to simplify controller function.\n\n\n\nInstallation\n------------\n\nTo use with node:\n\n```bash\n$ npm install --save cont_roller\n```\n\n\n\nUsage\n-----------------\n\nThen in server side with ExpressJS:\n\n```javascript\n...\nconst $ = require('cont_roller');\n...\nconst cont = $((req, options) =\u003e {\n    // Do something\n    req;        // Request\n    options;    // Options\n    options.__headers__ =   { /* Some headers*/ };\n    options.__cookies__ =   [\n        {\n            name:       'Cookie name', \n            value:      'Cookie value', \n            options:    {\n                // Same options as cookie method in res.cookie\n            }\n        }\n    ];\n    options.__contentType__ ='json'; // Only 'json' value supported\n    return {/* Return datas like res.send(...) or res.json(...) */\n        data: ['...']\n    };\n})._200().if((req, data) =\u003e {\n    let check = true;\n    // Do some check\n    req;            // Request\n    data;           // Data returned from the callback of $; \n                    // Its value in this example { data: ['...'] }\n    return check;   // Return a Boolean value\n})._500({/* Data to send when an error is catched or \n            when the callback of if method return false */\n    error:  'Sample Error Message'\n});\n...\nrouter.get('/test', cont);\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashetm%2Fnpm-cont_roller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashetm%2Fnpm-cont_roller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashetm%2Fnpm-cont_roller/lists"}