{"id":15827147,"url":"https://github.com/victor-lis/node-filesystem","last_synced_at":"2026-05-08T03:36:46.523Z","repository":{"id":216336567,"uuid":"741043636","full_name":"Victor-Lis/Node-FileSystem","owner":"Victor-Lis","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-09T15:41:56.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-15T12:55:32.699Z","etag":null,"topics":["filesystem","json","node"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Victor-Lis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-09T15:28:36.000Z","updated_at":"2024-02-19T01:02:01.000Z","dependencies_parsed_at":"2024-01-09T18:01:59.226Z","dependency_job_id":"448c7137-deff-4e7a-bbad-04dafce6962d","html_url":"https://github.com/Victor-Lis/Node-FileSystem","commit_stats":null,"previous_names":["victor-lis/node-filesystem"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Victor-Lis/Node-FileSystem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FNode-FileSystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FNode-FileSystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FNode-FileSystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FNode-FileSystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Victor-Lis","download_url":"https://codeload.github.com/Victor-Lis/Node-FileSystem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor-Lis%2FNode-FileSystem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32765694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filesystem","json","node"],"created_at":"2024-10-05T10:01:40.544Z","updated_at":"2026-05-08T03:36:46.501Z","avatar_url":"https://github.com/Victor-Lis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Node FileSystem\n\nEsse é um projeto simples trabalhando com a manipulação de arquivos usando NodeJS.\n\nA base desse projeto veio do seguinte [vídeo](https://www.youtube.com/watch?v=dvd3pNYh7So) do [Mario Souto](github.com/omariosouto).\n# Desafios\n\n- Compreender o CRUD usando File System.\n# Aprendizados\n\nPor final aprendi algumas coisas interessantes como: \n# Na prática\n\n## Create\nUtilizei o método fs.writeFileSync() para criar os arquivos.\n```js\nfunction create({id, content}){\n    posts.push({id, content})\n\n    fs.writeFileSync('./db.json', JSON.stringify(posts), { encoding: \"utf-8\" })\n}\n```\n\n\n## Read\nUtilizei o método fs.readFileSync() para ler os arquivos.\n```js\nfunction read(){\n    posts = fs.readFileSync('./db.json', {encoding: \"utf-8\"}) || []\n}\n```\n\n## Update\nUtilizei o método fs.writeFileSync() para atualizar os arquivos, porém com algumas alterações no restante do código.\n```js\nfunction update({id, content}){\n\n    let newPost = {id, content}\n    let oldPostIndex = posts.findIndex((post) =\u003e post.id == id)\n    posts.splice(oldPostIndex, 1, newPost)\n\n    fs.writeFileSync('./db.json', JSON.stringify(posts), { encoding: \"utf-8\" })\n}\n```\n\n## Delete\nUtilizei o método fs.writeFileSync() para apagar os arquivos, porém com algumas alterações no restante do código.\n```js\nfunction delete({id}){\n    let postIndex = posts.findIndex((post) =\u003e post.id == id)\n    posts.splice(postIndex, 1)\n\n    fs.writeFileSync('./db.json', JSON.stringify(posts), { encoding: \"utf-8\" })\n}\n```\n\n## Autores\n\n- [@Victor-Lis](https://github.com/Victor-Lis)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor-lis%2Fnode-filesystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictor-lis%2Fnode-filesystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor-lis%2Fnode-filesystem/lists"}