Skip to content

Commit 5e5e11c

Browse files
committed
Update 0.2.0
1 parent 180e42f commit 5e5e11c

14 files changed

+386
-859
lines changed

.babelrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015"],
3+
"plugins": ["transform-object-assign"]
4+
}

.editorconfig

100644100755
+2-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# Editor Config
21
root = true
32

43
[*]
5-
indent_style = tab
4+
indent_style = space
65
indent_size = 4
76
end_of_line = lf
87
charset = utf-8
@@ -13,11 +12,5 @@ insert_final_newline = true
1312
indent_style = space
1413
indent_size = 2
1514

16-
[.travis.yml]
17-
indent_style = space
18-
indent_size = 2
19-
20-
[*.md]
21-
indent_style = space
22-
indent_size = 4
15+
[{*.md,pr-release.template}]
2316
trim_trailing_whitespace = false

.eslintrc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root: true
2+
3+
extends: "airbnb"
4+
5+
env:
6+
browser: true
7+
node: true
8+
mocha: true
9+
10+
rules:
11+
strict: 0
12+
indent: [2, 4, { SwitchCase: 1 }]
13+
vars-on-top: 0
14+
no-use-before-define: 0
15+
max-len: [1, 200]
16+
new-cap: 0
17+
no-console: ["error", { allow: ["warn", "error"] }]
18+
no-continue: 0
19+
prefer-template: 0
20+
no-param-reassign: 0
21+
import/no-extraneous-dependencies: ["error", { devDependencies: true }]

.gitignore

+4-40
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,5 @@
1-
# Project Files
2-
3-
# Tools
4-
*.sublime-workspace
5-
*.sublime-project
6-
7-
# Node
8-
node_modules
9-
10-
# Coverages
11-
.coveralls.yml
12-
coverage
13-
14-
# Packages
15-
*.7z
16-
*.dmg
17-
*.gz
18-
*.iso
19-
*.jar
20-
*.rar
21-
*.tar
22-
*.zip
23-
24-
# Logs / Databases
1+
node_modules/
2+
coverage/
3+
.nyc_output/
4+
hasher.js
255
*.log
26-
*.sql
27-
*.sqlite
28-
*.db
29-
30-
# OS Generated Files
31-
*.DS_Store
32-
*.DS_Store?
33-
*._
34-
*.Spotlight-V100
35-
*.Trashes
36-
ehthumbs.db
37-
Thumbs.db
38-
Desktop.ini
39-
40-
# Junc Copy Files
41-
*コピー*

.jshintrc

-27
This file was deleted.

.npmignore

-7
This file was deleted.

.travis.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
language: node_js
22

33
node_js:
4-
- "0.11"
5-
- "0.10"
4+
- "6"
5+
- "6.1"
6+
- "5.11"
7+
- "0.12"
68

7-
after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
9+
after_success: "npm install coveralls && ncat ./coverage/lcov.info | coveralls"

LISENCE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 narirou
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ hasher
1717

1818
hasher is a tiny hashchange router.
1919
Most web applications now use "pushState" for its routing function.
20-
"hashchange" is legacy solution, but it is still useful for the application without server
20+
"hashchange" is legacy solution, but it is still useful for the application without server
2121
(for example: local node-webkit applications).
2222

2323

2424
Usage
2525
-----
2626

2727
```javascript
28-
var hasher = require( 'hasher' );
28+
import hasher from 'hasher';
2929

30-
hasher( '/', index );
30+
hasher('/', index);
3131

32-
hasher( '/user/:id', load, show );
33-
hasher( '/user/:id/edit', load, edit );
34-
hasher( '/user/:id/delete', del );
32+
hasher('/user/:id', load, show);
33+
hasher('/user/:id/edit', load, edit);
34+
hasher('/user/:id/delete', del);
3535

36-
hasher( '*', notfound );
36+
hasher('*', notfound);
3737

3838
// Begin monitoring hashchange events
3939
hasher();
@@ -51,19 +51,19 @@ Set routes and callbacks.
5151
Each callback is invoked `params` object and `next` function.
5252

5353
```javascript
54-
function load( params, next ) {
54+
function load(params, next) {
5555
params.num; //-> '001'
5656
params.article; //-> 'first-post'
5757
next(); // run `edit` callback
5858
}
5959

6060
function edit() {
61-
console.log( 'it called after `load` function.' );
61+
console.log('it called after `load` function.');
6262
}
6363

64-
hasher( '/blog/:num/:article/edit', load, edit );
64+
hasher('/blog/:num/:article/edit', load, edit);
6565

66-
hasher.redirect( '/blog/001/first-post/edit' );
66+
hasher.redirect('/blog/001/first-post/edit');
6767
```
6868

6969

@@ -88,5 +88,4 @@ Stop monitoring hashchange events and clear all options.
8888
Based on
8989
--------
9090

91-
* [page.js](https://github.com/visionmedia/page.js) by TJ Holowaychuk.
92-
91+
* [page.js](https://github.com/visionmedia/page.js) by TJ Holowaychuk.

0 commit comments

Comments
 (0)