https://github.com/austindd/nodejs
Various projects using Node.JS
https://github.com/austindd/nodejs
Last synced: about 1 year ago
JSON representation
Various projects using Node.JS
- Host: GitHub
- URL: https://github.com/austindd/nodejs
- Owner: austindd
- Created: 2018-12-17T19:35:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-19T19:10:30.000Z (over 7 years ago)
- Last Synced: 2025-06-07T06:34:15.662Z (about 1 year ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Learning Node.JS
## OBJECTIVES
### PART 1
1. Create a NodeJS project using `npm init`.
2. Create a folder in your project called `server`.
3. Create a JavaScript file in the `server` folder named `server.js`.
4. In `server.js`
* Import (require) `path` and `fs`.
* Create an array consisting of at least 5 chirp objects.
* Write the array to a file in the root of the project called `chirps.json`.
* Add code to `server.js` that reads the file and outputs the chirps to the console
### PART 2
1. Install `request-promise` from npm and save it to your package.json file.
2. Create a JavaScript file in the root of your project called `reddit.js`.
3. Use request-promise to retreive articles from https://reddit.com/r/popular.json.
4. Extract from each article title, url, and author
5. Push each extracted article to an array.
6. Write the array to a file in the root of your project called `popular-articles.json`.
### ADVANCED
1. Create a JavaScript file named `popular-downloader.js`.
2. Create a directory in the root of your project named `downloads`.
3. Using `request-promise`, pull articles from https://reddit.com/r/popular.json.
4. If the article is a `.jpg`, `.gif`, or a `.png` [(hint)](https://nodejs.org/dist/latest-v10.x/docs/api/path.html#path_path_extname_path]):
5. Use `request-promise` to download the media.
6. Write each download to a file (named the `id` of the article) in the `downloads` directory.