Skip to content

Instantly share code, notes, and snippets.

@polluterofminds
Created February 1, 2022 18:15
Show Gist options
  • Save polluterofminds/5cba0dcd796dce0fbf30611fea1164d9 to your computer and use it in GitHub Desktop.
Save polluterofminds/5cba0dcd796dce0fbf30611fea1164d9 to your computer and use it in GitHub Desktop.
metadata_generator.js
const fs = require('fs');
const imageDir = fs.readdirSync("./Pinnies");
imageDir.forEach(img => {
const metadata = {
name: `Pinnie ${img.split(".")[0]}`,
description: "A Pinnie in the Limited Pinata Family Collection",
image: `ipfs://FOLDER_CID/${img.split(".")[0]}.png`,
attributes: []
}
fs.writeFileSync(`./metadata/${img.split(".")[0]}`, JSON.stringify(metadata))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment