
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
figma-exporter
Advanced tools
NodeJS library that helps with exporting images from your Figma project.
NodeJS library that helps with exporting Figma project.
npm i figma-exporter
Before you get started, generate a Figma access token. This will be used to authenticate with the Figma API and get access to the files you want to export.
You will also need your file id so the module knows which to run the export on.
const FigmaExporter = require('figma-exportor').default;
const client = new FigmaExporter("<your_figma_token>", "<file_id>");
PAGE
, CANVAS
, and FRAME
types. The example below will collect information about 6 Figma nodes:const filter = {
name: [
'Onboarding',
'Footer'
],
id: [
'1:24',
'31:25',
'1:100',
'1:47'
]
};
let nodes = await client.collectNodes(filter)
This outputs the following format:
[
{ id: '1:419', name: 'Onboarding', images: [] },
{ id: '31:7299', name: 'Footer', images: [] },
{ id: '1:24', name: 'Header', images: [] },
...
]
jpg
, png
, svg
pdf
;let images = await client.getNodeImageUrls('png')
This outputs the following format:
[
{
id: '1:419',
name: 'Onboarding',
images: [{
imageUrl: '<url>',
imageFormat: 'png'
}]
},
{
id: '31:7299',
name: 'Footer',
images: [{
imageUrl: '<url>',
imageFormat: 'png'
}]
},
...
]
data.json
) to a folder. The default folder for this is ./figma-export
.let result = await client.writeImages('./data');
This outputs the following format, which corresponds to the data that is written to data.json
:
[
{
id: '1:419',
name: 'Onboarding',
images: [{
imageUrl: '<url>',
imageFormat: 'png',
fileName: 'Onboarding.png'
}]
},
{
id: '31:7299',
name: 'Footer',
images: [{
imageUrl: '<url>',
imageFormat: 'png',
fileName: 'Footer.png'
}]
},
...
Full example that export Splashscreen
and Contact
to both svg and pdf:
const FigmaExporter = require('figma-exportor').default
const client = new FigmaExporter("<your_figma_token>", "<file_id>");
const filter = {
name: [
'Splashscreen',
'Contact'
]
}
const nodes = await client.collectNodes(filter);
const nodesWithImages = await client.getNodeImageUrls('svg');
const nodesWithImages = await client.getNodeImageUrls('pdf');
const result = await client.writeImages();
FAQs
NodeJS library that helps with exporting images from your Figma project.
The npm package figma-exporter receives a total of 1 weekly downloads. As such, figma-exporter popularity was classified as not popular.
We found that figma-exporter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.