dinhvh / libetpan.node

NodeJS binding for libetpan.
3 stars 1 forks source link

etpan-down and etpan-up #12

Open yorkie opened 10 years ago

yorkie commented 10 years ago

Hi, @dinhviethoa. I have a thought wanna share with u about this node module. that's we need split this module to 2 complete library: etpan-down and etpan-up, their relationship just like rvagg/node-levelup and rvagg/node-leveldown.

Then:

Actually we need to do this is:

  1. remove network related API in libetpan.node, and expose only parsing API to usage, and rename this module to etpan-down.
  2. create a new repo named etpan-up, and construct an API more like andris9/inbox.

I prefer like to do the above jobs and let them works fine in my spare time, but I need some thoughts of you, the author of libetpan.

/cc @dinhviethoa :)

dinhvh commented 10 years ago

If both are meant to live together, I'd prefer them to be in the same node module / repo. Why can't the current API be though as the low-level API for libetpan. Then, you could high a high-level API similar to inbox on top of it.

Does it sound good?

Is there any specific reason why you would like to remove the network calls from here?

yorkie commented 10 years ago

Yes, IMO this library should like mailparser that only does parsing stuffs, but in a fast way than mailparser.

Plus, there are the following 2 reasons that support my opinion:

Do you have any more thoughts on this?

dinhvh commented 10 years ago

Is there a reason to keep them in two separate modules? I support the idea of separating the parsing layer and the high-level layer but I'm not sure if that's worth to have two separate modules for it. They could be in separated folders instead.

yorkie commented 10 years ago

Only 1 module seems good to me, but exposing the parsing APIs is necessary for the new libetpan.node. But if the future module, etpan-up is a pure javascript module, that would be better for open source and easy compatible implementation for node(for example this module could not be compiled at v0.11.x).

dinhvh commented 10 years ago

Ok. Let's break it in two parts. How about libetpan.node for the low-level API (JS bindings to C) and mailcore.node for the high-level API? Could you take a look at mailcore API https://github.com/mailcore/mailcore2 (src/async, it's some C++ API) to help you define some high-level APIs?

yorkie commented 10 years ago

Amazing, a wise name for mailcore.node but node-mailcore seems like a pure javascript's name? Ok, I would build new API based on mailcore2's :P

dinhvh commented 10 years ago

Sounds great! FYI, I initially though that we could build node-mailcore on top of mailcore but after a some investigation, I found out that how mailcore was built was not the best way forward. So, building on top of libetpan.node and try to match mailcore2 API would be the best option.

node-mailcore sounds good to me.

yorkie commented 10 years ago

Plus, we might use rvagg/nan to resolve the compatible problem for node versions on libetpan.node.

yorkie commented 10 years ago

Okay, and I would start this works from libetpan.node. cheers :cherries:

dinhvh commented 10 years ago

Awesome!