# Exporter Anatomy

You can think about exporters as NPM packages - they are self-contained packages of code and configuration that gives them a very specific purpose. For example, when you find exporter package `tagged` as `Flutter` and `Tokens`, you can immediately say you will get styling code to be used in your Flutter codebase. When developing exporters, **you have a complete control over everything defined inside exporters** and how they should generate the resulting code.

### Basic Exporter Package Structure

Each exporter package contains few required parts, and then whatever custom parts you want. Let's look at the `Flutter` exporter Supernova team prepared for you (you can get it right from [Exporter Store](../../using-exporters/exporter-store)):

![Full structure of Supernova Flutter Exporter. Seems easy, right? It definitely is.](https://3953636179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUnb_OsKFud9s-2JHEt%2F-MWn4Ozt8fFXD-nx4R0g%2F-MWnInazDWM9eP81QCu9%2FSni%CC%81mek%20obrazovky%202021-03-27%20v%C2%A011.48.25%20\(2\).png?alt=media\&token=c050f2ed-b85d-48c5-8456-77c9aff7735b)

Let's go through all its parts, one by one.

### (required) Package Configuration - `exporter.json`

**The main configuration file** that always must lie in the root folder is named `exporter.json`. This contains metadata about the exporter package such as name, author or description that will show up in the exporter store or anywhere the exporter is used (for example, by your collagues).

The main configuration file also allows you to define folder where your blueprints live, if you want to use javascript, what version of Supernova engine to use and so on.

![exporter.json is present in every package and its configuration. Most attributes are required.](https://3953636179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUnb_OsKFud9s-2JHEt%2F-MWn4Ozt8fFXD-nx4R0g%2F-MWnMHwBQq41bxYhMF56%2FSni%CC%81mek%20obrazovky%202021-03-27%20v%C2%A012.05.47%20\(2\).png?alt=media\&token=a2890c0b-c1e0-4d33-9665-57b5feb882be)

### (required) Output Configuration - `output.json`

Another file that you will be tweaking often is `output.json`. This file contains **mapping of what files should be produced when exporter runs** and how it maps to the code you have created.

![output.json defines the structure of what blueprints will be invoked and where the results will be written](https://3953636179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUnb_OsKFud9s-2JHEt%2F-MWn4Ozt8fFXD-nx4R0g%2F-MWnMqazrYHfp4aC1xNt%2FSni%CC%81mek%20obrazovky%202021-03-27%20v%C2%A012.07.27%20\(2\).png?alt=media\&token=062b3d34-2680-4e5a-b7de-9ca2aae7c0d7)

### (optional) Blueprint Behavior Configuration - `sources.json`&#x20;

When you need **advanced or granular control over specific blueprints**, you can use `sources.json` to tweak it. Most often, you will use default configuration for each file you are generating, so this is optional.

![](https://3953636179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUnb_OsKFud9s-2JHEt%2F-MWn4Ozt8fFXD-nx4R0g%2F-MWnOAduT0mmVGfepVR7%2FSni%CC%81mek%20obrazovky%202021-03-27%20v%C2%A012.14.22%20\(2\).png?alt=media\&token=cfc8de33-1c4d-408f-91a7-82a3fe2607b9)

{% hint style="info" %}
With source configuration, you can make exporters that have different purposes depending on what they target. For example, you can create an exporter that when used from the CI, will completely remove all comments from your source code - but if your teammates use the same exporter inside the documentation, it will present the code with extensive commentary.
{% endhint %}

### (required) Source folder - by default `/src`

The main **folder that houses all the source code** for all the blueprints (and optional javascript helpers). Each blueprint that you create must be present in this folder, otherwise, it will be ignored. You can use any structure of sub-folders to properly split and organize your blueprints.

![Source folder housing all your blueprints](https://3953636179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUnb_OsKFud9s-2JHEt%2F-MWnOrSgRB1HCa0x6wPA%2F-MWnQN8H45zqXp-2csNO%2FSni%CC%81mek%20obrazovky%202021-03-27%20v%C2%A012.23.33%20\(2\).png?alt=media\&token=caae0325-913e-491f-985d-ab2f65bd8735)

{% hint style="warning" %}
Each blueprint ends with `.pr` extension (Pulsar language). **Please note that each blueprint must have a unique name, even if it is in a different subfolder.**&#x20;

Pulsar language allows you to "inject" blueprints into other blueprints. By making all files unique, you always know what to reference and you never need to worry about which folder you are referencing.&#x20;
{% endhint %}

### (optional) JS helper file

Last, but certainly not least, **exporters can use your javascript code if you need to do some more complex computation** outside the coding templates. You can define an optional javascript file that will host all those computation helpers.&#x20;

If you want to learn more about all possible configuration options in all mentioned files, go directly to [exporter configuration](exporter-configuration). Otherwise, it is time to learn about the arguably most important part of the exporter package, [the blueprints](pulsar-blueprints).
