Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse full mime types #43

Closed
ryanmeador opened this issue Sep 5, 2012 · 3 comments
Closed

parse full mime types #43

ryanmeador opened this issue Sep 5, 2012 · 3 comments

Comments

@ryanmeador
Copy link

Do you think it is within the scope of your project to include a mime type parser? Something that when presented with a string like 'text/plain; charset=utf8' would return an object like this:

{
    type: 'text',
    subtype: 'plain',
    parameters: {
       charset: 'utf8'
    }
}

I've already written code that pretty much does this (just needs some cleaning up) that I would be happy to contribute.

@broofa
Copy link
Owner

broofa commented Sep 5, 2012

Hey Ryan, thanks for the offer! I think I'm going to pass for the moment, however. By way of explanation, here's kinda how I look at this sort of thing ...

  1. What fraction of users benefit?
  2. How much code weight is involved?
  3. How much benefit is there in adding it as an enhancement .vs. a separate module (or gist or whatever)?

In this case ...
#1 I'm not sure about, but this is the first request for this so, probably not that high.
#2 is (I'm guessing) either "not much" in which case the actual value being added is likely to be marginal, or "surprisingly large", meaning the parsing problem is probably complicated by all sorts of real-world edge cases... making for a bit of a maintenance burden.
#3 'Don't see much value-add in having this be part of node-mime. node-mime doesn't need this for anything it's currently doing, and there's little/nothing in node-mime that would simplify the parsing logic.

Anyhow... that's my early $.02. I'm always happy to be told where I'm wrong though. :)

@broofa broofa closed this as completed Sep 5, 2012
@broofa
Copy link
Owner

broofa commented Sep 5, 2012

So... I actually forgot about the charset.lookup() method that's in node-mime currently. Would be curious what your thoughts are there. Specifically: Would adding charset recognition there address your use case. What are you using the type/subtype parsing for? I confess I can't think of any use cases for this.

@broofa broofa reopened this Sep 5, 2012
@broofa
Copy link
Owner

broofa commented Jan 10, 2013

closing due to lack of response from OP or other commentary from other parties. (again, thanks for the offer!)

@broofa broofa closed this as completed Jan 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants