Skip to content

Commit 474da20

Browse files
committed
Add runkit examples
1 parent ff2264c commit 474da20

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Postcode.js
44

5+
[![Try postcode.js on RunKit](https://badge.runkitcdn.com/postcode.svg)](https://npm.runkit.com/postcode)
6+
57
Utility methods for UK Postcodes.
68

79
Included is a test suite that tests against all postcodes listed in the Ordnance Survey's postcode dataset as of January 2014.

example.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const Postcode = require("postcode");
2+
3+
const postcode = new Postcode("ec1v9lb");
4+
5+
postcode.valid();
6+
postcode.normalise();
7+
8+
postcode.outcode();
9+
postcode.incode();
10+
postcode.area();
11+
postcode.district();
12+
postcode.subDistrict();
13+
postcode.sector();
14+
postcode.unit();

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"prettier": "~1.16.4"
1414
},
1515
"files": ["index.js"],
16+
"runkitExampleFilename": "example.js",
1617
"nyc": {
1718
"include": [
1819
"index.js"

0 commit comments

Comments
 (0)