Skip to content

Commit 6784080

Browse files
📚 docs: Simplify readme by moving stuff to the docs and add emojis.
1 parent f09a866 commit 6784080

File tree

3 files changed

+49
-120
lines changed

3 files changed

+49
-120
lines changed

README.md

Lines changed: 8 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
:question:
12
[@aureooms/js-predicate](https://aureooms.github.io/js-predicate)
23
==
34

4-
Predicate code bricks for JavaScript.
5+
Predicates for JavaScript.
6+
See [docs](https://aureooms.github.io/js-predicate).
7+
8+
```js
9+
implication( negation( lt( 7 ) ) , gt( 5 ) )( ... ) ; // true
10+
```
511

612
[![License](https://img.shields.io/github/license/aureooms/js-predicate.svg)](https://raw.githubusercontent.com/aureooms/js-predicate/main/LICENSE)
713
[![Version](https://img.shields.io/npm/v/@aureooms/js-predicate.svg)](https://www.npmjs.org/package/@aureooms/js-predicate)
@@ -18,124 +24,6 @@ Predicate code bricks for JavaScript.
1824
[![Documentation](https://aureooms.github.io/js-predicate//badge.svg)](https://aureooms.github.io/js-predicate//source.html)
1925
[![Package size](https://img.shields.io/bundlephobia/minzip/@aureooms/js-predicate)](https://bundlephobia.com/result?p=@aureooms/js-predicate)
2026

21-
Can be managed through [jspm](https://github.com/jspm/jspm-cli),
22-
[duo](https://github.com/duojs/duo),
23-
[component](https://github.com/componentjs/component),
24-
[bower](https://github.com/bower/bower),
25-
[ender](https://github.com/ender-js/Ender),
26-
[jam](https://github.com/caolan/jam),
27-
[spm](https://github.com/spmjs/spm),
28-
and [npm](https://github.com/npm/npm).
29-
30-
## Install
31-
32-
### jspm
33-
```terminal
34-
jspm install github:aureooms/js-predicate
35-
# or
36-
jspm install npm:@aureooms/js-predicate
37-
```
38-
### duo
39-
No install step needed for duo!
40-
41-
### component
42-
```terminal
43-
component install aureooms/js-predicate
44-
```
45-
46-
### bower
47-
```terminal
48-
bower install @aureooms/js-predicate
49-
```
50-
51-
### ender
52-
```terminal
53-
ender add @aureooms/js-predicate
54-
```
55-
56-
### jam
57-
```terminal
58-
jam install @aureooms/js-predicate
59-
```
60-
61-
### spm
62-
```terminal
63-
spm install @aureooms/js-predicate --save
64-
```
65-
66-
### npm
67-
```terminal
68-
npm install @aureooms/js-predicate --save
69-
```
70-
71-
## Require
72-
### jspm
73-
```js
74-
let predicate = require( "github:aureooms/js-predicate" ) ;
75-
// or
76-
import predicate from '@aureooms/js-predicate' ;
77-
```
78-
### duo
79-
```js
80-
let predicate = require( "aureooms/js-predicate" ) ;
81-
```
82-
83-
### component, ender, spm, npm
84-
```js
85-
let predicate = require( "@aureooms/js-predicate" ) ;
86-
```
87-
88-
### bower
89-
The script tag exposes the global variable `predicate`.
90-
```html
91-
<script src="bower_components/@aureooms/js-predicate/js/dist/predicate.min.js"></script>
92-
```
93-
Alternatively, you can use any tool mentioned [here](http://bower.io/docs/tools/).
94-
95-
### jam
96-
```js
97-
require( [ "@aureooms/js-predicate" ] , function ( predicate ) { ... } ) ;
98-
```
99-
100-
## Use
101-
102-
```js
103-
const {
104-
lt , le , gt ,
105-
truth , untruth ,
106-
negation ,
107-
conjunction , disjunction ,
108-
implication
109-
} = predicate ;
110-
111-
let p = gt( 5 ) ;
112-
p( 5 ) ; // false
113-
p( 6 ) ; // true
114-
115-
let q = lt( 7 ) ;
116-
q( 6 ) ; // true
117-
q( 7 ) ; // false
118-
119-
let r = conjunction( p , q ) ;
120-
r( 5 ) ; // false
121-
r( 6 ) ; // true
122-
r( 7 ) ; // false
123-
124-
let s = negation( r ) ;
125-
s( 5 ) ; // true
126-
s( 6 ) ; // false
127-
s( 7 ) ; // true
128-
129-
let t = equivalence( p , negation( le( 5 ) ) ) ;
130-
t( ... ) ; // true
131-
132-
let u = implication( negation( q ) , p ) ;
133-
u( ... ) ; // true
134-
135-
let v = disjunction( truth , untruth ) ;
136-
v( ... ) ; // true
137-
```
138-
139-
## References
27+
## :link: Related
14028

14129
- https://github.com/jamestalmage/predicate-js

doc/manual/installation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
# Installation
2+
3+
```terminal
4+
yarn add @aureooms/js-predicate
5+
```

doc/manual/usage.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
11
# Usage
2+
3+
```js
4+
const {
5+
lt , le , gt ,
6+
truth , untruth ,
7+
negation ,
8+
conjunction , disjunction ,
9+
implication
10+
} = predicate ;
11+
12+
let p = gt( 5 ) ;
13+
p( 5 ) ; // false
14+
p( 6 ) ; // true
15+
16+
let q = lt( 7 ) ;
17+
q( 6 ) ; // true
18+
q( 7 ) ; // false
19+
20+
let r = conjunction( p , q ) ;
21+
r( 5 ) ; // false
22+
r( 6 ) ; // true
23+
r( 7 ) ; // false
24+
25+
let s = negation( r ) ;
26+
s( 5 ) ; // true
27+
s( 6 ) ; // false
28+
s( 7 ) ; // true
29+
30+
let t = equivalence( p , negation( le( 5 ) ) ) ;
31+
t( ... ) ; // true
32+
33+
let u = implication( negation( q ) , p ) ;
34+
u( ... ) ; // true
35+
36+
let v = disjunction( truth , untruth ) ;
37+
v( ... ) ; // true
38+
```

0 commit comments

Comments
 (0)