summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2017-02-12 05:54:21 +0200
committerJustin Worthe <justin.worthe@gmail.com>2017-02-12 05:54:21 +0200
commitac711cfeb0501da332e2355ed341aca776b722d4 (patch)
tree1b3ad20eef81e61d53f299f44a4ed4fbfc93894d /README.md
parent2b415c192a11517c73c496a47f69f37b50667484 (diff)
Renamed main file to better fit browser use
Diffstat (limited to 'README.md')
-rw-r--r--README.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/README.md b/README.md
index de3e46f..b8c80f3 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,31 @@ and [here](http://knowles.co.za/generating-south-african-id-numbers/).
Usage
-----
+Download the library from NPM using the following command in a terminal:
+
+```
+npm install --save south-african-id-parser
+```
+
+### Usage In NodeJS
+
+```
+var saIdParser = require('south-african-id-parser');
+var info = saIdParser.parse('9001049818080');
+```
+
+### Usage In the Browser
+
+When used in the browser, the library will add the `saIdParser` object
+to the window for you to use.
+
+```
+<script src="south-african-id-parser.js"></script>
+<script>
+ var info = saIdParser.parse('9001049818080');
+</script>
+```
+
### Parse Everything
The package exposes the `.parse(idNumber)` method for calling all of