#31: Node.js のインストール
やったこと(Done)
- N 予備校 プログラミング入門 Web アプリコース
- 第 3 章 サーバーサイドプログラミング入門
01. 第 3 章のはじめに
02. Node.js
- 第 3 章 サーバーサイドプログラミング入門
Vagrant の VM の方にも fish のパッケージマネージャー fisher
を入れて、最低限の設定をしました。
$ curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish $ fisher add rafaelrinaldi/pure $ fisher add oh-my-fish/plugin-peco
~/.config/fish/config.fish
を編集します。
alias ls "ls -a --color=always" alias gst "git status" function cd builtin cd $argv ls end function fish_user_key_bindings bind \cr peco_select_history end
Emacs の設定ファイル ~/.emacs.d/init.el
も編集します。
(load-theme 'wombat t) (global-set-key (kbd "C-h") 'delete-backward-char) (menu-bar-mode -1)
N 予備校 第 3 章
nvm
をインストールします。
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
教材テキストにならって v10.14.2
をインストールします。インストール可能なバージョンを確認するのは nvm ls-remote
というコマンドでした。
$ nvm ls-remote $ nvm install v10.14.2 $ nvm use v10.14.2
わかったこと(Fact)
Node.js では変数 process.argv
にコマンドライン引数の array が入っている
process.argv[0]
:node
コマンドのファイルのパスprocess.argv[1]
: 実行しているプログラムのファイルのパスprocess.argv[2]
: 最初の引数
JavaScript の truthy/falsy
truthy
falsy と決められているもの以外。
falsy
false
0
/-0
''
/""
(空文字列)null
undefined
NaN
参考文献(References)
- nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
- Truthy - MDN Web Docs Glossary: Definitions of Web-related terms | MDN
- Falsy - MDN Web Docs Glossary: Definitions of Web-related terms | MDN