html-encrypt
v1.3.0
Published
Password protect a static HTML page without server
Downloads
11
Maintainers
Readme
html-encrypt
A zero config (and only optional minifiers as dependencies) to encrypt html files. This is a heavy modified clone of staticrypt.
Installation
npm i html-encrypt
Execute
npx html-encrypt <path/index.html>
Note: running the command will modify the file.
Options
You will be asked to enter the Password
Additionally, you can bring in your own template. Create a .html file and reference it when asked in the CLI.
<form method="post"> PW: <input type="password" name="" id=""> <button type="submit">Login</button> </form>
You can also set the password with -p
npx html-encrypt --remove-head <path/index.html> -p <long-password>
You can also add --remove-head in order to remove the content of the head for the output file. This might be needed for some SPAs.
npx html-encrypt --remove-head <path/index.html>
You can also add --no-minify in order to not use html-minifier-terser and esbuild.
npx html-encrypt --no-minify <path/index.html>
You can also skip the optional template path with --own-template. Or combine it with a secure -p in a Pipeline.
npx html-encrypt --own-template <path/index.html>