Code highlight js

Paper
NVM is a simple tool to manage multiple node.js version for each projects
更新

is a simple tool to manage multiple node.js version for each projects.

In this article, I would like to show some tips to use nvm.

Installation

If you use macOS and Homebrew, please run the following command:

brew install nvm
mkdir ~/.nvm

Or if you use Linux, you can use the install script using cURL:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

Please Install the LTS version of Node.js to set default version.

nvm install --lts

If you use nvm and you put .nvmrc, you can use specific version of node.js.

About .nvmrc

.nvmrc specifies Node.js version in your project.

cd /path/to/project

echo "8.9.4" > .nvmrc

nvm use
Found '/path/to/project/.nvmrc' with version <9.4.0>

Automatically load dir

If you want to call automatically nvm use when you enter the directory, please write the following code in your ~/.zshrc

# NVM
export NVM_DIR="$HOME/.nvm"
  [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh"
  [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" 

# NVM / automatically load
autoload -U add-zsh-hook
load-nvmrc() {
  local node_version="$(nvm version)"
  local nvmrc_path="$(nvm_find_nvmrc)"

  if [ -n "$nvmrc_path" ]; then
    local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")

    if [ "$nvmrc_node_version" = "N/A" ]; then
      nvm install
    elif [ "$nvmrc_node_version" != "$node_version" ]; then
      nvm use
    fi
  elif [ "$node_version" != "$(nvm version default)" ]; then
    echo "Reverting to nvm default version"
    nvm use default
  fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
const a = 123;
return (
	<div>{a}</div>
)
function $initHighlight(block, cls) {
  try {
    if (cls.search(/\bno\-highlight\b/) != -1)
      return process(block, true, 0x0F) +
             ` class="${cls}"`;
  } catch (e) {
    /* handle exception */
  }
  for (var i = 0 / 2; i < classes.length; i++) {
    if (checkCondition(classes[i]) === undefined)
      console.log('undefined');
  }

  return (
    <div>
      <web-component>{block}</web-component>
    </div>
  )
}

export  $initHighlight;
# The Greeter class
class Greeter
  def initialize(name)
    @name = name.capitalize
  end

  def salute
    puts "Hello #{@name}!"
  end
end

g = Greeter.new("world")
g.salute

Special Thanks


この記事が気に入ったら応援お願いします🙏
saigon tudien
ゲームライター
saigon tudien
icon help
自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章自己紹介文章
YoutubeのURL