Skip to content

Commit b132d24

Browse files
authored
Update README.md
1 parent 54fb84b commit b132d24

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

README.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,18 @@
33
[![Go Report Card](https://goreportcard.com/badge/github.com/antonmedv/expr)](https://goreportcard.com/report/github.com/antonmedv/expr)
44
[![GoDoc](https://godoc.org/github.com/antonmedv/expr?status.svg)](https://godoc.org/github.com/antonmedv/expr)
55

6-
<img src="https://expr.medv.io/img/logo-small.png" width="150" alt="expr logo" align="right"/>
7-
8-
**Expr** package provides an engine that can compile and evaluate expressions.
9-
An expression is a one-liner that returns a value (mostly, but not limited to, booleans).
10-
It is designed for simplicity, speed and safety.
6+
**Expr** is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
117

12-
The purpose of the package is to allow users to use expressions inside configuration for more complex logic.
13-
It is a perfect candidate for the foundation of a _business rule engine_.
14-
The idea is to let configure things in a dynamic way without recompile of a program:
8+
<img src="https://expr.medv.io/img/logo-small.png" width="150" alt="expr logo" align="right"/>
159

1610
```js
17-
// Get the special price if
18-
user.Group in ["good_customers", "collaborator"]
19-
20-
// Promote article to the homepage when
21-
len(article.Comments) > 100 and article.Category not in ["misc"]
11+
// Allow only admins and moderators to moderate comments.
12+
user.Group in ["admin", "moderator"] || user.Id == comment.UserId
13+
```
2214

23-
// Send an alert when
24-
product.Stock < 15
15+
```js
16+
// Ensure all tweets are less than 240 characters.
17+
all(Tweets, .Size <= 240)
2518
```
2619

2720
## Features

0 commit comments

Comments
 (0)