{"_id":"koa-better-flash","_rev":"7-89bb75bed6662e5693894697d06e8afa","name":"koa-better-flash","time":{"modified":"2022-05-07T09:39:27.196Z","created":"2017-09-04T23:59:10.689Z","0.0.1":"2017-09-04T23:59:10.689Z","0.0.2":"2017-09-05T00:14:12.446Z","0.0.3":"2017-09-05T00:25:38.214Z","0.0.4":"2019-12-10T06:58:44.180Z"},"maintainers":[{"email":"niftylettuce@gmail.com","name":"niftylettuce"},{"email":"npm@titanism.com","name":"titanism"}],"dist-tags":{"latest":"0.0.4"},"description":"Flash message middleware for Koa and Passport","readme":"# koa-better-flash\n\n[![build status](https://semaphoreci.com/api/v1/niftylettuce/koa-better-flash/branches/master/shields_badge.svg)](https://semaphoreci.com/niftylettuce/koa-better-flash)\n[![code coverage](https://img.shields.io/codecov/c/github/niftylettuce/koa-better-flash.svg)](https://codecov.io/gh/niftylettuce/koa-better-flash)\n[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://github.com/lassjs/lass)\n[![license](https://img.shields.io/github/license/niftylettuce/koa-better-flash.svg)](<>)\n\n> Flash message middleware for Koa and Passport\n\n\n## Table of Contents\n\n* [Install](#install)\n* [Usage](#usage)\n* [Contributors](#contributors)\n* [License](#license)\n\n\n## Install\n\n[npm][]:\n\n```sh\nnpm install koa-better-flash\n```\n\n[yarn][]:\n\n```sh\nyarn add koa-better-flash\n```\n\n\n## Usage\n\n```js\nconst Koa = require('koa');\nconst Router = require('koa-router');\nconst session = require('koa-generic-session');\nconst flash = require('koa-better-flash');\n\nconst app = new Koa();\nconst router = new Router();\n\nrouter.post('/', (ctx, next) => {\n  // you can also pass an array of messages:\n  // ctx.flash('info', [ 'hi', 'hello', 'good morning' ]);\n  ctx.flash('info', 'hello world');\n  ctx.status = 200;\n});\n\nrouter.get('/', ctx => {\n  // to get all messages by type simply call `ctx.flash()`\n  ctx.body = ctx.flash('info');\n  // outputs: [ 'hello world ']\n});\n\napp.keys = [ 'keys' ];\napp.use(session());\napp.use(flash());\napp.use(router.routes());\napp.listen();\n```\n\n\n## Contributors\n\n| Name           | Website                    |\n| -------------- | -------------------------- |\n| **Nick Baugh** | <http://niftylettuce.com/> |\n\n\n## License\n\n[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)\n\n\n## \n\n[npm]: https://www.npmjs.com/\n\n[yarn]: https://yarnpkg.com/\n","versions":{"0.0.3":{"name":"koa-better-flash","description":"Flash message middleware for Koa and Passport","version":"0.0.3","author":{"name":"Nick Baugh","email":"niftylettuce@gmail.com","url":"http://niftylettuce.com/"},"bugs":{"url":"https://github.com/niftylettuce/koa-better-flash/issues","email":"niftylettuce@gmail.com"},"contributors":[{"name":"Nick Baugh","email":"niftylettuce@gmail.com","url":"http://niftylettuce.com/"}],"dependencies":{},"devDependencies":{"ava":"^0.22.0","codecov":"^2.3.0","cross-env":"^5.0.5","eslint":"^4.5.0","eslint-config-prettier":"^2.3.0","eslint-plugin-prettier":"^2.2.0","husky":"^0.14.3","koa":"^2.3.0","koa-generic-session":"^2.0.0","koa-router":"^7.2.1","lint-staged":"^4.0.4","nyc":"^11.1.0","prettier":"^1.6.1","remark-cli":"^4.0.0","remark-preset-github":"^0.0.5","supertest":"^3.0.0","xo":"^0.19.0"},"engines":{"node":">=8.x"},"homepage":"https://github.com/niftylettuce/koa-better-flash","keywords":["connect","cookie","cookies","express","flash","info","koa-better-flash","kue","lass","messaging","node","queue","redis","sessions"],"license":"MIT","lint-staged":{"*.{js,jsx,mjs,ts,tsx,css,less,scss,json,graphql}":["prettier --write --single-quote --trailing-comma none","git add"],"*.md":["remark . -qfo","git add"]},"main":"index.js","nyc":{"reporter":["lcov","html","text"]},"remarkConfig":{"plugins":["preset-github"]},"repository":{"type":"git","url":"git+https://github.com/niftylettuce/koa-better-flash.git"},"scripts":{"coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","lint":"xo && remark . -qfo","precommit":"lint-staged && npm test","test":"npm run lint && npm run test-coverage","test-coverage":"cross-env NODE_ENV=test nyc ava"},"xo":{"extends":"prettier","plugins":["prettier"],"rules":{"prettier/prettier":["error",{"singleQuote":true,"bracketSpacing":true,"trailingComma":"none"}],"max-len":["error",{"code":80,"ignoreUrls":true}],"capitalized-comments":"off","camelcase":"off","no-warning-comments":"off"},"space":true},"gitHead":"0f9af53bc0c1f5bac7199c47102a0597bb98e9d5","_id":"koa-better-flash@0.0.3","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"niftylettuce","email":"niftylettuce@gmail.com"},"dist":{"integrity":"sha512-p9uCfBejEEV5YJP28mB+4W8FREsE/407nQaSjjdjgP4MOFECzNqbcgib7XmRhHsuwGS9EQZe+uB3DKKOVPzG5Q==","shasum":"4bfb1829f0f927e5a775770ea0ca0fa9440d8df0","tarball":"https://registry.npmjs.org/koa-better-flash/-/koa-better-flash-0.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEW6misnaOw2xaQ8CMBSQJGPdNWcVwh4CH4Lv3aqhUt5AiBYvZYkuzC2mn9dbiED7m0sXGOEt8Kf5H7orPc35PWjKw=="}]},"maintainers":[{"name":"niftylettuce","email":"niftylettuce@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-better-flash-0.0.3.tgz_1504571137040_0.5783600644208491"},"directories":{}},"0.0.4":{"name":"koa-better-flash","description":"Flash message middleware for Koa and Passport","version":"0.0.4","author":{"name":"Nick Baugh","email":"niftylettuce@gmail.com","url":"http://niftylettuce.com/"},"bugs":{"url":"https://github.com/niftylettuce/koa-better-flash/issues","email":"niftylettuce@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"contributors":[{"name":"Nick Baugh","email":"niftylettuce@gmail.com","url":"http://niftylettuce.com/"}],"dependencies":{},"devDependencies":{"@commitlint/cli":"latest","@commitlint/config-conventional":"latest","@koa/router":"^8.0.3","ava":"latest","codecov":"latest","cross-env":"latest","eslint":"latest","eslint-config-xo-lass":"latest","fixpack":"latest","husky":"latest","koa":"^2.11.0","koa-generic-session":"^2.0.1","lint-staged":"latest","nyc":"latest","remark-cli":"latest","remark-preset-github":"latest","supertest":"^4.0.2","xo":"latest"},"engines":{"node":">=8.x"},"homepage":"https://github.com/niftylettuce/koa-better-flash","husky":{"hooks":{"pre-commit":"lint-staged && npm test","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"keywords":["connect","cookie","cookies","express","flash","info","koa-better-flash","kue","lass","messaging","node","queue","redis","sessions"],"license":"MIT","lint-staged":{"*.js":["xo --fix","git add"],"*.md":["remark . -qfo","git add"],"package.json":["fixpack","git add"]},"main":"index.js","prettier":{"singleQuote":true,"bracketSpacing":true,"trailingComma":"none"},"remarkConfig":{"plugins":["preset-github"]},"repository":{"type":"git","url":"https://github.com/niftylettuce/koa-better-flash"},"scripts":{"ava":"cross-env NODE_ENV=test ava","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","lint":"xo && remark . -qfo","nyc":"cross-env NODE_ENV=test nyc ava","test":"npm run lint && npm run ava","test-coverage":"npm run lint && npm run nyc"},"xo":{"prettier":true,"space":true,"extends":["xo-lass"]},"licenseText":"MIT License\n\nCopyright (c) 2017 Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"koa-better-flash@0.0.4","dist":{"shasum":"e052379c5dafbbbfd2d0ce31e7528d99d7b27569","integrity":"sha512-EhsyNsPG2xSk/NUgHzq2ypsewdaRvQLtrzTxY0rXi9XeV3TPHkN2HR5eWotF42/Mg6aOTJ73WzfWyMFnbRLkRw==","tarball":"https://registry.npmjs.org/koa-better-flash/-/koa-better-flash-0.0.4.tgz","fileCount":11,"unpackedSize":10206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd70IkCRA9TVsSAnZWagAAumoQAJ8UthoySPIOGJ66rHuz\nC6VIyFLOiByplKKx+J2G0McDH/joegQVYMlinkzKHi80/GW6e6+RiMzQRqE4\nL1JRUfI6Y1ZU9dEgHcgzKrDOHuPzQ06lzLJ+4ATl1vzg8V8jfCfmLHEqaveg\nAGkIksRCCgXxzWSK0xTq9dX3fMEEquJxCO74xq+TS1Kt5JQQpqGfQGD2AJny\n5P8VNmP6/8pK4YkV+t0Q/juGC50q5Sud8ZQOzTvsLuYrhvpgjSyIIXaPmvoz\n2nGC3LyWn1tqRAFiEBqxO2xd6KOQaUan0jtZ4/VDPazcGJsYO17clDdmpBk/\nYgVF4W98SbqoQ9IKpdM2ckVzdefuQPHZyGUKhZivdFXZz1Q8GHx5Nlg+lhyB\nOk1w+By62Eny0Pld+GWZx0baBdf3DQBpqmxnGkFmfSylzu2abZZV0ogzAs5y\n1EqfBwSPh/YFoq8wk9DHIESIf5Sbyv8kZOwjK2SQu7Gz+RhELVHgwfDKkJWI\nRskeiLTk9po+MBMixNbJJ4CtH8c+Okmi+wpIzmp6DwzmMlk9nBr3DwQFdogM\n6/LcTHmZWpHqDVHO72Ok31K707A+Qg2OtCCRHkPaykiXVZC4ppGYT56GIytS\nYShYYZH85cwopFsDsETL9/P8+gYtokUOVk5A1Dmuap7f5GfZSwA24iC0DXnX\nB3R3\r\n=cXJ9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwSTQgTvt9W39sr0qv62OCKdPeGyN7LiVfsKmYfcrFQgIgUpwm/f1vGFUn7zJMfs1uePrRGtIaOBT4O13lJMdtJqA="}]},"maintainers":[{"name":"niftylettuce","email":"niftylettuce@gmail.com"}],"_npmUser":{"name":"niftylettuce","email":"niftylettuce@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-better-flash_0.0.4_1575961124056_0.6410102326195957"},"_hasShrinkwrap":false}},"homepage":"https://github.com/niftylettuce/koa-better-flash","keywords":["connect","cookie","cookies","express","flash","info","koa-better-flash","kue","lass","messaging","node","queue","redis","sessions"],"repository":{"type":"git","url":"https://github.com/niftylettuce/koa-better-flash"},"contributors":[{"name":"Nick Baugh","email":"niftylettuce@gmail.com","url":"http://niftylettuce.com/"}],"author":{"name":"Nick Baugh","email":"niftylettuce@gmail.com","url":"http://niftylettuce.com/"},"bugs":{"url":"https://github.com/niftylettuce/koa-better-flash/issues","email":"niftylettuce@gmail.com"},"license":"MIT","readmeFilename":"README.md"}