How to use Relay Hat with Node and JavaScript?

How to operate the SeeedStudio Relay Hat v.2 using Node.js? Are there any examples out there?

I’m trying with the following code:

const i2c = require('i2c-bus');

const ADDRESS = 0x20;
const REG_MODE = 0x06;
let REG_DATA = 0xff;

i2c.openPromisified(1)
  .then(i2c1 => {
    REG_DATA &&= ~(0x01 << 0);
    const BUFFER = Buffer.from([ADDRESS, REG_DATA]);
    i2c1.i2cWrite(ADDRESS, REG_MODE, BUFFER);
  })
  .catch(err => {
    console.error(err);
  });

Gives an error complaining that a buffer must be at least 6 bytes long.

I’m trying to use this guide as an example but it is written in Python and I don’t know how to convert it to JavaScript. Could somebody help me?