Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@figma-export/output-components-as-es6

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@figma-export/output-components-as-es6 - npm Package Compare versions

Comparing version 0.0.1-alpha.0 to 0.0.1-alpha.3

32

index.js
const fs = require('fs');
const path = require('path');
const camelCase = (str) => {
return str.replace(/^([A-Z])|[\s-_]+(\w)/g, function (match, p1, p2, offset) {
if (p2) return p2.toUpperCase();
return p1.toLowerCase();
});
};
const camelCase = (str) => str.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => {
if (p2) return p2.toUpperCase();
return p1.toLowerCase();
});
module.exports = options => {
module.exports = (options) => {
if (!fs.existsSync(options.output)) {
const err = new Error(`Folder '${options.output}' doesn't exist`)
throw err
const err = new Error(`Folder '${options.output}' doesn't exist`);
throw err;
}
return async pages => {
return async (pages) => {
let code = '';
Object.entries(pages).forEach(([pageName, page]) => {
Object.entries(pages).forEach(([, page]) => {
Object.entries(page).forEach(([filename, { svg }]) => {

@@ -30,8 +27,7 @@ const variableName = camelCase(filename);

fs.writeFile(path.resolve(options.output, 'figma-components' + '.js'), code,
err => {
fs.writeFile(path.resolve(options.output, 'figma-components.js'), code,
(err) => {
if (err) throw err;
}
)
}
}
});
};
};
{
"name": "@figma-export/output-components-as-es6",
"version": "0.0.1-alpha.0",
"version": "0.0.1-alpha.3",
"description": "Outputter for @figma-export that exports components in javascript file",

@@ -8,3 +8,3 @@ "main": "index.js",

"type": "git",
"url": "https://github.com/marcomontalbano/figma-exporter.git",
"url": "git+https://github.com/marcomontalbano/figma-exporter.git",
"directory": "packages/output-components-as-es6"

@@ -17,6 +17,3 @@ },

},
"scripts": {
"test": "echo \"Run tests from root\" && exit 1"
},
"gitHead": "6a17670653a172c28d67bdbd8de14ab52123feba"
"gitHead": "e2a08c659f0b4385d7bcbc570624c7714a87bf94"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc