flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Tynjala <joshtynj...@gmail.com>
Subject Re: FlexJS node modules
Date Sun, 06 Nov 2016 21:05:52 GMT
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.lists@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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message