New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dkx/env-to-html

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dkx/env-to-html

Place environment variable in HTML as json config

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

DKX/EnvToHtml

Inject environment variables into html file

Installation

$ npm install --save @dkx/env-to-html

Usage

$ cat index.html | node_modules/.bin/env-to-html myEnvConfig -e HOME -e CUSTOM=hello > replaced.index.html

Resulting HTML file (replaced.index.html) will now contain new script definition in <head>:

<head>
    <script>
        window.myEnvConfig = {
            "HOME": "/home/david",
            "CUSTOM": "hello"
        };
    </script>
</head>

If you don't provide any value for the variable, the current value from your environments variables will be used.

dot env file

.env file is automatically loaded when available.

FAQs

Package last updated on 03 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc