I am using nodejs's module "xml2js" but I need to find the root of the result.
parseString(data, function (err, result) {
console.log(result);
});
gives me
{ 'the-listener': { child1: [ 'test' ], child2: [ 'test' ] } }
And I want to just get 'the-listener'.
Instead of console.log(result) what do I need to change that to in order to get just 'the-listener'?
User0123456789
7582 gold badges10 silver badges25 bronze badges
-
Seems like a duplicate of stackoverflow.com/questions/22565077/…Ray Stantz– Ray Stantz2016年04月08日 16:07:21 +00:00Commented Apr 8, 2016 at 16:07
-
@RayStantz Thanks, it was.user3394199– user33941992016年04月08日 16:25:25 +00:00Commented Apr 8, 2016 at 16:25
lang-js