Download Latest Version v4.5.2 source code.tar.gz (2.7 MB)
Email in envelope

Get an email when there's a new version of happyx

Home / v0.27.1
Name Modified Size InfoDownloads / Week
Parent folder
PURE Js In Nim .tar.gz 2023-05-25 296.3 kB
PURE Js In Nim source code.tar.gz 2023-05-25 296.3 kB
PURE Js In Nim source code.zip 2023-05-25 320.6 kB
PURE Js In Nim.zip 2023-05-25 320.6 kB
README.md 2023-05-25 950 Bytes
Totals: 5 Items   1.2 MB 0

New buildJs macro is available. With it you can use PURE Js.

:::nim
buildJs:
  var one = 123  # let one = 123
  let two = 234  # const two = 234
  const three = 345  # const three = 345

  if one === 123:  # Js ===
    echo one  # console.log(one)
  elif ...  # else if (...) { ... }
    ,,,
  else:
    ...

  case two  # switch (two) {
  of 1, 2, 3, 4:  # case 1: case 2: case 3: case 4:
    echo "1 <= one <= 4"
  else:  # default:
    echo "one is 123"

  var arr = [1, 2, 3]  # let arr = [1, 2, 3]
  function fn(array):  # function fn(array) { ... }
    for (val, index) in array:
      echo val, index
  fn(arr)

  class Animal:
    say():
      discard
  class Dog extends Animal:
    say():
      echo "Woof!"
  class Cat extends Animal:
    say():
      echo "Meow"
Source: README.md, updated 2023-05-25