Wednesday 15 May 2013

node.js - Require fay code from nodejs -


Does the nodejs require f-compiled modules from other ordinary JavaScript files on the server side? It might just be great that there is some choice in the compiler to produce common-compatible modules?

This is probably a bad idea, because it is quite Note

Note the following points:

  • Even if the name of the compiled module is named, the variable variable main .
  • Under node. Js, the return value of is of the module's modules.export (which is the same thing as export in the beginning - but it's not necessarily that way).
  • A variable can be used before it can be declared with its scoping var The referenced variable is similar, its source does not care anything in order to give it, and in runtime There is nothing to care for anything that has happened.
  • By default, the object (i.e. - library without) is an object instant and main .

    In particular, this means that we can modify main , mod.exports or . Of course, we should use FFI to export the export code phay code, but this is a simple matter; - Library (which is, yes, lightly defendant, and in fact this hypothesis assures that it is a dirty hack, it is not) without compiled, work to some extent:

      import FFI main :: FE (main) = FFI "module.exports = main"   

    when is required 'n node, returned object

      {' main $ main '}: {Forced: true, value: {value: [circular]}}, _ : [Function: $ $ _], '$': [function: fay $$$] , '$ Featos': [function: fe $ $ fayotes], '$ jstofe': [function: fay $$ jstofae]}   

    With the work knowledge of the internal representation of F.E., It is possible (though probably too much effort) to write all the thumb-compelling and javascript wrapper for such.

    (In fact, with some other FFI work, we can write all the bindings in the form of a FII code, though it will be a little silly.) < / Div>

No comments:

Post a Comment