guy mograbi guy mograbi - 1 year ago 180
Node.js Question

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

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 Source

I don't have a node installation at hand, but looking at sources it seems that they allow strings as well:

  mode     : '0644'

Does it work?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download