The compiler checks if a class has [JSModule] metadata. If you create a
typedef SWC for the node-zip module, and include that metadata, the
compiler will automatically add require() calls when you use the module.

The externc utility in the SDK has a named-module option that you can use
to specify names of modules that should include [JSModule] metadata.

My dts2as utility has a similar moduleMetadata option.

- Josh

On Sun, Nov 6, 2016 at 12:51 PM, Harbs <harbs.li...@gmail.com> wrote:

> I’m trying to wrap my head around how FlexJS works with node.
>
> My understanding is you can just do something like this:
> fs.existsSync(path) and the necessary fs = require(‘fs’); will
> automatically be output.
>
> How does this work with external node modules? Let’s say for example I’d
> want to use node-zip[1]? How would I specify that? Would it just be var
> zip:* = require(‘node-zip’) and just used it all untyped? What if we want
> typed third-party node-modules?
>
> Thanks,
> Harbs
>
> [1]https://www.npmjs.com/package/node-zip

Reply via email to