I am new in programming languages.I was trying to learn web socket with javascript to this site, but i am not understanding something that why i need to use Package.json. I tried to google a lot, but can not find something useful.
One more thing if i create Package.json then why i need to write dependencies ? and why need it ?

Please explain in poor man language.

It's a configuration file for npm, so that it can install the correct versions of each required dependency of your application and define some other information.

A dependency can be a library that you want to add to your application, you have to just define the link of the git/svn repository and the version, or the range version, and when you run the install/update process your app will be set up.

Here is described how the file should be written: