Skip to content

Commit 5116149

Browse files
committed
Updated readme
1 parent d3f36d4 commit 5116149

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

README.md

+11-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<a name="tokenizethis"></a>
21
# TokenizeThis
3-
<a name="tokenizethis-what-is-it"></a>
2+
43
## What is it?
54
It turns a string into tokens!.
65

@@ -54,17 +53,13 @@ equals(tokens, [
5453
]);
5554
```
5655

57-
<a name="tokenizethis-installation"></a>
58-
## Installation
59-
`npm install tokenize-this`.
56+
## Installation `npm install tokenize-this`.
6057

6158
```js
6259
// or if in the browser: <script src="tokenize-this/tokenize-this.min.js"></script>
6360
```
6461

65-
<a name="tokenizethis-usage"></a>
66-
## Usage
67-
`require` it, create a new instance, then call `tokenize`.
62+
## Usage `require` it, create a new instance, then call `tokenize`.
6863

6964
```js
7065
// var TokenizeThis = require('tokenize-this');
@@ -78,11 +73,11 @@ tokenizer.tokenize(str, function(token) {
7873
equals(tokens, ['Hi', '!', ',', 'I', 'want', 'to', 'add', 5, '+', 6]);
7974
```
8075

81-
<a name="tokenizethis-advanced-usage"></a>
8276
## Advanced Usage
83-
<a name="tokenizethis-advanced-usage-supplying-a-config-object-to-the-constructor-is-also-possible-see-defaultconfig-in-the-api-section-for-all-options"></a>
84-
### Supplying a config object to the constructor is also possible (see ".defaultConfig" in the #API section for all options)
85-
This can be used to parse many forms of data, like JSON into key-value pairs.
77+
78+
### Supplying a config object to the constructor is also possible (see [here](#defaultconfigobject) for all options)
79+
80+
This can be used to parse other forms of data, like JSON into key-value pairs.
8681

8782
```js
8883
var jsonConfig = {
@@ -99,10 +94,10 @@ tokenizer.tokenize(str, function(token) {
9994
equals(tokens, ['[', '{', 'name', 'Shaun Persad', 'id', 5, '}', '{', 'gender', null, '}', ']']);
10095
```
10196

102-
<a name="tokenizethis-api"></a>
10397
## API
104-
<a name="tokenizethis-api-tokenizestrstring-foreachtokentoken-surroundedbystringfunction"></a>
105-
### #tokenize(str:String, forEachToken(token:*, surroundedBy:String):Function)
98+
99+
### #tokenize(str:String, forEachToken(token:*, surroundedBy:String):Function)
100+
106101
sends each token to the `forEachToken` callback.
107102

108103
```js
@@ -128,8 +123,8 @@ tokenizer.tokenize(str, function(token, surroundedBy) {
128123
equals(tokens, [true, false, null, true, false, null, 1, 2, 3.4, 5.6789]);
129124
```
130125

131-
<a name="tokenizethis-api-defaultconfigobject"></a>
132126
### .defaultConfig:Object
127+
133128
The default config object used when no config is supplied.
134129

135130
```js

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tokenize-this",
3-
"version": "1.0.0",
3+
"version": "1.0.13",
44
"description": "Turns a string into tokens.",
55
"main": "tokenize-this.min.js",
66
"directories": {

0 commit comments

Comments
 (0)