Junior — Middle
What data formats or documentation have you had to work with?
sobes.tech AI
Answer from AI
In working with Node.js, it is often necessary to interact with different data formats and documentation, such as:
- JSON — the main data exchange format in web applications, used for transmitting data between client and server.
- YAML — sometimes used for configuration files.
- XML — less common, but can be used for integration with external services.
- Markdown — a documentation format, for example, for README files.
- Swagger/OpenAPI — specifications for describing REST APIs.
Example of reading JSON in Node.js:
const fs = require('fs');
fs.readFile('data.json', 'utf8', (err, data) => {
if (err) throw err;
const obj = JSON.parse(data);
console.log(obj);
});