Node.js module problems [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have a question want to ask you guys .... Recently i found out Node.js plus Socket.io can make a good real time web . But what i scare is what happened if one day Socket.io gone ? Like if the Author unpublished the module or what ever happened that module is gone so all the project depending on that module is down too ? Please answer me i know maybe this is stupid question for some of your guys ... but that what i scare about and i don't know if it gonna happened or before have any module is gone somehow then Project of people depending on it is suck after that anything like that happened before ?? . I just want to know what i gonna do if it happened .. and will it happened ? Thanks

All node modules are installed locally on your machine/server. You use the npm tool to do that automatically for you. See https://npmjs.org/doc/cli/npm.html
Even if a module gets deleted from the registry and nowhere to be found on the internet, it is still on your project unless you delete it yourself.

The worst thing that could happen is that there wouldn't be more updates/support/bug fixes for that specific module. But aside from that, the module is installed in your own project so what was working for you will still work.

Related

What is the expect library for? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 days ago.
Improve this question
I came across the NPM package called expect being used alongside the jest package in a package.json file.
It is also from the Jest team, but it is hard to find in the docs why you would want to use it on its own. Is it necessary to run Jest tests? Is it for TypeScript users?
Can anybody provide context why you would want to use it in addition to the jest package?
I don’t know their reason for separating out the package by itself. Perhaps to break up their own repo. Maybe to make it usable by other frameworks. I know Playwright uses it to basically extend or build their assertions on top of it.
That being said, unless you plan on building a new test runner/framework or somehow extending it, then you probably don’t need it yourself. It’s already built in/depended on and provided by those frameworks, so you wouldn’t need it in addition.
I’m not sure why it was in your project, but I’d say it’ll likely be pretty obvious if it was needed if you remove it and tests start breaking. Theoretically if it is somehow used (which again seems unlikely since jest already includes it), it should only be for testing, so there really should be no risk in just removing it and seeing if they still work.
Hope that helps!

java minecraft error unrecognized VM option UseConcMarkSweepGC [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
So i was trying to make my own Free Server so i watched a tutorial how to do that with Hamachi
so i tried then came this Error
i already tried to find where i can fix it or sth like that but i dont know yet.
Here is the link to the Tutorial i tried with .
https://www.youtube.com/watch?v=9RpA14YdEe0&t=154s
I´d be very happy if you can help me .
The CMS collector has been deprecated as of JDK9; you're on JDK16, and it's been entirely removed at this point. It is rather unlikely you want the CMS collector. That tutorial is rather hopelessly out of date if it is advising that you use it.
I suggest you use the Z Garbage Collector instead. It has similar properties (lots of very short collection cycles that don't freeze the entire VM), but is better. -XX:+UseZGC is how to turn it on.
It's that or downgrade to e.g. JDK8 which still has the old CMS.

Optimize Socket io [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
In my current project I need to optimize socket.io. It can handle 500-600 Connections but I need 2300 at Least. Is there a way to optimize?
Only being allowed to support 500-600 connections is a very broad issue. You need to distinguish what's bottlenecking your code and analyze it to see if there's any way to fix it. This issue may not be socket.io specific and can be caused by some other module in your application. First profile your code and see if there's anything that is is really heavy and can use optimization. NodeJS has a built in profiling tool that can be used which you can find >HERE<. Once you've narrowed down your issue, it'll be easier for you to figure out what needs to be optimized and easier for us in the community to help aid you.
Another option you can do is completely scrap socket.io all together and write your own custom websocket protocol. Requires a bit more work, but it'll strip away a lot of overhead you may not need.
https://codeburst.io/why-you-don-t-need-socket-io-6848f1c871cd
If you do want to keep using socket.io and you find that there's nothing that sticks out while profiling your application, your machine probably needs more resources to support the number of connections. Only thing you can do for this is to upgrade whatever hardware your application is sitting on.

Should I include my project source files in npm distribution? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Several projects include its source code in the NPM distribution package bundle. For instance, React includes its unminified/unbuilt javascript files in a lib folder but it also has a dist folder with the built files.
Is this a good practice ?
On the downsides I think it increases the time the package will take to be downloaded and the disk consumption.
(that's why I usually add source code folders to the .npmignore file)
But I ask myself, why so many libraries do so ? Which are the advantages ?
I'm not sure if this question really falls under something that's asked here on SO, mostly because it's opinion based and could be more of a discussion. But here are my 2 cents anyways:
I believe most of these libraries add their source code (partially because they're open source) to help with debugging purposes. They are typically (but not always) bundled with a .map file as well. Conveniently there's a post that explains what a map file is..
If you think about it like this: anyone who is using your distribution will really only need to install it "once", as in they will probably not be installing it every time they want to use it, but just when they either want to cleanly deploy their project or simply when they install it.
Another thing to think about is: how large is your distribution? Will it really be so big that it will slow down installation time?
As for space a few MB will be negligent on pretty much any modern machine.
I personally think that it's good practice to include the source code as well, I like to know how libraries do what they do, and I like being able to have the option to look into why my code may cause the library to throw errors. But I'm sure there are good reasons not to as well.
tl;dr
They do it to help developers debug
Unless your project really takes a long time to install, don't worry about it
Unless your project is super big, don't worry about it
As a dev I like it when projects include it, but "good practice" is quite opinionated and it depends on the situation

Understanding node.js server directory structure and security [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Sorry if this is a straightforward question, but I was not able to find answer to it online. I have not worked with node.js previously, but am trying to set up a project to play around with. I usually use git to commit any changes to projects repository that is afterwards deployed to the server.
With node am I safe to have a public repo containing files like server.js, config folder, package.json file etc.. basically things that demonstrate how server works.
If I did miss something out please feel free to add info
Yes, the only thing you do not want to push to github are secrets associated with any APIs you may be associated with. Those should be added as environment variables where the server is hosted.

Categories

Resources