In bin scripts, do '#!/usr/bin/env node --harmony_whatever' as your shebang
line. In library modules, test and throw a useful error right away.

And as others have said, document it in the readme.

On Saturday, December 29, 2012, Tristan Slominski wrote:

> That makes sense.. and as you say, it is well established in JS. I don't
> see any other sane way of accomplishing that. It works for my use case,
> I'll make sure it's obvious in the README as well. Thanks.
>
> On Saturday, December 29, 2012 7:13:54 PM UTC-6, Bradley Meck wrote:
>>
>> If you are using a non-standard (harmony) expectation in your library you
>> should test and bail on an environment that does not supply the interfaces
>> expected. I think throwing on missing expectations is one solution the
>> other is to require a shim if the expectation is not present. Both are
>> pretty de-facto in JS. Putting this into package.json etc would mean that
>> you are requiring CLI switches that are non-standard to be in place.
>> Shimming and throwing are perfectly valid for this case.
>>
>> I see this as little difference from requiring a peer module or a module
>> that expects a non-present global variable (lots of tests suites bootstrap
>> in globals, errors are usually but not always obvious due to this).
>>
>  --
> 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 
> nodejs@googlegroups.com<javascript:_e({}, 'cvml', 'nodejs@googlegroups.com');>
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com <javascript:_e({}, 'cvml',
> 'nodejs%2bunsubscr...@googlegroups.com');>
> 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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to