0.0.15 • Published 3 months ago

figma-to-html v0.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

figma-to-html

NPM version NPM downloads

Install

$ pnpm install figma-to-html

Usage

import { FigmaParser } from "figma-to-html";
const figmaParser = new FigmaParser({
  clientId: "clientId",
  clientSecret: "clientSecret",
  redirectUri: "redirectUri",
});

//single:figma url
figmaParser
  .parse(url, { onProgress: (progress) => {} })
  .then((htmlText) => {
    console.log(htmlText);
  })
  .catch((error) => {
    console.log(error);
  });

//batch:figma url array
figmaParser
  .parseBatch(urls, { onProgress: (progress) => {} })
  .then((htmlText) => {
    console.log(htmlText);
  })
  .catch((error) => {
    console.log(error);
  });

//image
figmaParser
  .parseToImage(url)
  .then((imageUrl) => {
    console.log(imageUrl);
  })
  .catch((error) => {
    console.log(error);
  });

Options

OptionTypeDefaultRequiredDescription
clientIdstring-figma clientId
clientSecretstring-figma clientSecret
redirectUristringlocation.origin + location.pathnamefigma redirectUri
tplbooleantruetemplate
placeholderImagestring-placeholder image url
imageResolver(url: string, type: ImageType) => Promise<string>base64 image resolverimage resolver
onProgress(progress: number) => void-progress callback

LICENSE

MIT

0.0.15

3 months ago

0.0.10

4 months ago

0.0.11

4 months ago

0.0.12

4 months ago

0.0.13

4 months ago

0.0.14

4 months ago

0.0.9

4 months ago

0.0.8

4 months ago

0.0.5

4 months ago

0.0.7

4 months ago

0.0.6

4 months ago

0.0.4

4 months ago

0.0.3

4 months ago

0.0.2

4 months ago

0.0.1

4 months ago