The exporter packages are configured so you can install almost any dependency you want through the npm. Because every exporter contains package.json, installing of the dependencies is very easy — simply run:
npm install --save [package-name]
in your exporter package root. Then, run npm run dev or npm run build to make the package part of the export bundle.
Security and limitations
The exporters run in secure hardened container that doesn't have access to the outside execution context by any means. This comes with few specific limitations that usually don't present a problem, but in rare cases might create strange behavior, especially when using sophisticated npm packages with a lot of dependencies.
If you have encountered such a problem and you are sure everything works on your side, ask in our community channels.
require limitations
For security reasons, it is not possible to use require beyond a few specific libraries that were deemed safe to use within the exporters. Those libraries are top-level node libraries, such as encoding and similar. Dynamic require is completely disabled, so it is not possible to dynamically request plugins to certain libraries and so on. Always use { module } import instead.
fetch not available
For security reasons, global fetch is not available. However, we have created a safe way to access data from the network using the Supernova SDK that you can use instead, that makes the fetch available safely.
Top-level utilities removed
Many obscure top-level utilities and classes are completely removed from the execution context. If you are getting X not defined where X is the name of the top-level utility, such as URL (this is however available), then this utility is not available. You can let us know and explain what you are missing and we might introduce it to the execution context in the next version.
We understand you might encounter some limitations because of our choices, but in developing many of the advanced exporters Supernova supports, we haven't encountered any issue that would completely prevent the creation of the exporter — they can almost always be worked around easily. For exporters that don't have any external dependencies, this is a non-issue.
If you have encountered something you can't crack yourself, please let us know, and let's work on it together.