demo/connections/third-party/qr/qr.js
function writeFileSync(cvs, data) {
    if (typeof data.path !== 'string') {
      throw new TypeError('Invalid path type: ' + typeof data.path);
    }

    var buff = cvs.toBuffer();
    var fd = fs.openSync(data.path, 'w', WRITE_MODE);

    try {
      fs.writeSync(fd, buff, 0, buff.length, 0);
    } catch (error) {
      fs.closeSync(fd);
    }
  }
function writeFileSync(cvs, data) {
    if (typeof data.path !== 'string') {
      throw new TypeError('Invalid path type: ' + typeof data.path);
    }

    var buff = cvs.toBuffer();
    var fd = fs.openSync(data.path, 'w', WRITE_MODE);

    try {
      fs.writeSync(fd, buff, 0, buff.length, 0);
    } catch (error) {
      fs.closeSync(fd);
    }
  }
function writeFileSync ( cvs , data ) { if ( typeof data . path !== 'string' ) { throw new TypeError ( 'Invalid path type: ' + typeof data . path ) ; } var buff = cvs . toBuffer ( ) ; var fd = fs . openSync ( data . path , 'w' , WRITE_MODE ) ; try { fs . writeSync ( fd , buff , 0 , buff . length , 0 ) ; } catch ( error ) { fs . closeSync ( fd ) ; } }
Write the data of the rendered canvas to a given file path.
Write the data of the rendered canvas to a given file path .