UNPKG

create-web3-dapp-dev

Version:

<p align="center"> <br /> <a href="https://createweb3dapp.alchemy.com"> <img src=".github/images/cw3d-logo.png" width="200" alt=""/></a> <br /> </p>

21 lines (18 loc) 477 B
import fs from "fs"; import { APIKeys } from "../../interfaces/ApiKeys"; import path from "path"; export const createEnv = ( apiKeys: APIKeys, projectPath = "./", local: boolean, ) => { if (Object.keys(apiKeys).length) { const writeStream = fs.createWriteStream( path.join(projectPath, local? ".env.local" : ".env") ); for (const [key, value] of Object.entries(apiKeys)) { writeStream.write(`${key.toUpperCase()}=${value}\n`); } writeStream.end(); } };