-
Notifications
You must be signed in to change notification settings - Fork 40
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
Is this NPM package required when NodeJS ships with a path module? #6
Comments
Presumably to use it in a browser.... This is a package I've inherited, and it's not actively maintained. I'm really not sure why so many Node-specific packages rely on it. Perhaps it should be deprecated. |
@jinder in the browser? I can't imagine this code would work in browser. For example browserify has it's own path shim which has nor I think people are installing this, because they don't know this is built in. A lot of people first come to node via something like express tutorial and in it, they have to install everything. I think this should really be removed from NPM. No need to vaste megabytes of bandwith downloading this. |
Although it's not packaged (browserify-style), it does depend on the process and util NPM packages. So there's certainly going to be dependencies that are using it and packaging it themselves. I agree with what you're saying though. But I won't remove it from NPM (hundreds of dependent packages and half a million downloads a month). Perhaps a deprecate and notice would be sufficient? |
@jinder you can't really use this module unless you specify a require by absolute or relative path. So if there is a project, which has this as dependency and requires a path by doing: I hope NPM maintainers take the same stance. |
I'm a bit apprehensive about pulling this from the registry without knowing for sure it won't break anything. I'll deprecate it this weekend and monitor it for a while to see what to do next. A bit of background about how I've inherited this from @coolaj86: I needed to use a package that depended on this, however it was published to the NPM registry without any licensing information. Which meant the only way I could use it, was by re-publishing it (copy + paste from node core) and updating the package.json with relevant licensing details. |
it should be easy to try out-just find some packages which have CI setup this in package.json and remove it and make a PR. I bet you nothing breaks. |
You certainly can use it without having an absolute/relative path. RequireJS lets you specify the paths in its config for named modules. You're welcome to contact any of the dependent libraries to investigate more. For the moment, I think it's only safe to deprecate it. |
You could of course add a little love to it like this: if (process.versions && process.versions.node) {
console.warn("[path installed via npm]: YOU'RE DOING IT WRONG! See https://github.com/jinder/path/issues/6");
} |
Actually... you could do what I do with unibabel's package.json I set You can then have the Also, a person can't really accidentally use this from npm. |
I think in those instances, you'd only see the message if they're specifically forcing the use of the package under Node. Really, what we want is to somehow notify users who have it listed as a dependency in their package.json, but are actually using the native node module. i.e. it's an unnecessary dependency. |
attach a message using
|
You could use the module in a browser environment together with My app runs in node.js and browser environments so this is the perfect module for me. |
Okay, so, latest plan of action: Update the readme to clearly indicate it's not necessary to have a dependency on this module if you're only running on Node. Any objections? :) |
+1 for this |
Just noticed on NPM 3 at least, the following appears when running install:
|
Why would anyone need to install this module when it comes bundled with npm?
The text was updated successfully, but these errors were encountered: