Skip to content

Commit 63d25cb

Browse files
author
ivan.m
committed
Fix readme
1 parent 7d5f116 commit 63d25cb

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

README.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,27 @@ This parser accepts [JsonLogic](http://jsonlogic.com) rules and executes them in
55
The JsonLogic format is designed to allow you to share rules (logic) between front-end and back-end code (regardless of language difference), even to store logic along with a record in a database. JsonLogic is documented extensively at [JsonLogic.com](http://jsonlogic.com), including examples of every [supported operation](http://jsonlogic.com/operations.html) and a place to [try out rules in your browser](http://jsonlogic.com/play.html).
66

77
The same format can also be executed in PHP by the library [json-logic-php](https://github.com/jwadhams/json-logic-php/)
8+
89
## Installation
910

11+
To parse JsonLogic rules in a JavaScript frontend, install this library is via [Bower](http://bower.io/):
12+
13+
```bash
14+
bower install --save json-logic-js
15+
```
16+
17+
To parse JsonLogic rules in a JavaScript backend (like Node.js), install this library via [NPM](https://www.npmjs.com/):
18+
19+
```bash
20+
npm install json-logic-js
1021
```
11-
$ npm install json-logic-js
22+
23+
Note that this project uses a [module loader](http://ricostacruz.com/cheatsheets/umdjs.html) that also makes it suitable for RequireJS projects.
24+
25+
If that doesn't suit you, and you want to manage updates yourself, the entire library is self-contained in `logic.js` and you can download it straight into your project as you see fit.
26+
27+
```bash
28+
curl -O https://raw.githubusercontent.com/jwadhams/json-logic-js/master/logic.js
1229
```
1330

1431
## Examples
@@ -103,33 +120,11 @@ jsonLogic.apply(false, i_wasnt_even_supposed_to_be_here);
103120
// false
104121
```
105122

106-
## Installation
107-
108-
To parse JsonLogic rules in a JavaScript frontend, install this library is via [Bower](http://bower.io/):
109-
110-
```bash
111-
bower install --save json-logic-js
112-
```
113-
114-
To parse JsonLogic rules in a JavaScript backend (like Node.js), install this library via [NPM](https://www.npmjs.com/):
115-
116-
```bash
117-
npm install json-logic-js
118-
```
119-
120-
Note that this project uses a [module loader](http://ricostacruz.com/cheatsheets/umdjs.html) that also makes it suitable for RequireJS projects.
121-
122-
If that doesn't suit you, and you want to manage updates yourself, the entire library is self-contained in `logic.js` and you can download it straight into your project as you see fit.
123-
124-
```bash
125-
curl -O https://raw.githubusercontent.com/jwadhams/json-logic-js/master/logic.js
126-
```
127-
128123
## Compatibility
129124

130125
This library makes use of `Array.map` and `Array.reduce`, so it's not *exactly* Internet Explorer 8 friendly.
131126

132-
If you want to use JsonLogic *and* support deprecated browsers, you could easily use [BabelJS's polyfill](https://babeljs.io/docs/usage/polyfill/) or directly incorporate the polyfills documented on MDN for [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).
127+
If you want to use JsonLogic *and* support deprecated browsers, you could easily use [BabelJS's polyfill](https://babeljs.io/docs/usage/polyfill/) or directly incorporate the polyfills documented on MDN for [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).
133128

134129
## Customization
135130

0 commit comments

Comments
 (0)