Skip to content

Commit

Permalink
fix(5): Add UMD build (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipjscott committed Oct 28, 2018
1 parent af6ee32 commit 0a97c3b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
demo/
umd/
test/
.travis.yml
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Coverage Status](https://coveralls.io/repos/github/ScottyFillups/key-controller/badge.svg?branch=master)](https://coveralls.io/github/ScottyFillups/key-controller?branch=master)
[![install size](https://packagephobia.now.sh/badge?p=key-controller)](https://packagephobia.now.sh/result?p=key-controller)

key-controller is a library that abstracts handling `keydown` and `keyup` events, making it easier to change keyboard controls dynamically.
key-controller is a library that abstracts handling `keydown` and `keyup` events in the browser, making it easier to change keyboard controls dynamically.

key-controller uses [KeyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) for `controller.register(...)`. We recommend using https://keycode.info/ for looking up `.key` property of specific key's event.

Expand All @@ -15,6 +15,12 @@ key-controller uses [KeyboardEvent.key](https://developer.mozilla.org/en-US/docs
npm install key-controller --save-dev
```

If you don't use a module bundler, you can include the minified file:

```html
<script src="unpkg.com/key-controller/umd/key-controller.min.js" defer></script>
```

## Concepts

Keyboard controls usually map to an abstract action, eg. `Spacebar -> Jump`. To make a controller, you pass in generator function and a context:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"fix": "standard --fix",
"lint": "standard",
"test": "standard && nyc ava",
"build": "parcel build --global KeyController --out-dir umd --out-file key-controller.min.js index.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"demo": "parcel ./demo/index.html --open",
"semantic-release": "semantic-release",
Expand Down
14 changes: 14 additions & 0 deletions umd/key-controller.min.js

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

1 change: 1 addition & 0 deletions umd/key-controller.min.map

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

0 comments on commit 0a97c3b

Please sign in to comment.