Isaac,
That's great, I use"//" in other places but always assumed they would get
iterated in package.json dependencies. So we can safely do this?
{ "dependencies" :
{ "foo" : "1.0.0 - 2.9999.9999"
, "//" : " comment about baz"
, "baz" : ">1.0.2 <=2.3.4"
, "//": " comment about boo"
, "boo" : "2.0.1"
}
}
On Jan 6, 2013 8:57 AM, "Isaac Schlueter" <[email protected]> wrote:
> As long as I have a say in the matter, package.json file will always
> be json. If anything, future versions of npm and node will *remove*
> features rather than add them. (I'm looking at you, `scripts.install`
> ;)
>
> That being said, I completely understand the desire to put additional
> data into your JSON configuration files. That's why the "//" key will
> never be used by npm for any purpose, and is reserved for comments.
>
> If you want to use a multiple line comment, you can use either an
> array, or multiple "//" keys.
>
> { "//": "this is the first line of a comment",
> "//": "this is the second line of the comment" }
>
> { "//": [
> "first line",
> "second line" ] }
>
> If your editor doesn't display this to your satisfaction, then fix
> your editor. Vim, emacs, sublime text, textmate, and most other
> editors support custom extensions and color schemes. Some of those
> are even open source, so you can really go nuts if you want to.
>
> You're not a bad person if you use comments in your configs. I would
> tend to read that as a code smell, but the world is a complicated
> place, and we all sometimes do things we're not proud of. If you need
> to add comments to your JSON config file, consider if perhaps the keys
> are not understandable enough, or if there is some more semantic way
> to express what you're trying to do.
>
> (The point was made about comments in code. I have the same opinion
> there: comments are a sign of an overly complicated or poorly
> understood design. But often it's the lesser evil.)
>
> Any pull requests to Node, npm, or read-package-json which add
> pre-formatting, cson, package.js, #-comments, etc, will be rejected.
> Patches unwelcome.
>
>
> On Sun, Jan 6, 2013 at 12:00 AM, Trevor Norris <[email protected]>
> wrote:
> > On Saturday, January 5, 2013 11:34:25 PM UTC-8, Alex Kocharin wrote:
> >>
> >>
> >> Hi Trevor,
> >>
> >>
> >> I'm talking about package configuration, not build configuration. gyp
> has
> >> absolutely nothing to do with it.
> >
> >
> >
> > Please excuse me while I remove my foot. Well, imho it would make sense
> that
> > the package.json file would follow the same standards as the gyp files.
> The
> > consistency makes sense to me. You can always create a pull request with
> > changes: https://github.com/isaacs/npm
> >
> > --
> > Job Board: http://jobs.nodejs.org/
> > Posting guidelines:
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en