Password protect a static HTML page without server
npm install html-encrypt
bash
npm i html-encrypt
`
Execute
`bash
npx html-encrypt
`
Note: running the command will modify the file.
Options
- You will be asked to enter the Password
Please consider using a safe password
- Additionally, you can bring in your own template. Create a .html file and reference it when asked in the CLI.
`html
`
- You can also set the password with -p
`bash
npx html-encrypt --remove-head -p
`
- 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.
`bash
npx html-encrypt --remove-head
`
- You can also add --no-minify in order to not use html-minifier-terser and esbuild.
`bash
npx html-encrypt --no-minify
`
- You can also skip the optional template path with --own-template. Or combine it with a secure -p in a Pipeline.
`bash
npx html-encrypt --own-template
``