npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@spacejelly/figma-to-cloudinary

v0.0.3

Published

Convert a Figma art board to a Cloudinary URL

Downloads

1

Readme

Figma to Cloudinary

Transform a Figma artboard into a Cloudinary URL!

This is super experimental and is not officially supported by Cloudinary

Getting Started

  1. Install dependencies
yarn add @spacejelly/figma-to-cloudinary
# or
npm install @spacejelly/figma-to-cloudinary
  1. Import dependencies
const { figmaToCloudinary } = require('@spacejelly/figma-to-cloudinary');
  1. Add environment variables

Create a .env file with the following fields configured:

FIGMA_ACCESS_TOKEN="[Your Figma Access Token]"
  1. Configure and run script!
await figmaToCloudinary({
  cldCloudId: 'your-cloudinary-cloud-name',
  figmaFileId: 'figma-file-id',
  figmaNodeId: 'figma-node-id',
  textFields: {
    FIGMA_TEXT_FIELD_NAME: 'Text'
  }
});

Configuration

Settings

| Name | Type | Description | | ----------------|--------|----------------------------------| | cldCloudId | string | Cloudinary Cloud ID | | figmaFileId | string | Figma File ID | | figmaNodeId | string | Figma File Node ID | | textFields | object | Dynamic text layers | | options | object | Additional configuration options |

Options

The following can be passed along as properties to the options object:

| Name | Type | Default | Description | | ----------------|--------| --------------------------------| ------------| | baseImageId | string | https://i.imgur.com/hcmCzxl.png | External image or Cloudinary Public Image ID used for the Cloudinary base layer | | baseImageMethod | string | fetch | Method used for the Cloudinary Image API (Ex: upload, fetch) |

Dynamic Text Layers

To set up the ability to dynamically create text fields, you'll want to correctly indicate which fields in your Figma document are being used to do so by creating recognizable names of those text layers.

Inside Figma, when creating a Text layer, rename the layer itself to your Text Field Name, such as HEADER_TEXT. When configuring this tool, you can use that HEADER_TEXT as a property inside of textFields to dynamically set that value when rendering the artboard.

Organizing Your Figma Document

For best results with the current state of this tool, when rendering images it's recommended that each of the top level groups inside of your Figma artboard are considered to be in a rendered state.

When rendering the groups, this tool will use the Figma API to render that top level group "as is" without any layer effects.

Consider organizing your Figma artboard along the lines of:

My Artboard
- TEXT_LAYER_1 (Text layer)
- TEXT_LAYER_2 (Text layer)
- My Background Group (Group including all to-be-rendered imagery)

FAQ

How do I find my Figma File ID and File Node ID?

The easiest way to find your Figma File & Node ID is to use the Share feature.

Select your artboard in your Figma document and click Share. With the Share dialogue open, click Copy Link where you'll receive a URL in the following format:

https://www.figma.com/file/ABCD1234/Untitled?node-id=0%3A1

In the above, we can see our two values:

  • File ID: ABCD1234
  • Node ID: 0%3A1 or when decoded 0:1

What is the base image used for?

The base image defined as an external URL or Cloudinary Image ID (Public ID) is used to provide the base layer under all of the layers rendered from Figma. If you're using a real image, you would want to take this into consideration when building your image in Figma, otherwise like the default image used, you can use a transparent image as your base layer, using Figma for all layering needs.