{"id":18572736,"url":"https://github.com/truecodersio/node_streams","last_synced_at":"2025-04-10T07:31:30.874Z","repository":{"id":43831824,"uuid":"348136352","full_name":"truecodersio/node_streams","owner":"truecodersio","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-16T21:06:07.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":27,"subscribers_count":1,"default_branch":"Answer","last_synced_at":"2025-03-24T18:06:08.688Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/truecodersio.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}},"created_at":"2021-03-15T22:08:03.000Z","updated_at":"2023-09-20T13:51:59.000Z","dependencies_parsed_at":"2022-09-25T09:33:18.749Z","dependency_job_id":null,"html_url":"https://github.com/truecodersio/node_streams","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2Fnode_streams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2Fnode_streams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2Fnode_streams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truecodersio%2Fnode_streams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/truecodersio","download_url":"https://codeload.github.com/truecodersio/node_streams/tar.gz/refs/heads/Answer","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248176327,"owners_count":21060046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-06T23:07:05.437Z","updated_at":"2025-04-10T07:31:30.610Z","avatar_url":"https://github.com/truecodersio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exercise\n\n## Part 1\n\n- In VS Code, create and open a new folder named “node_streams”\n- Create a streams.js file\n- Import or require the fs module\n- Create a server\n- Write a conditional statement that checks the request url for a “GET” request on a “/”\n- If the method and url match the previous check (step c), use createReadStream to pipe the contents of an html file to the client\n- You can design the html file however you choose\n- If the method and url are not “/” and “GET”, use the same method to pipe the contents of a 404 not found html page\n- You should send the appropriate status code and headers\n- Now run node app and test in postman or the browser\n\n## Part 2\n\n- In a new file, fetch data from a source of your choosing (e.g. [Pokemon](“https://raw.githubusercontent.com/Biuni/PokemonGO-Pokedex/master/pokedex.json”))\n- Use the createWriteStream method to create a write stream using an empty json file in your project\n- Use the write method to populate the json file with the data from your fetch request\n\n### HINT\n\n- You will need to use a third-party fetch api (isomorphic-fetch, node-fetch, Axios, etc) to achieve this in Node\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruecodersio%2Fnode_streams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruecodersio%2Fnode_streams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruecodersio%2Fnode_streams/lists"}