how to avoid "Octal literals are not allowed in strict mode" with createWriteStream

guy mograbi picture guy mograbi · May 12, 2014 · Viewed 71.2k times · Source

I have the following code

 fs.createWriteStream( fileName, {
        flags    : 'a',
        encoding : 'utf8',
        mode     : 0644
    });

I get a lint error

Octal literals are not allowed in strict mode.

What is the correct way to do this code so I won't get a lint error?

Answer

ariel picture ariel · Sep 24, 2016

I came through this problem while using it in a scape squence:

console.log('\033c'); // Clear screen

All i had to do was convert it to Hex

console.log('\x1Bc'); // Clear screen