Change the employee data storage system from `.txt `to `.json` for better structure, easier reading/editing, and to reduce potential parsing bugs. **To-do:** - [x] When reading data, use `JSON.parse()` from `data-karyawan.json`. - [x] When saving data, use `fs.writeFileSync()` with `JSON.stringify()` format. - [x] Add a check: if the file does not exist, create it with an empty array `[]`. - [x] Ensure all CRUD features work with JSON format.
Change the employee data storage system from
.txtto.jsonfor better structure, easier reading/editing, and to reduce potential parsing bugs.To-do:
JSON.parse()fromdata-karyawan.json.fs.writeFileSync()withJSON.stringify()format.[].