Skip to content

Instantly share code, notes, and snippets.

@abdulhadad
Last active June 25, 2020 06:40
Show Gist options
  • Select an option

  • Save abdulhadad/0dfdb12366ccb2ea0cd0f1ce24c8b5bc to your computer and use it in GitHub Desktop.

Select an option

Save abdulhadad/0dfdb12366ccb2ea0cd0f1ce24c8b5bc to your computer and use it in GitHub Desktop.
Generate Excel JS headers
HEADER=Satu Dua,Dan Tiga,Empat Lima Enam
KEY=satu.dua,dan.tiga,empat.lima.enam
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