Giter Club home page Giter Club logo

Comments (5)

jonathanong avatar jonathanong commented on June 11, 2024

if you can think of a good api i'll try to tackle it. not 100% sure how multipart works yet

from busboy.

tj avatar tj commented on June 11, 2024

here's what i did for connect's but ideally we have a { multiple: true } option since it's a little confusing for people to somethings have an array and sometimes have a single part if you don't opt-in https://github.com/senchalabs/connect/blob/master/lib/middleware/multipart.js#L115

from busboy.

jonathanong avatar jonathanong commented on June 11, 2024

i guess you want .fields as an object, right? it's kind of weird because busboy has truncated booleans which i don't know how to handle (i don't know what that even means). right now i just return it as an array.

there's also other stuff. gotta handle cases where people yield between parts.

var part
while (part = yield parser.part()) {
  yield save(part, 'some file.txt') // this could take too long
}

a part can be emitted between part()s.

then people might want the fields before any of the parts (like CSRF, you can validate before handling any streams). not sure how to handle that either except by doing field = yield parser.field(), but then that's annoying because you gotta do while (next = (yield parser.part()) || (yield parser.field())) and then type check.

HOORAY FOR GENERATORS.

from busboy.

tj avatar tj commented on June 11, 2024

actually nvm i guess it's not really a concern haha, gotta get my mind out of the non-sync gutter, the .part() stuff should be just fine

from busboy.

jonathanong avatar jonathanong commented on June 11, 2024

i think this module is going to be a pain in the ass, just like multipart always is

from busboy.

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.