panthro
panthro

Reputation: 24059

Non Associative Array in package.json

I need an array of languages in package.json, I've tried:

"langs": {
    "en", "es"
 }

But it's not valid.

How can I store an array of languages in my package.json file?

Upvotes: 0

Views: 86

Answers (2)

lisa
lisa

Reputation: 579

Use square brackets [] instead of curly braces {}.

Curly braces are for objects: "dog":{'name':'foobar'}

More info on syntax here: http://www.w3schools.com/json/json_syntax.asp

Upvotes: 2

Jack hardcastle
Jack hardcastle

Reputation: 2875

"langs": ["en", "es"]

Should work, so just replace your { with [ and } with ].

Upvotes: 1

Related Questions