Skip to content

Commit 49bbc37

Browse files
committed
Update docs
1 parent 899e0b2 commit 49bbc37

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Contributing
2+
3+
You're more than welcome to contribute to this project. Please note: your code may be used as part of a commercial product if merged.
4+
5+
## Important notes
6+
Please don't edit files in the `dist` subdirectory as they are generated via npm script. You'll find source code in the `src` subdirectory!
7+
8+
### Code style
9+
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.**
10+
11+
## Modifying the code
12+
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.
13+
14+
1. Fork and clone the repo.
15+
1. Run `npm install` to get the project's dependencies
16+
1. Run `npm run start` to run the dev server. open `http://localhost:5757/demo/` in the browser
17+
1. Run `npm run build` to produce minified version of your library.
18+
19+
## test
20+
1. Run `npm run test` to run all tests
21+
1. Run `npm run test:watch` to run tests in watch mode

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# TinyEvents
1010

11-
TinyEvents is a tiny, framework-agnostic, event utility library for modern browsers(IE 11+). Supports jQuery like syntax. Just 1 kb gzipped.
11+
TinyEvents is a tiny event utility library for modern browsers(IE 11+). Supports jQuery like syntax. Just 1 kb gzipped.
1212

1313
- Event namespace support
1414
- Works with collection of elements
@@ -135,7 +135,7 @@ Remove event handlers.
135135
136136
```js
137137
138-
$('.btn').on('click.bg hover.bg', () => {
138+
tinyEvents('.btn').on('click.bg hover.bg', () => {
139139
document.body.style.backgroundColor = 'red';
140140
});
141141
@@ -150,10 +150,10 @@ tinyEvents('.btn').off('.bg');
150150
tinyEvents('.btn').off('click');
151151
152152
// Another example with multiple namespaces
153-
$('.btn').on('click.abc', () => {
153+
tinyEvents('.btn').on('click.abc', () => {
154154
document.body.style.color = 'red';
155155
});
156-
$('.btn').on('click.xyz', () => {
156+
tinyEvents('.btn').on('click.xyz', () => {
157157
document.body.style.backgroundColor = 'yellow';
158158
});
159159

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tiny-events.js",
3-
"description": "TinyEvents is a tiny, framework-agnostic, event utility library for modern browsers(IE 11+). Supports jQuery like syntax. just 1 kb gzipped.",
3+
"description": "TinyEvents is a tiny event utility library for modern browsers(IE 11+). Supports jQuery like syntax. Just 1 kb gzipped.",
44
"version": "0.0.1",
55
"browserslist": [
66
"defaults"

0 commit comments

Comments
 (0)