# morse-passwd

> morse passwd for web app

Latest version **1.1.0** (published 2022-07-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install morse-passwd
pnpm add morse-passwd
yarn add morse-passwd
bun add morse-passwd
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-07-23 |
| First published | 2022-07-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | xu3927 |
| Maintainers | xu3927 |
| Keywords | morse, code, passwd, passcode, web |

## Links

- npm: https://www.npmjs.com/package/morse-passwd
- Repository: https://github.com/xu3927/morse-passwd
- Homepage: https://github.com/xu3927/morse-passwd#readme
- Issues: https://github.com/xu3927/morse-passwd/issues
- npm.io page: https://npm.io/package/morse-passwd

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-07-23
- 1.0.4 — 2022-07-22
- 1.0.3 — 2022-07-22

## README

# Morse Passwd For Web

[中文文档](./README.CN.md)

This package is used to set a morse passwd in pc or mobile web page.
When the user input the morse code by click and press the page, the success callback will be trigger.
It can be used to unlock a page, verify if the user is human beings, or to open a debug page.

## UsAge

Install the package from npm:

```
$ npm install morse-passwd --save;
```

Use it in web page.

```js
import MorsePass from 'morse-passwd'

moresePass = new MorsePass({
    // the target element which will bind event
    target: document.querySelector('body'),
    // the passwd to verify. '.' represents a click, '_' represents a long press
    passwd: '.._.._',
    // the time from mousedown to mouse up. it will be treated as a press if bigger than this time
    // or it will be treated as click.  the unit is ms
    pressLeastTime: 1000,
    // how long time will the current operation expired, then it will verify again from the first code. the unit is ms
    expires: 6000,
    // trigger when the passwd is right.
    success() {
        console.log('Passwd Right!')
    },
    // trigger when input wrong code
    fail() {
        console.log('Passwd Wrong!')
    },
    // trigger on each input
    input(text) {
        console.log(text)
    },
    // trigger when the time is expired after the last operation
    expire() {
        console.log('expired!')
    }
})
```

## Example

[./examples/index.html](./examples/index.html)

---
_Source: https://npm.io/package/morse-passwd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
