0.1.0-alpha.4 • Published 1 day ago

@ltd-toolbox/figma-parser v0.1.0-alpha.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 day ago

Figma Parser

Tool for parsing and traversing through figma files.

Plugins

You can use multiple different plugins with Figma Parser, for example:

  • Document (loaded by default) - allows for traversing Figma document using convinient API
  • Styles - Fetches and parses Style information from Figma document. It also can export these information using W3C Desgin Tokens Format for known styles.
  • HardCache - Caches File requests for better performance.

All plugins are exported and you can use them as you want.

import { FigmaParser } from '@ltd-toolbox/figma-parser/parser'
import { Styles } from '@ltd-toolbox/figma-parser/plugins/styles'

(async() => {
  const parser = new FigmaParser(TOKEN, {
    plugins: [Styles],
  })

  const document = await parser.styles('<fileId>')

  // [...]
})()

Loading plugins

It is possible to load plugins using constructor, or .use() metthod:

const parser = new FigmaParser(TOKEN)

parser.use(HardCache, Styles)
const parser = new FigmaParser(TOKEN, {
  plugins: [HardCache, Styles]
})

Plugins options

Plugins can extend default parser options. For example HardCache Plugin extends options by hardCache: boolean

  const parser = new FigmaParser(TOKEN, {
    plugins: [Styles],
    hardCache: true // Option added by HardCache plugin.
  })
0.1.0-alpha.5

1 day ago

0.1.0-alpha.4

2 months ago

0.1.0-alpha.3

2 months ago

0.1.0-alpha.2

2 months ago

0.1.0-alpha.1

5 months ago

0.0.1-alpha.25

5 months ago

0.0.1-alpha.24

5 months ago

0.0.1-alpha.23

5 months ago

0.0.1-alpha.22

5 months ago

0.0.1-alpha.21

5 months ago

0.0.1-alpha.20

5 months ago

0.0.1-alpha.16

6 months ago

0.0.1-alpha.15

6 months ago

0.0.1-alpha.13

6 months ago

0.0.1-alpha.12

7 months ago

0.0.1-alpha.11

7 months ago