{"id":24802728,"url":"https://github.com/kevinbalicot/yion","last_synced_at":"2025-10-13T04:30:58.651Z","repository":{"id":57403794,"uuid":"75186817","full_name":"kevinbalicot/yion","owner":"kevinbalicot","description":"The most yionly node framework","archived":false,"fork":false,"pushed_at":"2024-03-20T13:35:18.000Z","size":94,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-30T22:46:45.528Z","etag":null,"topics":["framework","javascript","nodejs","tiny"],"latest_commit_sha":null,"homepage":"https://kevinbalicot.github.io/yion/","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/kevinbalicot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2016-11-30T12:55:08.000Z","updated_at":"2025-06-03T08:48:28.000Z","dependencies_parsed_at":"2024-03-20T14:53:24.598Z","dependency_job_id":null,"html_url":"https://github.com/kevinbalicot/yion","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/kevinbalicot/yion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbalicot%2Fyion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbalicot%2Fyion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbalicot%2Fyion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbalicot%2Fyion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinbalicot","download_url":"https://codeload.github.com/kevinbalicot/yion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbalicot%2Fyion/sbom","scorecard":{"id":556882,"data":{"date":"2025-08-11","repo":{"name":"github.com/kevinbalicot/yion","commit":"65389cd64ae7a7d5bef30e611c043b5830a4471e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T12:36:59.281Z","repository_id":57403794,"created_at":"2025-08-20T12:36:59.281Z","updated_at":"2025-08-20T12:36:59.281Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013688,"owners_count":26085390,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["framework","javascript","nodejs","tiny"],"created_at":"2025-01-30T05:16:09.398Z","updated_at":"2025-10-13T04:30:58.349Z","avatar_url":"https://github.com/kevinbalicot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YION\n\nThe most yionly (lighter, maybe ...) node framework.\n\n## Installation\n\n```\n$ npm install --save yion\n```\n\n## Usage\n\nBootstrap\n\n```javascript\nconst { createApp, createServer } = require('yion');\n\nconst app = createApp();\nconst server = createServer(app);\n\napp.get('/', (req, res) =\u003e {\n    res.set('Content-Type', 'text/html; charset=utf-8').send('Hello world!');\n});\n\nserver.listen(8080);\n```\n\n### Router\n\n * `app.get(pattern, callback);`\n * `app.post(pattern, callback);`\n * `app.put(pattern, callback);`\n * `app.delete(pattern, callback);`\n * `app.patch(pattern, callback);`\n\n#### Parameters\n\n```javascript\napp.get('/article/:id', (res, res) =\u003e {\n    let id = req.params.id;\n});\n```\n\nYou can use regexp like this\n\n```javascript\napp.get('/article/:id([0-9]{2})', (res, res) =\u003e {\n    let id = req.params.id;\n});\n```\n\nAnd of course both\n\n```javascript\napp.get('/article/:id([0-9]{2})/:name', (res, res) =\u003e {\n    let id = req.params.id;\n    let name = req.params.name;\n});\n```\n\n#### Body\n\n```javascript\napp.post('/article', (res, res) =\u003e {\n    let title = req.body.title || null;\n    let content = req.body.content || null;\n});\n```\nNote : The body parser is very simple, it parse only `x-www-form-urlencoded` data. Please see [https://www.npmjs.com/package/yion-body-parser](https://www.npmjs.com/package/yion-body-parser) for more features\n\n#### Queries\n\n```javascript\n// GET /articles?order=title\u0026direction=asc\n\napp.get('/article', (res, res) =\u003e {\n    let order = req.query.order || 'created_at';\n    let direction = req.query.direction || 'desc';\n});\n```\n\n### Middlewares\n\n```javascript\napp.use((req, res, next) =\u003e {\n    // do stuff\n\n    next();\n});\n```\nYou can pass arguments to next middleware.\n\n```javascript\napp.use((req, res, next) =\u003e {\n    // do stuff\n\n    next('foo', { foo: 'bar' });\n});\n\napp.get('/', (req, res, next, arg1, arg2) =\u003e {\n    console.log(arg1); // 'foo'\n    console.log(arg2); // { foo: 'bar' }\n\n    // do stuff\n});\n```\n\nEvery thing is a middleware\n\n```js\napp.get('/', (req, res, next) =\u003e {\n    next({ foo: 'bar' });\n});\n\napp.get('/', (req, res, next, foo) =\u003e {\n    res.send(foo); // 'bar'\n});\n```\n\n### Assets\n\n```javascript\napp.link('/css', __dirname + '/styles');\napp.link('/js', __dirname + '/js');\napp.link('/img', __dirname + '/images');\n```\n\nNow you can type into HTML file\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003clink rel=\"stylesheet\" href=\"/css/main.css\"\u003e\n        \u003cscript type=\"text/javascript\" src=\"/js/main.js\"\u003e\u003c/script\u003e\n    \u003c/head\u003e\n\u003c/html\u003e\n```\n\nYou can add header at response\n\n```javascript\nconst cache = { 'Cache-Control': 'public, max-age=600' };\n\napp.link('/css', __dirname + '/styles'); // no cache\napp.link('/js', __dirname + '/js', cache); // add cache control\napp.link('/img', __dirname + '/images', cache); // add cache control\n```\n\n### Plugins\n\n```javascript\nconst { createApp, createServer } = require('yion');\nconst bodyparserPlugin = require('yion-body-parser');\n\nconst app = createApp();\nconst server = createServer(app, [bodyparserPlugin]);\n\napp.post('/file', (req, res) =\u003e {\n    if (!req.body.file) {\n        return res.status(500).send();\n    }\n\n    const file = req.body.file;\n    res.sendFile(file.filepath, file.filename, file.mimetype);\n});\n\nserver.listen(8080);\n```\n\nIf you want to create a plugin, make a simple object with a `handle` function.\n\nThere are 2 types of plugin :\n\nPlugin handles POST/GET request, example (⚠️  type has to be `post`):\n```js\nconst myPostPlugin = {\n    type: 'post',\n    handle: (req, res, app) =\u003e {\n        const request = req.original; // get Node Request\n        if (request.method === 'POST') {\n            // make stuff\n        }\n\n        app.dispatch(req, res); // dispatch request, plugins loop stop\n    }\n};\n```\n\nAnd plugin add features into application, example :\n\n```js\nconst moment = require('moment');\n\nconst myMomentPlugin = {\n    type: 'whatever',\n    handle: (req, res, app, next) =\u003e {\n        app.moment = (date) =\u003e moment(date);\n\n        next(); // use next callback to call next plugin\n\n        // don't use app.dispatch(), because other plugins need to be launched\n    }\n};\n```\n\nAnd into your Yion application\n\n```js\napp.get('/what-time-is-it', (req, res, app) =\u003e {\n    res.send(app.moment().format());\n});\n```\n\n#### Plugins :\n\n* `yion-body-parser` : Body parser [https://www.npmjs.com/package/yion-body-parser](https://www.npmjs.com/package/yion-body-parser)\n* `yion-pug` : Pug plugin (add `res.render(filename, data)`) [https://www.npmjs.com/package/yion-pug](https://www.npmjs.com/package/yion-pug)\n* `yion-oauth` : Oauth2 plugin [https://www.npmjs.com/package/yion-oauth](https://www.npmjs.com/package/yion-oauth)\n\n### Documentations and API Reference\n\nYou can see documentations [here](https://github.com/kevinbalicot/yion/blob/master/docs/documentations.md). Full API reference [here](https://kevinbalicot.github.io/yion/#api). Also see [yion websie](https://kevinbalicot.github.io/yion/)\n\n#### Factories\n\n* `createApp()` : create a new application\n* `createServer(app, [])` : create a new server with an application and an array of plugins (optional)\n\n#### Request\n\n * `req.has(key)` : check if there are parameter or attribute with `key`\n * `req.get(key)` : get value of parameter or attribute with `key`\n\n#### Response\n\n * `res.status(code, message = null)` : change HTTP status\n * `res.set(key, value)` : set HTTP header\n * `res.write(message, encoding = 'utf-8')` : add content into HTTP response body\n * `res.send(data = null, encoding = 'utf-8')` : send response\n * `res.json(data, encoding = 'utf-8')` : send json response\n * `res.redirect(location, code = 301)` : send redirect response\n * `res.sendFile(filepath, filename, mimetype = \"text/plain\", attachment = true)` : Send file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinbalicot%2Fyion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinbalicot%2Fyion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinbalicot%2Fyion/lists"}