Skip to content

Commit 1c1989f

Browse files
author
Nicola Greco
committed
put command line docs first in readme
1 parent 2ee3c7d commit 1c1989f

1 file changed

Lines changed: 38 additions & 34 deletions

File tree

‎README.md‎

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
Linked Data Platform server based on [rdflib.js](https://github.com/linkeddata/rdflib.js) and [node.js](https://nodejs.org/). This is all you need to run distributed linked data apps on top of the file system.
88

9+
You can run ldnode as a command-line tool or as a library
10+
911
## Features
1012

1113
- [x] GET, PUT, POST and PATCH support
@@ -17,13 +19,44 @@ Linked Data Platform server based on [rdflib.js](https://github.com/linkeddata/r
1719
- [x] Real-time live updates (using websokets)
1820

1921

20-
## Install
22+
## Command line tool
23+
24+
npm install -g ldnode
25+
26+
The command line tool has the following options
27+
28+
```
29+
Usage: ldnode [options]
30+
31+
Options:
32+
-v, --verbose Print the logs to console
33+
--version Print current ldnode version
34+
-m, --mount Where to mount Linked Data Platform (default: '/')
35+
-r, --root Root location on the filesystem to serve resources
36+
-p, --port Port to use
37+
-c, --cache Set cache time (in seconds), 0 for no cache
38+
-K, --key Path to the ssl key
39+
-C, --cert Path to the ssl cert
40+
--webid Enable WebID+TLS authentication
41+
-s, --secret HTTP Session secret key (e.g. "your secret phrase")
42+
-P, --proxy Use a proxy on example.tld/proxyPath
43+
--no-live Disable live support through WebSockets
44+
-sA, --suffix-acl Suffix for acl files (default: '.acl')
45+
-sM, --suffix-meta Suffix for metadata files (default: '.meta')
46+
-sC, --suffix-changes Suffix for acl files (default: '.changes')
47+
-sE, --suffix-sse Suffix for SSE files (default: '.events')
48+
49+
```
50+
51+
## Library
52+
53+
### Install
2154

2255
```
2356
npm install
2457
```
2558

26-
## Usage
59+
### Usage
2760

2861
The library provides two APIs:
2962

@@ -50,7 +83,7 @@ In case the `settings` is not passed, then it will start with the following defa
5083
```
5184

5285

53-
#### Simple
86+
##### Simple
5487

5588
You can create an ldnode ready to use Express server using `ldnode.createServer(opts)`
5689

@@ -63,7 +96,7 @@ ldp.listen(3000, function() {
6396
})
6497
```
6598

66-
#### Advanced
99+
##### Advanced
67100

68101
You can integrate it with your existing express app just by using `lnode(opts)`
69102

@@ -77,43 +110,14 @@ app.listen(3000, function() {
77110
...
78111
```
79112

80-
#### Logs
113+
##### Logs
81114

82115
Run your app with the `DEBUG` variable set:
83116

84117
```bash
85118
$ DEBUG="ldnode:*" node app.js
86119
```
87120

88-
## Command line tool
89-
90-
npm install -g ldnode
91-
92-
The command line tool has the following options
93-
94-
```
95-
Usage: ldnode [options]
96-
97-
Options:
98-
-v, --verbose Print the logs to console
99-
--version Print current ldnode version
100-
-m, --mount Where to mount Linked Data Platform (default: '/')
101-
-r, --root Root location on the filesystem to serve resources
102-
-p, --port Port to use
103-
-c, --cache Set cache time (in seconds), 0 for no cache
104-
-K, --key Path to the ssl key
105-
-C, --cert Path to the ssl cert
106-
--webid Enable WebID+TLS authentication
107-
-s, --secret HTTP Session secret key (e.g. "your secret phrase")
108-
-P, --proxy Use a proxy on example.tld/proxyPath
109-
--no-live Disable live support through WebSockets
110-
-sA, --suffix-acl Suffix for acl files (default: '.acl')
111-
-sM, --suffix-meta Suffix for metadata files (default: '.meta')
112-
-sC, --suffix-changes Suffix for acl files (default: '.changes')
113-
-sE, --suffix-sse Suffix for SSE files (default: '.events')
114-
115-
```
116-
117121

118122
## Package scripts
119123

0 commit comments

Comments
 (0)