import script --> .esm

C. Scott Ananian ecmascript at cscott.net
Wed Sep 10 19:45:23 PDT 2014


For what it's worth, node already deals with 'modules' versus 'plain
scripts'.  The latter typically start with `#!` and are found in a `bin`
subdirectory.  In case of ambiguity you can add `/* jshint ... */`
directives as necessary to select the appropriate language mode.  I don't
see this as a big deal, although I wouldn't object to .jsm being
standardized.

Wrt to the proposed `default.js` convention: node doesn't *need* to specify
a main entry point in the `package.json`. It could have chosen an arbitrary
convention. Overriding the entry point allows for extra flexibility in
practice, especially when adapting to legacy projects' existing directory
structures.
  --scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140910/8d9e5402/attachment.html>


More information about the es-discuss mailing list