0.1.0-alpha.4 • Published 9 months ago

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

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months 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.12

9 months ago

0.1.0-alpha.11

9 months ago

0.1.0-alpha.10

10 months ago

0.1.0-canary.0

1 year ago

0.1.0-alpha.9

10 months ago

0.1.0-alpha.8

12 months ago

0.1.0-alpha.7

1 year ago

0.1.0-alpha.6

1 year ago

0.1.0-alpha.0

1 year ago

0.1.0-alpha.5

1 year ago

0.1.0-alpha.4

1 year ago

0.1.0-alpha.3

1 year ago

0.1.0-alpha.2

1 year ago

0.1.0-alpha.1

1 year ago

0.0.1-alpha.25

2 years ago

0.0.1-alpha.24

2 years ago

0.0.1-alpha.23

2 years ago

0.0.1-alpha.22

2 years ago

0.0.1-alpha.21

2 years ago

0.0.1-alpha.20

2 years ago

0.0.1-alpha.16

2 years ago

0.0.1-alpha.15

2 years ago

0.0.1-alpha.13

2 years ago

0.0.1-alpha.12

2 years ago

0.0.1-alpha.11

2 years ago