{"id":15366410,"url":"https://github.com/embbnux/koa-flash-message","last_synced_at":"2025-08-03T03:32:04.959Z","repository":{"id":57147442,"uuid":"81214836","full_name":"embbnux/koa-flash-message","owner":"embbnux","description":"Flash Messages Middleware For Koa","archived":false,"fork":false,"pushed_at":"2017-11-06T15:51:21.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-15T22:54:48.074Z","etag":null,"topics":["flash","flash-messages","koa"],"latest_commit_sha":null,"homepage":null,"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/embbnux.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}},"created_at":"2017-02-07T14:08:18.000Z","updated_at":"2019-01-29T12:03:10.000Z","dependencies_parsed_at":"2022-09-05T16:50:15.928Z","dependency_job_id":null,"html_url":"https://github.com/embbnux/koa-flash-message","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embbnux%2Fkoa-flash-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embbnux%2Fkoa-flash-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embbnux%2Fkoa-flash-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embbnux%2Fkoa-flash-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embbnux","download_url":"https://codeload.github.com/embbnux/koa-flash-message/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228520464,"owners_count":17932596,"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":["flash","flash-messages","koa"],"created_at":"2024-10-01T13:18:43.271Z","updated_at":"2024-12-06T20:11:42.052Z","avatar_url":"https://github.com/embbnux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-flash-message\n\n[![NPM Version](https://img.shields.io/npm/v/koa-flash-message.svg?style=flat-square)](https://www.npmjs.com/package/koa-flash-message)\n[![Build Status](https://travis-ci.org/embbnux/koa-flash-message.svg?branch=master)](https://travis-ci.org/embbnux/koa-flash-message)\n[![codecov](https://codecov.io/gh/embbnux/koa-flash-message/branch/master/graph/badge.svg)](https://codecov.io/gh/embbnux/koa-flash-message)\n\nFlash messages middleware for [koa](https://github.com/koajs/koa) v2 application.\n\n## Installation\n\n```\n$ npm install koa-flash-message\n```\n\nkoa-flash-message middleware depends on koa-generic-session. You must add koa-generic-session as a middleware prior to adding koa-flash-message\n\n## Example\n\n```\nimport Koa from 'koa';\nimport session from 'koa-generic-session';\nimport koaRedis from 'koa-redis';\nimport flashMessage from 'koa-flash-message';\nimport convert from 'koa-convert';\n\nconst redisStore = koaRedis({\n  url: config.redisUrl\n});\n\nconst app = new Koa();\n\napp.keys = [config.secretKeyBase];\napp.use(convert(session({\n  store: redisStore,\n  prefix: '__sess:',\n  key: '__sid'\n})));\n\napp.use(flashMessage);\n```\n\n### add message to flash messages\n\n```\nctx.flashMessage.warning = 'Log Out Successfully!';\n```\n\n### read all flash messages\n\n```\nctx.state.flashMessage.messages\n// or ctx.flashMessage.messages\n```\n\n### read warning message\n\n```\nctx.state.flashMessage.warning\n// or ctx.flashMessage.warning\n```\n\n[Full Example Code](https://github.com/embbnux/kails/blob/master/app/index.js)\n\n## Author\n\n* [Embbnux Ji](https://www.embbnux.com)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembbnux%2Fkoa-flash-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembbnux%2Fkoa-flash-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembbnux%2Fkoa-flash-message/lists"}