-3

I went through previous posts on SO and some of the answers say that a JSON file is used to send data from server to client.

Well that seems to be okay but then we can create package.json, Apidoc.json, manifest.json which do not interact with the client and server

So can someone tell me what actually is a JSON file?

d219
  • 2,707
  • 5
  • 31
  • 36
Alwaysblue
  • 9,948
  • 38
  • 121
  • 210

2 Answers2

2

JSON is a file format, just like CSV. Just because CSV is used with Microsoft Excel, does not mean that is all it is used for (just like with JSON). Just because it is common to get info from a server in JSON format, does not mean that is all JSON is used for. Do some googling before asking a question like this on Stack Overflow.

Here is an intro to JSON. JSON Intro W3Schools

d219
  • 2,707
  • 5
  • 31
  • 36
Dan
  • 451
  • 3
  • 13
2

JSON stands for JavaScript Object Notation. It is used to describe a data structure in a simple format. It can be a plain text file, which may be used to pass data from the server to a client, but it could be equally used to hold and consume that data at the same layer e.g. you could have a configuration file at the client side which is read an interpreted by your application.

Note also that JSON does not need to be held in a file; you could create a string variable with JSON data in it and pass this from one method to another without ever storing it in a file.

The tag definition in Stack Overflow can be found here https://stackoverflow.com/tags/json/info and further information can be found here https://www.json.org/.

d219
  • 2,707
  • 5
  • 31
  • 36