junosuarez / objectid

node module: generate and validate mongodb objectId strings without dependencies
MIT License
22 stars 9 forks source link

1.x for browser, 3.x for ..?? #2

Closed fresheneesz closed 9 years ago

fresheneesz commented 10 years ago

The readme says:

"1.x is probably the version you want to use in a browser. 3.x focuses on compatibility with the npm mongodb driver."

Are you really saying version 3.x should not be used in browsers? When you say "compatibility with the npm mongodb driver", what does this mean? Are you saying the interface is the same, or are you saying they should interoperate somehow?

junosuarez commented 10 years ago

3.x has binary dependencies which only works in a Node.js environment. It is to ensure compatibility with the node mongodb driver's BSON serialization idiosyncracies.

fresheneesz commented 10 years ago

Alright. I gotta say, its pretty weird to recommend that people use an older version of your module. I suggest you do something like create two files: one for the browser and and one for node.js, that exist in the same version.

fresheneesz commented 9 years ago

@jden I really wouldn't close this without doing something about it. If this is really necessary, you should have two different files in the latest version of your module - one for node and one for browser. Telling people to use an older version for browsers is pretty much the most confusing way you could handle this.

junosuarez commented 9 years ago

I would gladly accept a pull request - the approach in #3 seems reasonable. Unfortunately, I don't have the time to do it myself right now.