Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hnaderi/scala-readpass
Cross platform readpassword for scala native and jvm
https://github.com/hnaderi/scala-readpass
cross-platform password scala scala-native scalanative stdin stdin-inputs utility
Last synced: 28 days ago
JSON representation
Cross platform readpassword for scala native and jvm
- Host: GitHub
- URL: https://github.com/hnaderi/scala-readpass
- Owner: hnaderi
- License: apache-2.0
- Created: 2023-01-10T13:43:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-17T01:01:42.000Z (6 months ago)
- Last Synced: 2024-05-17T02:24:30.531Z (6 months ago)
- Topics: cross-platform, password, scala, scala-native, scalanative, stdin, stdin-inputs, utility
- Language: Scala
- Homepage:
- Size: 37.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## readpassword
[![readpassword Scala version support](https://index.scala-lang.org/hnaderi/scala-readpass/readpassword/latest.svg)](https://index.scala-lang.org/hnaderi/scala-readpass/readpassword)
![Build](https://github.com/hnaderi/scala-readpass/workflows/Continuous%20Integration/badge.svg)
![GitHub](https://img.shields.io/github/license/hnaderi/scala-readpass)This is a cross platform `readpassword` utility useful for CLIs that require reading password from stdin.
It acts like standard unix style of password input, like in `sudo` where password is hidden on input.### Usage
This library is currently available for Scala binary versions 2.13 and 3.2 on JVM and Scala native.
To use the latest version, include the following in your `build.sbt`:
```scala
libraryDependencies ++= Seq(
"dev.hnaderi" %%% "readpassword" % ""
)
```Then use it like:
``` scala
import dev.hnaderi.readpasswordobject Main extends App {
val pass = readpassword.read("Enter your password: ")
println(s"Your password is: $pass")
}
```And then:
``` plain
sbt:root> exampleNative/run
Enter your password:
Your password is: This is my password!
```### Supports
| env | native | jvm |
|:--------------------:|:------:|:---:|
| linux | ✅ | ✅ |
| macos | ✅ | ✅ |
| posix compliant OSes | ✅ | ✅ |
| windows | ✅ | ✅ |