salesforce-ux/theo

Something went wrong: Error: Invalid option "file": must be a path

prodtest375 opened this issue · 0 comments

`const express = require('express')
const app = express()
const port = 3000
const theo = require("theo");

var obj = {

props: [
{
name: 'product-color',
type:'color',
value: '#ff0000',
category :'font-color'
},
{
name: 'product-colorone',
type:'color',
value: 'rgb(1,2,3)',
category :'font-color'
}
]
};

app.get('/', (req, res) => {
theo.convert({
transform: {
type: "web",
//file: "collection.json",
data : JSON.stringify(obj)
},
format: {
type: "less"
}
})
.then(scss => {
console.log(scss);
// $button-background: rgb(0, 112, 210);
})
.catch(error => console.log(Something went wrong: ${error}));
res.send('Hello World!')
})

app.listen(port, () => {
console.log(Example app listening at http://localhost:${port})
})`
I need to format the javascript object to design tokens, above is my code , it shows error like "Something went wrong: Error: Invalid option "file": must be a path", It works fine when I created json file and give that path in file option.
Any help appreciated.