summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2023-06-07 21:44:08 +0200
committerJustin Wernick <justin@worthe-it.co.za>2023-06-07 21:44:08 +0200
commit51bf45b4258dc85e6273c445d8e8bbf4688056ad (patch)
treed299f45b29b25981b1e6a6012c3136dd89ec7f57 /README.md
parent68fafbf7a45d15a7a8798e3cfa6f32319fa98e7e (diff)
Language tags on the codeblocks
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/README.md b/README.md
index 47194fb..e359a22 100644
--- a/README.md
+++ b/README.md
@@ -22,13 +22,13 @@ and [here](http://knowles.co.za/generating-south-african-id-numbers/).
Download the library from NPM using the following command in a terminal:
-```
+```sh
npm install --save south-african-id-parser
```
### Usage In NodeJS
-```
+```js
var saIdParser = require('south-african-id-parser');
var info = saIdParser.parse('9001049818080');
```
@@ -38,7 +38,7 @@ var info = saIdParser.parse('9001049818080');
When used in the browser, the library will add the `saIdParser` object
to the window for you to use.
-```
+```html
<script src="south-african-id-parser.js"></script>
<script>
var info = saIdParser.parse('9001049818080');
@@ -52,7 +52,7 @@ the validation and parsing in one.
If validation fails, the resulting object only has the isValid property.
-```
+```js
var saIdParser = require('south-african-id-parser');
var validIdNumber = '9001049818080';
@@ -76,7 +76,7 @@ info = saIdParser.parse(invalidIdNumber);
`.validate(idNumber)` only checks if the ID number is valid.
-```
+```js
var saIdParser = require('south-african-id-parser');
var validIdNumber = '9001049818080';
var isValid = saIdParser.validate(validIdNumber);
@@ -90,7 +90,7 @@ The method does not do a full validation on the ID number, but it will
return undefined if either the number supplied is not a 13 digit
number string or the date section of the ID number is invalid.
-```
+```js
var saIdParser = require('south-african-id-parser');
var validIdNumber = '9001049818080';
var dateOfBirth = saIdParser.parseDateOfBirth(validIdNumber);
@@ -116,7 +116,7 @@ The method does not do a full validation on the ID number, but it will
return undefined if the number supplied is not a 13 digit number
string.
-```
+```js
var saIdParser = require('south-african-id-parser');
var validIdNumber = '9001049818080';
var isFemale = saIdParser.parseIsFemale(validIdNumber);
@@ -132,7 +132,7 @@ The method does not do a full validation on the ID number, but it will
return undefined if the number supplied is not a 13 digit number
string.
-```
+```js
var saIdParser = require('south-african-id-parser');
var validIdNumber = '9001049818080';
var isSouthAfricanCitizen = saIdParser.parseIsSouthAfricanCitizen(validIdNumber);