{"id":28509899,"url":"https://github.com/asaskevich/quark.io","last_synced_at":"2025-07-16T20:34:38.877Z","repository":{"id":25207524,"uuid":"28631455","full_name":"asaskevich/quark.io","owner":"asaskevich","description":"[JavaScript] The minimalistic web framework for creating small and beautiful HTTP servers.","archived":false,"fork":false,"pushed_at":"2024-04-15T19:43:05.000Z","size":25,"stargazers_count":20,"open_issues_count":8,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-03T01:34:50.279Z","etag":null,"topics":["javascript","nodejs"],"latest_commit_sha":null,"homepage":"","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/asaskevich.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-12-30T13:17:06.000Z","updated_at":"2023-04-16T23:51:50.000Z","dependencies_parsed_at":"2025-07-03T01:41:43.274Z","dependency_job_id":null,"html_url":"https://github.com/asaskevich/quark.io","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/asaskevich/quark.io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaskevich%2Fquark.io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaskevich%2Fquark.io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaskevich%2Fquark.io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaskevich%2Fquark.io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asaskevich","download_url":"https://codeload.github.com/asaskevich/quark.io/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaskevich%2Fquark.io/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265538510,"owners_count":23784610,"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":["javascript","nodejs"],"created_at":"2025-06-08T22:37:37.767Z","updated_at":"2025-07-16T20:34:38.834Z","avatar_url":"https://github.com/asaskevich.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"quark.io - minimalistic web framework for Node.js\n======\n[![npm version](https://badge.fury.io/js/quark.io.svg)](http://badge.fury.io/js/quark.io)\n\n**quark.io** is the minimalistic web framework for creating small and beautiful HTTP servers.\n\n#### Main features\n* Small number of 3rd party dependencies\n* Easy routing\n* Jade support\n* Static file serving\n* Middleware support\n\n#### Installation\nJust run `npm install quark.io`\n\n#### Hello World Server\n\n```js\nvar quark = require('./quark.io');\n\nvar app = new quark({\n    port: 3002\n});\n\napp.get('/', function(req, res) {\n    res.ok('Hello, World!')\n});\n\napp.start();\n```\n\n#### More examples\nFor more examples look at the `examples` directory of the repository.\n\n#### Creating a new server\n\n```js\nvar quark = require('./quark.io');\n\nvar app = new quark({\n    port: 3002, // Listening port, by default 8888\n    debug: true, // Debug mode, will produce more output to the logger\n    statics: ['public/', 'uploads/'], // Static directories, this array by default empty.\n    logger: \u003c Any logger that has similar methods as console \u003e, // By default output goes to the console\n    renderTemplate: \u003c Any callback function that acts as 'jade.render' \u003e, // By default used 'jade.render'\n    renderFile: \u003c Any callback function that acts as 'jade.renderFile' \u003e, // By default used 'jade.renderFile'\n});\n```\n\n#### Routing\n\nSimple routes:\n\n```js\napp.get('/', function(req, res) { ... });\napp.post('/user/save', function(req, res) { ... });\napp.put('/user/update', function(req, res) { ... });\napp.delete('/user/remove', function(req, res) { ... });\n```\n\nRoutes with arguments (argument names in the route **should be** the same as the function's arguments' names):\n\n```js\napp.get('/topics/:topicId/message/:message', function(req, res, topicId, message) { ... });\napp.post('/user/:userId/send/:message', function(req, res, userId, message) { ... });\n```\n\n#### Middleware\n\n```js\nfunction middleware(req, res) {\n    console.log('Middleware active!');\n};\n\nfunction anotherMiddleware(req, res) {\n    console.log('Another middleware active!');\n};\n\napp.get('/', function(req, res) { ... }, middleware, anotherMiddleware);\n```\n\n#### Requests and responses\nRequests and responses are fully compatible with the native node.js implementation. But the response object has some additional methods:\n\n```js\nres.send(data, [code, [headers]]);\nres.fail(data, [headers]);\nres.ok(data, [headers]);\nres.text(data, [headers]);\nres.html(data, [headers]);\nres.json(data, [headers]);\nres.redirect(data, [redirectUrl, [headers]]);\nres.render(template, options);\nres.renderFile(fileName, options);\n```\n\n#### Performance\nFramework's performance tested with Apache Benchmark (all scripts and results inside `benchmark/` directory).\n\n![Results](benchmark/benchmark.png)\n\n#### Support\nIf you do have a contribution for the package feel free to make a pull request or open an issue.\n\n\n[![NPM](https://nodei.co/npm/quark.io.png)](https://nodei.co/npm/quark.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasaskevich%2Fquark.io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasaskevich%2Fquark.io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasaskevich%2Fquark.io/lists"}