Q:

Dots in snekfetch request are causing a problem

I'm trying to get data from a json file with snekfetch for my discord bot but I have a problem...
This is a part of the json file
"nodes":{
    "main.c10":{
        "online":1624,
        "inbattles":829
    },

If I want to get "online" number I should write this
var c10 = r.body.nodes.main.c10.online;
but with the dot after main is interpreting the request like this:
"nodes":{
    "main {
         .c10":{
            "online":1624,
            "inbattles":829
          }
    },

How I can solve this problem?

A:

You can access that property with square brackets:
var c10 = r.body.nodes['main.c10'].online;

Edit in response to comments:
In this case r.body is a buffer, and so you need to first convert it to an object, only then you can access its properties like .nodes. You can find a working demo here.
JSON.parse(r.body.toString()).nodes['main.c10'].online

