Skip to content

Instantly share code, notes, and snippets.

@dacap dacap/generate-data.js
Last active Apr 18, 2016

Embed
What would you like to do?
var fs = require('fs');
var jay = JSON.parse(fs.readFileSync('jay.json', 'utf8'));
var robin = JSON.parse(fs.readFileSync('robin.json', 'utf8'));
var smile = JSON.parse(fs.readFileSync('smile.json', 'utf8'));
var data = { "jay": { "tags": jay.meta.frameTags,
"layers": jay.meta.layers },
"robin": { "tags": robin.meta.frameTags,
"layers": robin.meta.layers },
"smile": { "tags": smile.meta.frameTags,
"layers": smile.meta.layers } };
fs.writeFileSync('output-data.json', JSON.stringify(data));
{
"smile": {
"layers": [
{
"blendMode": "normal",
"opacity": 255,
"name": "Background"
}
],
"tags": [
{
"direction": "forward",
"to": 1,
"from": 0,
"name": "Smile"
},
{
"direction": "forward",
"to": 5,
"from": 2,
"name": "Run"
}
]
},
"robin": {
"layers": [
{
"blendMode": "normal",
"opacity": 255,
"name": "Background"
}
],
"tags": [
{
"direction": "forward",
"to": 1,
"from": 0,
"name": "Smile"
},
{
"direction": "forward",
"to": 5,
"from": 2,
"name": "Run"
}
]
},
"jay": {
"layers": [
{
"blendMode": "normal",
"opacity": 255,
"name": "Background"
}
],
"tags": [
{
"direction": "forward",
"to": 1,
"from": 0,
"name": "Smile"
},
{
"direction": "forward",
"to": 5,
"from": 2,
"name": "Run"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.