Skip to content

Commit

Permalink
Renamed files, update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
The Hangry Coder authored and The Hangry Coder committed Apr 30, 2022
1 parent 56437a1 commit 6b09d5c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 36 deletions.
53 changes: 26 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# generate-nft-metadata

Simple tools to generate metadata.
Simple toolset to generate metadata


## Support

Like this tool? Want to support me? Please donate some crypto to me (so I can support my 4 wives and 11 kids and 3 dogs)

** ETH : 0xb0e73af58a9fdece76ba74a0cfb09265ae7e45d0
Expand All @@ -15,46 +14,33 @@ Like this tool? Want to support me? Please donate some crypto to me (so I can su
This tool was tested with nodejs version v14.19.1

## Install

Open your terminal and navigate to the project root folder and type :

```sh
npm install
```

## Supply your source images
## Config file

Put your images in the `assets` folder.
The config file is located in `/src/config.js`

## Config

in `src/config.js` you will find the base configuration for each json file.
## Tool #1 - Generate json file from images

## Start building
Let's say you have some images, but don't have any metadata json file.

in your terminal type
Put your images in the `/assets/` folder.

then run the command

```sh
npm run rebuild
npm run generate:fromImages
```

this will generate the json in `build/json` and rename / copy your source files to `build/images` folder.

## Update the base uri
this will generate the json files in `/build/json` and rename & copy your source images files to `/build/images/` folder.

Once you have uploaded all your images to Pinata / IPFS , you need to update the baseUri in the json files.

Open the config file in `src/config.js` and change the `baseUri` value.

Remember to always end with a `/`. So for example `ipfs://sdflkjdsfg` is INCORRECT. The correct way is `ipfs://sdflkjdsfg/`

Next, in your terminal type

```sh
npm run updateBaseUri
```

## Generate a collection with only 1 media
## Tool #2 - Generate a collection with only 1 media

If you want to generate metadata for your collection witht only 1 media (png,mp4) , you can use the command

Expand All @@ -74,12 +60,25 @@ In the config file you can set the filename and the editions to generate :
This will generate 10 metadata with all pointing to the same filename.


## Generate json files from the _metadata.json
## Tool #3 - Generate json files from the _metadata.json

If you want to generate json files that are stored in the _metadata.json, use the command

```sh
npm run generate:fromMetadata
```

Put the `_metadata.json` in the `/assets/` folder. The json files will be exported in the `/build/json/` folder.
Put the `_metadata.json` in the `/assets/` folder. The json files will be exported in the `/build/json/` folder.


## Tool #4 - Update the base uri

Once you have uploaded all your images to Pinata / IPFS , you need to update the baseUri in the json files.

Open the config file in `src/config.js` and change the `baseUri` value.

Next, in your terminal type

```sh
npm run updateBaseUri
```
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.1.0
- Renamed files, update README.md

## 1.0.6
- Added generate json files from _metadata.json

Expand Down
20 changes: 15 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
const basePath = process.cwd();
const { generate } = require(`${basePath}/src/application.js`);
const message = `
(() => {
generate();
})();
HERROW!!!
Like this tool? Want to support me? Please donate some crypto to me (so I can support my 4 wives and 11 kids and 3 dogs)
** ETH : 0xb0e73af58a9fdece76ba74a0cfb09265ae7e45d0
** Polygon : 0x70a0D3c75853f706B17970727A25113a63bCAf1f
Also , read the README.md for documentation :)
`;

console.log(message);
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "generate-nft-metadata",
"version": "1.0.6",
"description": "Simple tool to generate your NFT metadata",
"version": "1.1.0",
"description": "Simple toolset to generate metadata",
"repository": {
"type": "git",
"url": "https://github.com/fransyozef/generate-nft-metadata"
Expand All @@ -25,8 +25,9 @@
"rebuild": "npm run clean:build && npm start",
"reinstall": "npm run clean && npm install",
"updateBaseUri" : "node utils/updateBaseUri.js",
"generate:fixedMedia" : "node utils/generateFixedMedia.js",
"generate:fromMetadata" : "npm run clean:build && node utils/generateFromMetadataJson.js"
"generate:fixedMedia" : "npm run clean:build && node utils/generateFixedMedia.js",
"generate:fromMetadata" : "npm run clean:build && node utils/generateFromMetadataJson.js",
"generate:fromImages" : "npm run clean:build && node utils/generateFromImages.json"
},
"author": "Fransjo Leihitu (fransyozef)",
"license": "MIT",
Expand Down
6 changes: 6 additions & 0 deletions utils/generateFromImages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const basePath = process.cwd();
const { generate } = require(`${basePath}/src/application.js`);

(() => {
generate();
})();

0 comments on commit 6b09d5c

Please sign in to comment.