I am getting a raw data like this
SECRET_TOKEN=Iwillruletheworld;SECRET_REFRESH_TOKEN=Iwillruletheworld;SERVER_PORT=3000;SERVER_WS_PORT=4000;NODE_URI=http://test.abc.com/#/;MONGODB_DEFAULT_URI=mongodb;MONGODB_HOST=localhost;MONGODB_PORT=27017;
I want to make this as a key value pair. So, first I separated the data by ; like this
data.split(';');
Output
[ 'SECRET_TOKEN=Iwillruletheworld',
'SECRET_REFRESH_TOKEN=Iwillruletheworld',
'SERVER_PORT=3000',
'SERVER_WS_PORT=4000',
'NODE_URI=http://test.abc.com/#/',
'MONGODB_DEFAULT_URI=mongodb',
'MONGODB_HOST=localhost',
'MONGODB_PORT=27017'
]
Now I want to make it as key value pair
Expected Output
[ 'SECRET_TOKEN'='Iwillruletheworld',
'SECRET_REFRESH_TOKEN'='Iwillruletheworld',
'SERVER_PORT'='3000',
'SERVER_WS_PORT'='4000',
'NODE_URI'='http://test.abc.com/#/',
'MONGODB_DEFAULT_URI'='mongodb',
'MONGODB_HOST'='localhost',
'MONGODB_PORT'='27017'
]
I want to insert ' wherever = occurs. Can anyone please help me out.