Skip to content

Commit

Permalink
Merge pull request #12 from shgysk8zer0/patch/docs
Browse files Browse the repository at this point in the history
Update README
  • Loading branch information
shgysk8zer0 authored Feb 3, 2022
2 parents 53c7bfe + 284918d commit fd72bb5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v1.0.6] 2022-02-02

### Added
- npm badges
- Table of options in README

## [v1.0.5] 2022-02-02

Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
## Quick Links
- [About](#about)
- [Installation](#installation)
- [Updating](#updating)
- [Options](#options)
- [Example](#example)
- [Requirements](#requirements)
- [Supported Browsers](#supported-browsers)
Expand Down Expand Up @@ -79,6 +79,21 @@ git submodule update --remote -- js/konami
**Tip**: Use [Dependabot](https://github.com/dependabot) to automatically get
Pull Requests when a submodule or package is updated.

### Options

```js
import { konami } from '/js/konami.js';

await konami({ target, delay, signal, capture });
```

| Name | Type | Default Value | Description |
------------|---------------|---------------|-----------------------------------------
| `target` | `EventTarget` | `globalThis` | Target to listen for input on |
| `delay` | `Number` | `1000` | Allowed delay in ms between inputs |
| `signal` | `AbortSignal` | `undefined` | See [`signal` on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#parameters) |
| `capture` | `Boolean` | `true` | See [`capture` on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#parameters) |

### Example

#### From Submodule
Expand All @@ -102,8 +117,8 @@ konami().then(/* Enter Cheat Mode! */);
#### From unpkg CDN
```js
const controller = new AbortController();
// This will use version 1.0.3
const { konami } = await import('https://unpkg.com/@shgysk8zer0/konami@1.0.3/konami.js');
// This will use version 1.0.5
const { konami } = await import('https://unpkg.com/@shgysk8zer0/konami@1.0.5/konami.js');

try {
await konami({
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shgysk8zer0/konami",
"version": "1.0.5",
"version": "1.0.6",
"description": "A simple JavaScript module for adding Konami Code Easter Eggs",
"main": "konami.js",
"type": "module",
Expand Down

0 comments on commit fd72bb5

Please sign in to comment.