How do I create a base64 JSON encoded strings in nodejs?

I tried this and it didn't work.

```
var buff = new Buffer({"hello":"world"}).toString("base64");

```

Is this it?

```
var buff = new Buffer(JSON.stringify({"hello":"world"})).toString("base64");

```