2

i've installed the latest (complete) version of netbeans (v 8.1) and node.js to learn node.js (Javascript) on my Windows 7 machine.

I created a new Node.js Application Project but I get errormessages when i write template strings like this:

console.log(`STDIN Data Recieved -> ${data.toString().trim()}`);

It says that the backtick was unexpected and it would be an error. The Syntax highlighting fails then in the whole function.

Is there anything i can do?

2 Answers2

1

NetBeans 8.1 does not have support for ES6 (ES2015) so using features like template strings (literals) may result in seeing errors in NetBeans. The ES6 support is planned for the next NetBeans release

ladar
  • 5,858
  • 3
  • 26
  • 38
1

The Netbeans TypeScript editor plugin includes support for template strings. I was able to make your sample work with an arbitrary value for data.

let data = 0xABCD;
console.log(`STDIN Data Received -> ${data.toString().trim()}`);

produced this output in the console:

STDIN Data Received -> 43981
Joel Murphy
  • 845
  • 1
  • 6
  • 13