Giter Site home page Giter Site logo

build-your-own-parser about body-parser HOT 17 OPEN

expressjs avatar expressjs commented on March 29, 2024
build-your-own-parser

from body-parser.

Comments (17)

dougwilson avatar dougwilson commented on March 29, 2024 2

i.am.machine :DDD

from body-parser.

mikermcneil avatar mikermcneil commented on March 29, 2024 1

xml

from body-parser.

jonathanong avatar jonathanong commented on March 29, 2024

I think this lib is pretty easy to understand. IMO they should just fork this lib if they wanna do more stuff. Most of the logic should be in separate libs anyways

from body-parser.

Fishrock123 avatar Fishrock123 commented on March 29, 2024

I think it would be better to have the interface and people have parsing libs than lots of body-parser forks.

from body-parser.

dougwilson avatar dougwilson commented on March 29, 2024

I think it would be better to have the interface

This module should be the interface. json and urlencoded should be the separable libs that use this module ;)

from body-parser.

jonathanong avatar jonathanong commented on March 29, 2024

You guys are just adding more responsibility to your plate hah

from body-parser.

Fishrock123 avatar Fishrock123 commented on March 29, 2024

Yeah, that's the issue, may be too much to be worthwhile to support.

from body-parser.

mikermcneil avatar mikermcneil commented on March 29, 2024

This module should be the interface. json and urlencoded should be the separable libs that use this module ;)

I can tackle this if it's helpful

from body-parser.

dougwilson avatar dougwilson commented on March 29, 2024

This is actually nearly done, as it was intended for the goal of bringing body-parser back into express core.

Out of curiosity, what parser were you planning to build that we don't have already :)?

from body-parser.

mikermcneil avatar mikermcneil commented on March 29, 2024

Out of curiosity, what parser were you planning to build that we don't have already :)?

good question

from body-parser.

mikermcneil avatar mikermcneil commented on March 29, 2024

lol

from body-parser.

dougwilson avatar dougwilson commented on March 29, 2024

xml

lol. Somehow I knew that was the answer ;) Currently the best you can do is to use bodyParser.text and then feed the text into a XML parser.

from body-parser.

dougwilson avatar dougwilson commented on March 29, 2024

The reason why I had a feeling is because I use this module to parse XML all the time, but of course using text + parser requires the request body to buffer up instead of feeding it to an incremental parser (CSV is another common one, which I also use!).

This new stuff will actually be out sooner rather than later since I should not be distracted with express core.

from body-parser.

rlidwka avatar rlidwka commented on March 29, 2024

Out of curiosity, what parser were you planning to build that we don't have already :)?

JSON5? I use that in a few APIs, because it's easier to debug such api with a curl (and b/w compatibility with json is perfect). Even created express-json5 based on bodyParser.

So this use-case is more real than it seems.

from body-parser.

dougwilson avatar dougwilson commented on March 29, 2024

Even created express-json5 based on bodyParser.

Though it looks like as body-parser is currently, it can be significantly simplified by wrapping bodyParser.text ;)

from body-parser.

dougwilson avatar dougwilson commented on March 29, 2024

@rlidwka or, looking at your code now, you could technically wrap bodyParser.json and if it errors, check err.body and parse that with the json5 parser :) I'm not actually saying this invalids the issue at had, here, because it's still valid and I'm working on it, haha.

from body-parser.

lopugit avatar lopugit commented on March 29, 2024

How do you build may I ask?

from body-parser.

Related Issues (20)

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.