跳到主要內容

發表文章

目前顯示的是有「modules」標籤的文章

MacOS 編輯器快捷建設定, short key of editor

本文主要針對 Mac 使用者,身為一個開發者總是會使用過 Mac (這不一定正確就是了),總之本文就是基礎於開發者需求,讓大家可以帥氣的開發。 針對自己有在使用的編輯器進行介紹, Atom Atom 安裝後就可以直接再 iterm ,切換到希望使用的專案資料夾, cd $PATH atom ./ Sublime Text 2 / 3 Sublime Text 到 iterm 之後,輸入以下指令, ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl 如果是 sublime text 3 ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl 接下來就可以直接使用 cd $PATH subl ./ Visual Studio Code Visual Studio Code 設定方式,編輯 .bashrc (取決於自己用什麼樣的 shell) code () { if [[ $# = 0 ]] then open -a "Visual Studio Code" else [[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}" open -a "Visual Studio Code" --args "$F" fi } 接下來就可以直接使用 cd $PATH code ./ 是不是很方便愉快了,直接切到資料夾中,就可以開始進入編輯模式,透過指令可以做快速切換,真正人生一大樂事,這也是我們為什麼喜歡使用 Mac 的原因了。 Ref OS X Command Line Setting up Visual Studio Code

semver, node package.json, dependency module version operators

semver node package.json, dependency module version operators 之前沒有注意到這個問題,現在 node modules 越來越多,原來在 npm 裡面早就有進行相關的版本管理。可以透過這個頁面看到詳細的描述資訊。 The semantic versioner for npm 特別要介紹的部份是, ^ 字元與版本關係 ^ 表示可以進行兼容模式,當第一個非 0 數字被符合之後,就會此此版本安裝。當可安裝版本為 > 0.1.5 ,此時是會直接使用 0.1.5 這個版本進行安裝。 如果一開始使用非 0 數字為版本,就會變成兼容模式,會去尋找符合第一個數字的版本,其他小數字本版號視為可以兼容。 目前 npm install node_modules --save 會採用 ^ 這個符號。 ^0.1.3 := >=0.1.3-0 <0.2.0-0 "Compatible with 0.1.3". 0.x.x versions are special: the first non-zero component indicates potentially breaking changes, meaning the caret operator matches any version with the same first non-zero 另外一種版本 ^1.2.3 := >=1.2.3-0 <2.0.0-0 "Compatible with 1.2.3". When using caret operators, anything from the specified version (including prerelease) will be supported up to, but not including, the next major version (or its prereleases). 1.5.1 will satisfy ^1.2.3, while 1.2.2 and 2.0.0-beta will not. ~ 字元與版本關係 版本需要數字符合,例如底下的例子...