You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an instance of Postcode to perform utility methods, like so
10
+
11
+
```
12
+
var Postcode = require("postcode");
13
+
14
+
var postcode = new Postcode("id11qd");
15
+
```
16
+
17
+
Perform simple validations, parsing and normalisation
18
+
19
+
```
20
+
postcode.valid() // => True
21
+
postcode.outcode() // => "ID1"
22
+
postcode.incode() // => "1QD"
23
+
postcode.normalise() // => "ID1 1QD"
24
+
```
25
+
26
+
## Testing
27
+
28
+
```npm test```
29
+
30
+
## Note on Postcode Validation
31
+
32
+
Postcodes cannot be validated just using just a regular expression. Proper postcode validation requires having a full list of postcodes to check against.
33
+
34
+
Please do not solely rely on a regex to check postcodes or you're bound to get false postives/negatives.
0 commit comments