Live data from Hacker News

Node.js: Be a good dev: offer dependencies

medium.com

1–10 of 22 posts

Re: Node.js: Be a good dev: offer dependencies

#3
Honestly, this sounds like a big step backwards in UX if implemented widely.

I would really rather not have to manually install a million packages when pulling down dependencies - "npm install && npm start" and then going to grab a glass of water feels great.

The given use case of a master parsing library doesn't really resonate. A handful of extra kb on disk doesn't bother me at all for an all-in-one solution, and I've never really had the problem of not being able to find a parsing library on npm to begin with.

Re: Node.js: Be a good dev: offer dependencies

#4
Correct me if I'm wrong, but this would mean that I will be informed about missing dependencies RUNTIME? And I have to do that multiple times, if there are multiple 'dynamic dependencies' like this. The main reason for having declarative dependencies is to NOT be having to do that.

Re: Node.js: Be a good dev: offer dependencies

#6
post #2

Isn't that the whole reason there is a package.json? That way, people just run npm install and already have all the necessary dependencies.

Yes, a package.json is good to get the required dependencies. This article is about possible dependencies that help in cases where you all the possible would mean a huge load on the system.

Re: Node.js: Be a good dev: offer dependencies

#7
post #4

Correct me if I'm wrong, but this would mean that I will be informed about missing dependencies RUNTIME? And I have to do that multiple times, if there are multiple 'dynamic dependencies' like this. The main reason for having declarative dependencies is to NOT be having to do that.

Yes, the missing dependencies would show up at runtime. Which is a valid and important concern, however: It would be possible (though probably inadvisable) to implement an automatic download of missing dependencies.

Re: Node.js: Be a good dev: offer dependencies

#8
post #3

Honestly, this sounds like a big step backwards in UX if implemented widely. I would really rather not have to manually install a million packages when pulling down dependencies - "npm install && npm start" and then going to grab a glass of water feels great. The given use case of a master parsing library doesn't really resonate. A handful of extra kb on disk doesn't bother me at all for an all-in-one solution, and I…

You do have to choose which packages you want to install at some point. When you do `npm install && npm start` it will still work as planned. The problem here address is for when you need to deal with a new issue.

If it were a handful of extra kb, I'd agree. Of the top off my head I can think of following file formats "somehow" suited for configuration: json, cson, properties files (java), yaml, xml, conf-files (Apache), ignorefile syntax, ini files.

Supporting all of them could be a reasonable goal to the community (looking at the packages in npm: it is an actual goal already).

https://en.wikipedia.org/wiki/Configuration_file

Re: Node.js: Be a good dev: offer dependencies

#9
post #5

I'm not shure that it is a good idea to create (and use) such packages as 'parse-any-structed-file'. If you know what you need, then you can use an optimized implementation.

In my use-case I would like to offer as many structured files formats as possible. But to be sure: you can replace "structured file" with "code syntax" (example: syntax highlighting) or "natural language translation" (example: translation of a cli tool) or "database driver" (example: orm tool).

(In my project that is the exact problem case)

Re: Node.js: Be a good dev: offer dependencies

#10
post #3

Honestly, this sounds like a big step backwards in UX if implemented widely. I would really rather not have to manually install a million packages when pulling down dependencies - "npm install && npm start" and then going to grab a glass of water feels great. The given use case of a master parsing library doesn't really resonate. A handful of extra kb on disk doesn't bother me at all for an all-in-one solution, and I…

You do have to choose which packages you want to install at some point. When you do `npm install && npm start` it will still work as planned. The problem here address is for when you need to deal with a new issue. If it were a handful of extra kb, I'd agree. Of the top off my head I can think of following file formats "somehow" suited for configuration: json, cson, properties files (java), yaml, xml, conf-files (Apac…

Use js files for config. They support comments, syntax highlighting will work out of the box, and you can require them.
Post reply on HN