Socket
Socket
Sign inDemoInstall

pagecrypt

Package Overview
Dependencies
3
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 3.1.0

11

CHANGELOG.md
# Changelog for `pagecrypt`
## 3.1.0 - 2021-04-24
### Features
- Replace `yargs` with `sade` and simplify CLI + dependencies. No breaking changes.
- This greatly improves both installation + runtime performance.
- It also simplifies the CLI implementation.
- The CLI API is preserved exactly like in 3.0.0
---
## 3.0.0 - 2021-04-24

@@ -4,0 +15,0 @@

43

cli.js
#!/usr/bin/env node
const yargs = require('yargs')
const { hideBin } = require('yargs/helpers')
const sade = require('sade')
const { encrypt } = require('./index')
const pkg = require('./package.json')
const argv = yargs(hideBin(process.argv))
.scriptName('pagecrypt')
.usage('🔐 Usage: $0 [input-file] [output-file] [password]')
.example('$0 input.html out.html strong-password')
.command('[input-file]', false)
.help('[input-file]', 'Input HTML file to encrypt.')
.command('[output-file]', false)
.help(
'[output-file]',
'Output HTML file where you want to save the encrypted result.',
sade(`${pkg.name} <src> <dest> <password>`, true)
.version(pkg.version)
.describe(
'Encrypt the <src> HTML file with <password> and save the result in the <dest> HTML file.',
)
.command('[password]', false)
.help(
'[password]',
'Password to decrypt the your output HTML file. Use a strong password.',
)
.demandCommand(3, 3)
.alias('h', 'help')
.alias('v', 'version')
.help().argv
async function cli() {
if (argv._?.length === 3) {
const [inputFile, outputFile, password] = argv._
console.log(`🔐 Encrypting ${inputFile} → ${outputFile}`)
await encrypt(inputFile, outputFile, password)
}
}
cli()
.example('index.html encrypted.html password')
.action(async (src, dest, password) => {
console.log(`🔐 Encrypting ${src} → ${dest}`)
await encrypt(src, dest, password)
})
.parse(process.argv)
{
"name": "pagecrypt",
"version": "3.0.0",
"version": "3.1.0",
"description": "Easily add client-side password-protection to your Single Page Applications and HTML files.",

@@ -48,3 +48,3 @@ "main": "index.js",

"rfc4648": "^1.4.0",
"yargs": "^16.2.0"
"sade": "^1.7.4"
},

@@ -51,0 +51,0 @@ "devDependencies": {

@@ -16,3 +16,3 @@ # PageCrypt - Password Protected Single Page Applications and HTML files

```sh
npx pagecrypt [input.html] [output.html] [password]
npx pagecrypt <src> <dest> <password>
```

@@ -52,3 +52,3 @@

// Encrypt a HTML file and write to the filesystem
await encrypt('input.html', 'output.html', 'password')
await encrypt('index.html', 'encrypted.html', 'password')
```

@@ -55,0 +55,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc