Search code examples
javascriptnode.jsnetbeansbackticks

netbeans javascript error on template string (backticks)


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?


Solution

  • 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