Skip to content
This repository was archived by the owner on Jan 2, 2023. It is now read-only.

Commit 70f1bb1

Browse files
author
Bassem Dghaidi
committed
Add FAQs, link to the demo, updated summary
1 parent 4a8b3ca commit 70f1bb1

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Objectron
22

3-
> Compares a set of match rules contained with an object to determine if the latter conforms to the matching rules
3+
> Allows you to compare an object to a generic model to test equality and extract matches
44
55
<a href="https://github.com/mena-devs/objectron/actions?query=workflow%3A%22Build+%26+Test%22+branch%3Amaster">
66
<img src="https://github.com/mena-devs/objectron/workflows/Build%20&%20Test/badge.svg?branch=master" alt="CI Build Status" />
@@ -11,7 +11,13 @@
1111

1212
This module provides you with the means to define a **tester object** containing a set of **match rules** that will be used against a **payload object**. The `match()` method within the module will return whether the payload object has satisfied all the rules and will return the set of matches.
1313

14-
Refer to [Usage examples](#usage-examples) to see it in action.
14+
## Demo
15+
16+
The best way to really understand this module is to play with some examples. Go through some of our [usage examples](#usage-examples) and test them in our interactive demo page:
17+
18+
<a href="https://mena-devs.github.io/objectron-demo/" style="border:1px solid #616772">
19+
<img src="https://mena-devs.github.io/objectron-demo/demo-thumb.png" height="350px" alt="Demo Link" />
20+
</a>
1521

1622
## Installation
1723

@@ -30,8 +36,10 @@ $ npm test
3036

3137
1. You can use this module as a basic JSON schema validator
3238
2. Can also be used in unit testing for broader assertions
33-
3. Can be used to extract values from a complex API response (parsing chat bot responses for example)
34-
4. Can be used for a JSON linter
39+
3. Can be used to extract values from a complex API response. We are actively using it in the maintenance of our community slack bot (https://github.com/mena-devs/bosta)
40+
4. Can be used at the core of a JSON linter
41+
42+
Check our [FAQs](#faqs) for more insights
3543

3644
## Usage examples
3745

@@ -265,6 +273,28 @@ console.dir(result, {depth: null});
265273
}
266274
```
267275

276+
## FAQs
277+
278+
### 1. What's the difference between Objectron and any other Schema Validator?
279+
280+
Objectron has a simple interface, it's a very small module (~60 LOCs), and most importantly it allows the extraction of the data that matches the rules not merely validating it.
281+
282+
### 2. Has this been used in production?
283+
284+
No, but we're planning to use it.
285+
286+
### 3. Why did you build this?
287+
288+
Why not? :)
289+
290+
### 4. I have a great idea for a new feature!
291+
292+
Fantastic, we'd love to hear more about it. Please [create an issue](https://github.com/mena-devs/objectron/issues) and we will look into it as soon as we're able to.
293+
294+
### 5. I have a question not in this list
295+
296+
Please [create an issue](https://github.com/mena-devs/objectron/issues) and we will look into it as soon as we're able to.
297+
268298
## Meta
269299

270300
- [@Link-](https://github.com/Link-)

0 commit comments

Comments
 (0)