From be4c53d4523ff1e073b4b5f9c982ed51463f03d7 Mon Sep 17 00:00:00 2001 From: kleinlowe Date: Tue, 2 Jul 2019 22:19:24 -0700 Subject: [PATCH] commit! --- .gitignore | 1 + index.js | 7 +++++++ package-lock.json | 13 +++++++++++++ package.json | 23 +++++++++++++++++++++++ readme.md | 25 +++++++++++++------------ src/profile.js | 6 ++++++ w1-file-system | 1 + 7 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 .gitignore create mode 100644 index.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/profile.js create mode 160000 w1-file-system diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..b14cdb7 --- /dev/null +++ b/index.js @@ -0,0 +1,7 @@ +console.log('Hello, node!'); +const path = require('path') +console.log(path.resolve()) + +const moment = require('moment'); + +console.log(moment().format('dddd')); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..f2886cb --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "w1-node-ecosystem", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "moment": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..f7b364e --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "w1-node-ecosystem", + "version": "1.0.0", + "description": "Welcome to JSCRIPT 400 - Server Side Development with JavaScript", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/asakleiman/w1-node-ecosystem.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/asakleiman/w1-node-ecosystem/issues" + }, + "homepage": "https://github.com/asakleiman/w1-node-ecosystem#readme", + "dependencies": { + "moment": "^2.24.0" + } +} diff --git a/readme.md b/readme.md index ccca3f4..7d21303 100644 --- a/readme.md +++ b/readme.md @@ -39,15 +39,16 @@ $ npm -v * **Question:** What is the difference between forking and cloning a repository as opposed to just cloning a repository? * **Your Answer:** - +cloning creates a local copy associated with the original repository; forking creates a branch of the orginal repositiry --- - [ ] Run `npm init -y` from the command line * **Question:** What does `npm init` do? How does the `-y` flag modify that command? -* **Your Answer:** +* **Your Answer:** +Automatically chooses the default options --- - [ ] Take a look at the file that was generated by the previous command @@ -55,7 +56,7 @@ $ npm -v * **Question:** What is the purpose of the following keys? "name", "scripts", "license" * **Your Answer:** - +Name is the project name. Scripts indicates where the scripts are. License is the distribution/use license --- - [ ] Create a `.gitignore` file @@ -63,7 +64,7 @@ $ npm -v * **Question:** What is the purpose of the `.gitignore` file? What is the significance of a "dot-file?" * **Your Answer:** - +it's a list of files to be overlooked by git when it creates and updates your repository. Always add the files containing your API keys to this. --- - [ ] Create an `index.js` file with the following contents: `console.log('Hello, Node!')` @@ -71,7 +72,7 @@ $ npm -v * **Question:** From the command line, how can you run this file? * **Your Answer:** - +node hello.js --- - [ ] Run `npm test` from the command line @@ -79,7 +80,7 @@ $ npm -v * **Question:** What happens and how is this related to what is in the `package.json` file? * **Your Answer:** - +Error: no test specificed. THe package.json file points to tests. --- - [ ] Create a new "script" command called "start" that has the following value: `node index.js` @@ -87,7 +88,7 @@ $ npm -v * **Question:** What will you enter on the command line to run that script? * **Your Answer:** - +run index.js --- - [ ] Change the name of your "start" script to "my-file" @@ -95,7 +96,7 @@ $ npm -v * **Question:** The same pattern will not work to try and run this script. How can you successfully get this script to run? * **Your Answer:** - +By using run instead --- - [ ] Create a new file called `profile.js`. Inside the file, copy the following but replace `` with your name: @@ -110,7 +111,7 @@ $ npm -v ``` * **Question:** What gets logged? Why? - +My name, because it's as an export * **Your Answer:** * **Question:** What is `module.exports` and what is its _type_ in JavaScript? What is `require` and what is its _type_ in JavaScript? @@ -136,7 +137,7 @@ $ npm -v * **Question:** What is `path` and where does it come from? * **Your Answer:** - +Part of the node package --- - [ ] Install the [moment](https://www.npmjs.com/package/moment) package @@ -144,7 +145,7 @@ $ npm -v * **Question:** What command can you run to install this package? * **Your Answer:** - +npm install moment --save --- - [ ] On your own, use this package in the `index.js` file @@ -152,7 +153,7 @@ $ npm -v * **Question:** Do you need to use a `./` to require the package? Why or why not? * **Your Answer:** - +no, because it is in node_modules --- - [ ] Move your `profile.js` file into a `src/` folder. Update the path in your `index.js` file to ensure everything continues to work. diff --git a/src/profile.js b/src/profile.js new file mode 100644 index 0000000..758c5b8 --- /dev/null +++ b/src/profile.js @@ -0,0 +1,6 @@ +module.exports = 'Asa' + + + +const profile = require('./src/profile.js') +console.log(profile) \ No newline at end of file diff --git a/w1-file-system b/w1-file-system new file mode 160000 index 0000000..e983a4d --- /dev/null +++ b/w1-file-system @@ -0,0 +1 @@ +Subproject commit e983a4dda85ee0eed8065e37a8af71e21730aaa1