Giter Club home page Giter Club logo

body-parsers's Introduction

Koa Body Parsers

NPM version Build status Test coverage Greenkeeper badge Dependency Status License Downloads

A more functional version of body parsing. Use this module if you want to "lazily" parse the body. Other middleware automatically parse the body in the middleware chain, which might not be ideal as business logic like authentication, authorization, and routing are not done prior to body parsing.

Includes a json and urlencoded parsers, as well as a utility to save streams to disk.

See https://github.com/koajs/koala/blob/master/docs/body-parsing.md for more details.

body-parsers's People

Contributors

cmd-johnson avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hiroppy avatar jonathanong avatar tunnckocore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

body-parsers's Issues

use eslint-config-koa

I want to use eslint-config-koa because koajs/koa uses it.

If we use it now, the following error will occur.

semi
arrow-parens
space-before-function-paren
padded-blocks

✖ 169 problems (169 errors, 0 warnings)

@jonathanong What do you think?

docs

need docs that isn't part of koala as i haven't touched koala in a while

An in-range update of supertest is breaking the build 🚨

Version 3.3.0 of supertest was just published.

Branch Build failing 🚨
Dependency supertest
Current Version 3.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

supertest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).
  • coverage/coveralls: First build on greenkeeper/supertest-3.3.0 at 91.837% (Details).

Release Notes v3.3.0

#509 - Fix #486, bug in _assertBody, switch to deepStrictEqual (thanks @mikelax)
#510 - Refactor test files to use const/let (thanks @rimiti)

Commits

The new version differs by 10 commits.

  • e910e85 chore: Prepare for v3.3.0 release.
  • bd864de Merge pull request #511 from visionmedia/bugfix-486-equal
  • 101fbf5 Merge branch 'master' into bugfix-486-equal
  • 04230bb Merge pull request #510 from visionmedia/refact-const-let
  • 510a7ae bugfix: 486 Change method to use deepStrictEqual. (#509)
  • 913150d chore(.editorconfig) [*.md] block removed
  • 82e0828 refact(test/supertest.js) vars replaced by const and let
  • 5443136 chore(.editorconfig) configuration file created
  • 7233ba6 chore(.eslintrc) parserOptions option added to use es6
  • 322ebf6 bugfix: 486 Change method to use deepStrictEqual.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of koa is breaking the build 🚨

Version 2.4.1 of koa was just published.

Branch Build failing 🚨
Dependency koa
Current Version 2.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

koa is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • coverage/coveralls Coverage pending from Coveralls.io Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 28 commits.

  • bd89dfc 2.4.1
  • 418bb06 2.4.0 – added missing 2.3.0 changelog
  • c68a696 2.3.0
  • 687b732 travis: test node@9
  • 53a4446 expose the Application::handleRequest method (#950)
  • 85ff544 deps: update min engines (#1040)
  • 6029064 HTTP/2 has no status message (#1048) (#1049)
  • 18e4faf Update fresh to ^0.5.2 to close vulnerability (#1086)
  • e8a024c docs: ddd Chinese docs link for v2.x (#1092)
  • 1e81ea3 docs: update babel setup (#1077)
  • 43a1df8 test: Remove --forceExit flag for Jest (#1071)
  • 0168fd8 docs: Update middleware.gif (#1052)
  • e1e030c docs: command is wrong for running tests (#1065)
  • 77ca429 test: replace request(app.listen()) with request(app.callback())
  • 7f577af meta: update AUTHORS (#1067)

There are 28 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

remove `fs-cp`?

Why it is there? Everyone can add it and use it directly, if he want it. This also blocks using this package in plugins, like

var bodyParsers = require('koa-body-parsers')
var koa = require('koa')
var app = koa()

app.use(function * () {
  bodyParsers(this)
})
.use(function * () {
  this.body = yield this.request.json()
})

for example - i need it this way, because I'm going to use it in plugin that wraps these things.

Fails to set .save on app.context

TypeError: Cannot set property 'save' of undefined
      at /home/charlike/dev/final/koa-better-body/node_modules/koa-body-parsers/index.js:18:22
      at Array.forEach (native)
      at Function.module.exports.Object.keys.forEach.Object.keys.forEach.Object.keys.forEach (/home/charlike/dev/final/koa-better-body/node_modules/koa-body-parsers/index.js:17:24)
      at Object.plugin (/home/charlike/dev/final/koa-better-body/index.js:21:11)
      at next (native)
      at Object.<anonymous> (/home/charlike/dev/final/koa-better-body/node_modules/koa-compose/index.js:28:12)
      at next (native)
      at onFulfilled (/home/charlike/dev/final/koa-better-body/node_modules/co/index.js:65:19)
      at /home/charlike/dev/final/koa-better-body/node_modules/co/index.js:54:5
      at Object.co (/home/charlike/dev/final/koa-better-body/node_modules/co/index.js:50:10)

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of koa is breaking the build 🚨

Version 2.4.0 of koa was just published.

Branch Build failing 🚨
Dependency koa
Current Version 2.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

koa is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 27 commits.

  • 418bb06 2.4.0 – added missing 2.3.0 changelog
  • c68a696 2.3.0
  • 687b732 travis: test node@9
  • 53a4446 expose the Application::handleRequest method (#950)
  • 85ff544 deps: update min engines (#1040)
  • 6029064 HTTP/2 has no status message (#1048) (#1049)
  • 18e4faf Update fresh to ^0.5.2 to close vulnerability (#1086)
  • e8a024c docs: ddd Chinese docs link for v2.x (#1092)
  • 1e81ea3 docs: update babel setup (#1077)
  • 43a1df8 test: Remove --forceExit flag for Jest (#1071)
  • 0168fd8 docs: Update middleware.gif (#1052)
  • e1e030c docs: command is wrong for running tests (#1065)
  • 77ca429 test: replace request(app.listen()) with request(app.callback())
  • 7f577af meta: update AUTHORS (#1067)
  • f3ede44 docs: fix dead link to logo image (#1069)

There are 27 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of raw-body is breaking the build 🚨

Version 2.3.1 of raw-body just got published.

Branch Build failing 🚨
Dependency raw-body
Current Version 2.3.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

raw-body is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 5 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

JSON parsing is too strict for Content-Type

request.json() refuses to parse json whenever type is not reqest.is('json'), but that is too strict, since it's absolutely acceptable to have json formatted body with custom media types.

  • I would consider removing this check completely - after all, everyone should perform this check manually anyway. Combined with strict parsing, it will work well.
  • If not, it should be configurable. Either add way to disable it completely, or customize values passed to is().

Workaround is to JSON.parse(yield* this.request.text()).

Thanks

An in-range update of mocha is breaking the build 🚨

Version 3.5.1 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.5.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v3.5.1

3.5.1 / 2017-09-09

📰 News

  • 📣 Mocha is now sponsoring PDXNode! If you're in the Portland area, come check out the monthly talks and hack nights!

🐛 Fixes

  • #2997: Fix missing xit export for "require" interface (@solodynamo)
  • #2957: Fix unicode character handling in XUnit reporter failures (@jkrems)

🔩 Other

Commits

The new version differs by 14 commits.

  • 4070a44 Release v3.5.1
  • 466ba73 update CHANGELOG.md for v3.5.1 [ci skip]
  • 1cc0fc0 import/require xit, fixes #2972
  • 74fa66f update nyc to latest; remove workaround in travis script
  • aa52933 update coveralls strategy; closes #2984
  • 73a5338 Spelling (#2981)
  • 9f403bf Add utils.escape tests and fix unicode escaping
  • 800acbc whitelist "developer-experience" tag for stalebot [ci skip]
  • 5895671 Added issue, pull request templates. (#2869)
  • 075bd51 Merge pull request #2918 from mochajs/no-shell-test
  • 8710438 Work around Node 0.10 Windows flake when testing
  • 13b8340 Ensure that compiler lookup works and not just that transpilation works (#2922)
  • 26d337a Add tests for double-star behavior
  • c0e6b68 Eliminate glob.sh

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.