Zero-dependency wrapper around the Figma API for Node.js.
Grab the lib:
npm i @design-automata/node-figma
Export your Figma PAT in your environment variables before proceeding.
export FIGMA_PAT="your_figma_pat"
Import and use:
const { getFile } = require('@design-automata/node-figma')
// ES6
import { getFile } from '@design-automata/node-figma'
getFile(fileId: string, optionalParams?: getFileOptionalParams)
getFileNodes(fileId: string, nodeIds: string, optionalParams?: getFileNodesOptionalParams)
getFileImages(fileId: string, nodeIds: string, optionalParams?: getFileImagessOptionalParams)
getFileStyles(fileId: string)
getTeamStyles(teamId: string, optionalParams?: getTeamStylesOptionalParams)