Skip to content

Commit 645c795

Browse files
committed
update documentation
1 parent 5ed4c82 commit 645c795

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,53 @@
1-
badwords
1+
badwords v0.5.0
22
========
33

44
A javascript filter for badwords
55

6-
```javascript
6+
```
77
npm install bad-words
88
```
99
#Examples
10-
```javascript
10+
```
1111
var filter = require('bad-words');
1212
1313
console.log(filter.clean("Don't be an ash0le"));
1414
```
15-
Outputs:
16-
15+
#####Outputs:
16+
```
1717
Don't be an ******
18+
```
1819

19-
#String Helper
20+
###Factory
21+
Allows the creation of new instances of a filter
2022

21-
```javascript
22-
require('bad-words');
23+
```
24+
var filter = require('bad-words');
25+
var customFilter = new filter.Factory();
2326
24-
console.log("Don't be an ash0le".clean());
27+
customFilter.clean('Bad words...');
2528
```
26-
Outputs:
2729

28-
Don't be an ******
30+
###Placeholder Overrides
2931

32+
```
33+
var filter = require('bad-words');
34+
var customFilter = new filter.Factory({ placeHolder: 'x'});
35+
36+
customFilter.clean('Don't be an ash0le');
37+
```
38+
39+
#####Outputs:
40+
```
41+
Don't be an xxxxxx
42+
```
43+
#String Helper
44+
45+
Will no longer be supported and removed in the next release.
46+
47+
#Testing
48+
```
49+
mocha
50+
```
3051
========
3152

3253
The MIT License (MIT)

0 commit comments

Comments
 (0)