{"id":13414903,"url":"https://github.com/expressjs/flash","last_synced_at":"2025-05-07T17:48:18.322Z","repository":{"id":20401158,"uuid":"23677178","full_name":"expressjs/flash","owner":"expressjs","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-28T19:30:43.000Z","size":161,"stargazers_count":92,"open_issues_count":10,"forks_count":21,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-28T02:18:56.530Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/expressjs.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":"2014-09-04T19:56:18.000Z","updated_at":"2025-04-01T13:53:55.000Z","dependencies_parsed_at":"2022-07-25T07:47:08.009Z","dependency_job_id":null,"html_url":"https://github.com/expressjs/flash","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressjs%2Fflash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressjs%2Fflash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressjs%2Fflash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expressjs%2Fflash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/expressjs","download_url":"https://codeload.github.com/expressjs/flash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252930700,"owners_count":21827101,"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-07-30T21:00:39.586Z","updated_at":"2025-05-07T17:48:18.293Z","avatar_url":"https://github.com/expressjs.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\n# flash\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nThe simplest flash implementation for Express.\n\n## Usage\n\n```bash\nnpm i flash\n```\n\n```js\napp.use(session()); // session middleware\napp.use(require('flash')());\n\napp.use(function (req, res) {\n  // flash a message\n  req.flash('info', 'hello!');\n  next();\n})\n```\n\n```jade\nfor message in flash\n  a.alert(class='alert-' + message.type)\n    p= message.message\n```\n\n```jade\nwhile message = flash.shift() // consume messages as jade reads them\n  a.alert(class='alert-' + message.type)\n    p= message.message\n```\n\n## API\n\n### req.flash([type], msg)\n\nFlash a message defaulting the `type` to `info`.\n\n### res.locals.flash\n\nAn array of flash messages of the form:\n\n```json\n{\n  \"type\": \"info\",\n  \"message\": \"message\"\n}\n```\n\n[npm-image]: https://img.shields.io/npm/v/flash.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/flash\n[github-tag]: http://img.shields.io/github/tag/expressjs/flash.svg?style=flat-square\n[github-url]: https://github.com/expressjs/flash/tags\n[travis-image]: https://img.shields.io/travis/expressjs/flash.svg?style=flat-square\n[travis-url]: https://travis-ci.org/expressjs/flash\n[coveralls-image]: https://img.shields.io/coveralls/expressjs/flash.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/expressjs/flash?branch=master\n[david-image]: http://img.shields.io/david/expressjs/flash.svg?style=flat-square\n[david-url]: https://david-dm.org/expressjs/flash\n[license-image]: http://img.shields.io/npm/l/flash.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/flash.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/flash\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/jonathanong/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpressjs%2Fflash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpressjs%2Fflash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpressjs%2Fflash/lists"}