Dr. Luciano Nocera
xcode-select --install
$ mkdir hw
$ cd hw
$ git clone https://github.com/DSCI554/a1-lnocera-1.git
$ cd a1-lnocera-1
$ code -n .
ASSIGNMENT.md #assignment rubric in markdown
README.md #repository README in markdown
index.html
lab/ #lab files
ex1.html #lab exercise file
ex2.html
simple-exe/
faithful.csv
node_modules
package-lock.json
package.json
simple-exe
simple-html/
index.html
node_modules
package-lock.json
package.json
simple-vue/
README.md
babel.config.js
node_modules
package-lock.json
package.json
public
src
vue.config.js
style.css
node_modules #node modules created when running npm install
package-lock.json
package.json #package.json file
$ node
> console.log('hello JavaScript')
> a = [1, 'b', 'c', 2]
> a.concat(a)
This is how to generate files for a CLI executable using npm (JavaScript package manager):
$ npm init
$ npm install commander csv-parse #fetch libs in node_modules and adds references in package.json
$ cat > mycli #create mycli executable
#!/usr/bin/env node
console.log('hello mycli');
$ chmod +x mycli
$ ./mycli
$ code -n . #open current folder in VS Code
{
"type": "pwa-node",
"request": "launch",
"name": "exe args",
"skipFiles": [
"/**"
],
"program": "${workspaceFolder}/bin/exe",
"args": ["arg1", "arg2"]
}
Action | Mac | Windows / Linux |
---|---|---|
Open whatever panel you used last | Command+Option+I | F12 or Control+Shift+I |
Open the Console panel | Command+Option+J | Control+Shift+J |
Open the Elements panel | Command+Shift+C or Command+Option+C | Control+Shift+C |
$ cd simple-vue
$ code -n . #open simple-vue project
$ npm install #only when updating package.json with new packages
$ npm run serve #use vue cli (see in package.json)
$ npm install -g @vue/cli #install vue CLI globally
$ vue --version
$ vue create my-app #choose default vue 2!
$ cat > vue.config.js
module.exports = {
configureWebpack: {
devtool: 'source-map'
}
}
ex1.html
ex2.html
# Title
## Subtitle
__HTML__ `inline` code:
```html
<h1 style="color: red">Header 1</h1>
<h2>Header 2</h2>
<h3>Header 3</h3>
```
A list:
- [hyperlink text](https://guides.github.com/)
- list item
- list item
body
tag are visible!
<h1>Header</h1>
<h2>Sub-header</h2>
<p>paragraph with text</p> and some more text
directly in the body
<p>
Some text with a
<a href="some_url">hyperlink</a>
</p>
paragraph with text
and some more text directly in the bodySome text with a hyperlink