# Parsers

Not familiar with parsers? Head over to the existing parsers documentation and learn more about why you need them and how to use them.

{% hint style="info" %}
We're currently working on making [our existing parsers](https://docs.specifyapp.com/v1/concepts/parsers#all-parsers-available) compatible with the SDTF. We'll update this page accordingly.
{% endhint %}

## General properties

You must set a name and your desired output for each parser:

1. The `name` is the name of the parser
2. The `output` property indicates which type of output you want the parser to produce

### Output types

Parsers support none, some or more output types, please refer to dedicated parser pages for details.

#### File

Use case: the parser is expected to produce exactly one file.

```typescript
type FileOutput = {
  type: 'file';
  filePath: string;
}
```

**Directory**

Use case: the parser is expected to produce 0 to N files, all placed in the given `directoryPath`.

```typescript
type DirectoryOutput = {
  type: 'directory';
  directoryPath: string;
}
```

Example with the `to-css-custom-properties` parser:

```json
"parsers": [
  {
    "name": "to-css-custom-properties",
    "output": {
      "type": "file",
      "filePath": "style.css"
    }
  }
  // ...
]
```

## Available parsers

<table data-full-width="true"><thead><tr><th width="264">Parser</th><th width="586.3333333333334">Description</th><th>Usage example</th></tr></thead><tbody><tr><td><a href="parsers/change-case">change-case</a></td><td>This parser helps you change the case of names or modes over a SDTF graph.</td><td><a href="change-case#basic-usage">Example</a></td></tr><tr><td><a href="parsers/convert-color">convert-color</a></td><td>This parser helps you convert the color formats of color compatible tokens over a SDTF graph.</td><td><a href="convert-color#basic-usage">Example</a></td></tr><tr><td><a href="parsers/filter">filter</a></td><td>This parser helps you filter a SDTF graph.</td><td><a href="filter#basic-usage-select-all-tokens-from-a-group-in-a-collection">Example</a></td></tr><tr><td><a href="parsers/select-modes">select-modes</a></td><td>This parser helps you select design tokens from specific mode(s).</td><td><a href="select-modes#basic-usage-select-all-tokens-from-a-mode-named-light">Example</a></td></tr><tr><td><a href="parsers/to-css-custom-properties">to-css-custom-properties</a></td><td>This parser helps you transform design tokens in CSS Custom Properties.</td><td><a href="to-css-custom-properties#basic-usage">Example</a></td></tr><tr><td><a href="parsers/to-sdtf">to-sdtf</a></td><td>This parser helps you get your design tokens as a SDTF graph in JSON.</td><td><a href="to-sdtf#basic-usage">Example</a></td></tr><tr><td><a href="parsers/to-style-dictionary">to-style-dictionary</a></td><td>This parser helps you generate <a href="https://amzn.github.io/style-dictionary/#/">Style Dictionary</a> raw token files for all your design tokens coming from Specify.</td><td><a href="to-style-dictionary#basic-usage">Example</a></td></tr><tr><td><a href="parsers/to-tailwind">to-tailwind</a></td><td>This parser helps you generate a Tailwind theme from all your design tokens coming from Specify.</td><td><a href="to-tailwind#basic-usage">Example</a></td></tr><tr><td><a href="parsers/to-javascript">to-javascript</a></td><td>This parser helps you pull design tokens as JavaScript objects for all token types and their respective getter functions.</td><td><a href="to-javascript#basic-usage">Example</a></td></tr><tr><td><a href="parsers/to-json">to-json</a></td><td>This parser helps you pull design tokens in JSON with token values in JSON or CSS.</td><td><a href="to-json#basic-usage-json-token-values">Example</a></td></tr><tr><td><a href="parsers/to-typescript">to-typescript</a></td><td>This parser helps you pull design tokens as TypeScript objects for all token types and their respective getter functions.</td><td><a href="to-typescript#basic-usage">Example</a></td></tr></tbody></table>
