keyroute 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,35 @@
1
- # Keyroute
1
+ # keyroute
2
2
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.0.
3
+ Simple keyboard shortcuts for web applications.
4
+ Framework-agnostic. Tiny. No dependencies.
4
5
 
5
- ## Code scaffolding
6
+ ---
6
7
 
7
- Run `ng generate component component-name --project keyroute` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project keyroute`.
8
- > Note: Don't forget to add `--project keyroute` or else it will be added to the default project in your `angular.json` file.
8
+ ## What is keyroute?
9
9
 
10
- ## Build
10
+ `keyroute` lets you map keyboard shortcuts to application actions in a simple and predictable way.
11
+ Define your own keyboard shortcut and make your website more accessible.
11
12
 
12
- Run `ng build keyroute` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+ ```ts
14
+ createKeyroute({
15
+ 'ctrl+s': () => save(),
16
+ 'esc': () => close()
17
+ });
13
18
 
14
- ## Publishing
19
+ ## Installation
15
20
 
16
- After building your library with `ng build keyroute`, go to the dist folder `cd dist/keyroute` and run `npm publish`.
21
+ ```bash
22
+ npm install keyroute
17
23
 
18
- ## Running unit tests
24
+ ## Basic usage in Angular
19
25
 
20
- Run `ng test keyroute` to execute the unit tests via [Karma](https://karma-runner.github.io).
26
+ ```ts
27
+ import { createKeyroute } from 'keyroute';
21
28
 
22
- ## Further help
29
+ const shortcuts = createKeyroute({
30
+ 'ctrl+s': () => console.log('Saved'),
31
+ 'esc': () => console.log('Closed')
32
+ });
23
33
 
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
34
+ // Call when you no longer need the shortcuts
35
+ shortcuts.destroy();
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keyroute",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Route keyboard shortcuts to application actions. Framework-agnostic keyboard shortcut routing for web applications",
5
5
  "keywords": [
6
6
  "keyboard",
@@ -24,6 +24,10 @@
24
24
  "dependencies": {
25
25
  "tslib": "^2.3.0"
26
26
  },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/mervynmanilall/keyroute"
30
+ },
27
31
  "sideEffects": false,
28
32
  "module": "fesm2022/keyroute.mjs",
29
33
  "typings": "index.d.ts",
Binary file