nodeca/js-yaml — Issue #10: require() returns single-element array
Author: kcivey
Created: 2011-11-02 16:51:43+00:00
State: open

When I do something like `var c = require('config.yaml');` I get a single-element array with the YAML-derived data structure as the element. I guess that's more or less as documented, but it seems strange. I would have expected that I'd get just the data structure, with no extra array around it. Having to use a `[0]` to get to the actual data is an annoyance. Is there some point I'm missing?

That is, I'd hoped to get

{"property1":"value1","property2":"value2"}

but instead I get

[{"property1":"value1","property2":"value2"}]