Miss any of our Open RFC calls?Watch the recordings here! »

compile-env-templates

0.0.1 • Public • Published

compile-env-templates

CLI for compiling EJS templates referencing environment variables.

Access process.ENV in templates as env:

// environment.ejs
module.exports = {
  secret: <%= env.MY_SECRET %>
};
$ MY_SECRET=secret
$ compile-env-templates environment.ejs

To load environment variables from a file (using dotenv):

$ compile-env-templates --env path/to/.env environment.ejs

To give compiled files a custom extension:

$ compile-env-templates --ext ts environment.ejs

Install

npm i compile-env-templates

DownloadsWeekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • avatar