Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatic API options should follow Javascript naming conventions #325

Closed
JonathonAshworth opened this issue Apr 14, 2016 · 3 comments · Fixed by #580
Closed

Programmatic API options should follow Javascript naming conventions #325

JonathonAshworth opened this issue Apr 14, 2016 · 3 comments · Fixed by #580
Labels

Comments

@JonathonAshworth
Copy link

In the programmatic API documentation it lists hyphenated properties for the options object such as "app-copyright" and "app-version". These are not valid identifiers and should be camelCased instead, so that string identifiers and array-notation don't have to be used to reference them.

Likewise, the version-string object takes properties that are Capitalized, which is unusual for Javascript objects (though doesn't run into the same problem of having to be defined with a string identifier like the hyphenated ones).

@malept malept added enhancement Feature request help wanted Needs a contributor from the community labels Apr 14, 2016
@malept
Copy link
Member

malept commented Apr 14, 2016

This is a reasonable request. Something to note for the person who decides to work on this: while camelCased identifiers are idiomatic for JavaScript APIs, they are not for the CLI flags. So, in cli.js there would need to be either a mapping or a function which consistently converted between the two styles. (The latter of which would obviously need unit tests.)

The other note I would make is that there should be a period of time where both versions of the converted APIs/flags are supported, and the old parameters noted as deprecated in the NEWS file.

@malept
Copy link
Member

malept commented Apr 16, 2016

Another thing I am reminded of as I clean up some code is that a lot of the options / sub-options (such as version-string) are passthroughs to other modules. So in addition to this issue, I would suggest also filing issues in other repositories, for example, node-rcedit (to continue with the example).

@malept
Copy link
Member

malept commented Jul 1, 2016

#410 reminded me of this issue. A quick search pointed me at camelize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants