-
-
Save abdulhadad/0dfdb12366ccb2ea0cd0f1ce24c8b5bc to your computer and use it in GitHub Desktop.
Generate Excel JS headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HEADER=Satu Dua,Dan Tiga,Empat Lima Enam | |
| KEY=satu.dua,dan.tiga,empat.lima.enam |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('dotenv').config() | |
| console.log(process.env.HEADER) | |
| console.log(process.env.KEY) | |
| const headers = process.env.HEADER.split(",") | |
| const keys = process.env.KEY.split(",") | |
| let result = headers.map((value, index) => { | |
| return { | |
| header: value, | |
| key: keys[index], | |
| width: 10 | |
| } | |
| }) | |
| console.log(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment