Skip to content

Commit 70e18ec

Browse files
author
ft
committed
update readme
1 parent 09e316f commit 70e18ec

File tree

4 files changed

+64
-20
lines changed

4 files changed

+64
-20
lines changed

_readme.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,59 @@
1+
Introduction
2+
---
3+
14
[Demo](http://chunpu.github.io/min-debug/?debug=*)
25

36
min-debug is inspired by [tj@debug](https://github.com/visionmedia/debug)
47

5-
Usage
8+
Support IE6+
9+
10+
![IE6](https://cloud.githubusercontent.com/assets/4565306/5972401/d32f21c8-a893-11e4-813b-852973ae82e0.png)
11+
12+
Easy for **Phone** debug log
13+
14+
![iPhone](https://cloud.githubusercontent.com/assets/4565306/5972402/de802978-a893-11e4-8f92-5902d99ae697.png)
15+
16+
Also With log in Console
17+
18+
![Console](https://cloud.githubusercontent.com/assets/4565306/5972375/6ad4bc50-a893-11e4-812e-948bbae5f96d.png)
19+
20+
Start
621
---
722

8-
#### Debug with localStorage
23+
Debug with localStorage
924

1025
Type `localStorage[mykey] = '*'`, and debug just like tj@debug
1126

1227

13-
#### Debug with page
28+
Debug with page
1429

1530
If browser not support localStorage or you want to see debug on page, use url debug
1631

1732
Type `mykey='*'` in `location.search` or `location.hash`, and will see debug info in a textarea on page
1833

34+
> the key pattern is regexp match, just like tj's debug, e.g. `localStorage.debug = 'api*, call, -*verbose*'`
35+
1936

20-
Differences
37+
Usage
2138
---
2239

23-
differences with th@debug
40+
run `min-debug` directly with [dist/debug.js](https://github.com/chunpu/min-debug/blob/gh-pages/dist/debug.js), support
41+
42+
- window.debug
43+
- define
44+
- module.exports
45+
2446

25-
- if your program using browserify, you should init the debug key self
47+
If your program using browserify, you should init the debug key self
2648

2749
```js
2850
module.exports = exports = require('min-debug')
2951
exports.init('mykey') // default is debug
3052
```
3153

32-
- min-debug does not support print format, because we may need log on some old browser like IE6
54+
`min-debug` does not support print format, because we may need log on some old browser like IE6
3355

3456
```js
3557
debug('my data', {foo: 'bar'}) // min-debug style
36-
debug('my data: %o', {foo: 'bar'}) // tj@debug style, not support
58+
debug('my data: %o', {foo: 'bar'}) // tj's debug style, not support
3759
```

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "min-debug",
3-
"version": "1.2.0",
4-
"description": "debug for browser in console or display on page",
3+
"version": "1.2.1",
4+
"description": "Debug for browser in console or display on page",
55
"main": "debug.js",
66
"directories": {
77
"test": "test"

readme.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ min-debug
55
[![NPM version][npm-image]][npm-url]
66
[![Downloads][downloads-image]][downloads-url]
77

8-
debug for browser in console or display on page
8+
Debug for browser in console or display on page
99

1010
Installation
1111
---
@@ -14,42 +14,64 @@ Installation
1414
npm install min-debug
1515
```
1616

17+
Introduction
18+
---
19+
1720
[Demo](http://chunpu.github.io/min-debug/?debug=*)
1821

1922
min-debug is inspired by [tj@debug](https://github.com/visionmedia/debug)
2023

21-
Usage
24+
Support IE6+
25+
26+
![IE6](https://cloud.githubusercontent.com/assets/4565306/5972401/d32f21c8-a893-11e4-813b-852973ae82e0.png)
27+
28+
Easy for **Phone** debug log
29+
30+
![iPhone](https://cloud.githubusercontent.com/assets/4565306/5972402/de802978-a893-11e4-8f92-5902d99ae697.png)
31+
32+
Also With log in Console
33+
34+
![Console](https://cloud.githubusercontent.com/assets/4565306/5972375/6ad4bc50-a893-11e4-812e-948bbae5f96d.png)
35+
36+
Start
2237
---
2338

24-
#### Debug with localStorage
39+
Debug with localStorage
2540

2641
Type `localStorage[mykey] = '*'`, and debug just like tj@debug
2742

2843

29-
#### Debug with page
44+
Debug with page
3045

3146
If browser not support localStorage or you want to see debug on page, use url debug
3247

3348
Type `mykey='*'` in `location.search` or `location.hash`, and will see debug info in a textarea on page
3449

50+
> the key pattern is regexp match, just like tj's debug, e.g. `localStorage.debug = 'api*, call, -*verbose*'`
51+
3552

36-
Differences
53+
Usage
3754
---
3855

39-
differences with th@debug
56+
run `min-debug` directly with [dist/debug.js](https://github.com/chunpu/min-debug/blob/gh-pages/dist/debug.js), support
57+
58+
- window.debug
59+
- define
60+
- module.exports
61+
4062

41-
- if your program using browserify, you should init the debug key self
63+
If your program using browserify, you should init the debug key self
4264

4365
```js
4466
module.exports = exports = require('min-debug')
4567
exports.init('mykey') // default is debug
4668
```
4769

48-
- min-debug does not support print format, because we may need log on some old browser like IE6
70+
`min-debug` does not support print format, because we may need log on some old browser like IE6
4971

5072
```js
5173
debug('my data', {foo: 'bar'}) // min-debug style
52-
debug('my data: %o', {foo: 'bar'}) // tj@debug style, not support
74+
debug('my data: %o', {foo: 'bar'}) // tj's debug style, not support
5375
```
5476

5577
License

test/debug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ describe('basic', function() {
2020
// console.log(val)
2121
assert(val.indexOf('show') != -1, 'open can show')
2222
assert(val.indexOf('close cant show') == -1, 'close cant show')
23-
assert(val.split('\n').length >= 3, 'show multi lines')
23+
assert(val.split('\n').length >= 2, 'show multi lines')
2424
})
2525
})

0 commit comments

Comments
 (0)