summary refs log tree commit diff stats
path: root/compiler/nodejs.nim
blob: 283643e8d2edd084c8625148e5ea7eb2c89b1553 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import os

proc findNodeJs*(): string {.inline.} =
  ## Find NodeJS executable and return it as a string.
  result = findExe("nodejs")
  if result.len == 0:
    result = findExe("node")
  if result.len == 0:
    echo "Please install NodeJS first, see https://nodejs.org/en/download"
    raise newException(IOError, "NodeJS not found in PATH: " & result)