Skip to content

Commit a01f90a

Browse files
committed
intro bin and update README.md
1 parent 5b4ec8d commit a01f90a

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,30 @@ It might be useful for small projects (e.g. hackathon).
1414

1515
## Installation
1616

17-
`npm install rest-flat-file-db --save`
18-
1917
## Usage
2018

2119
### As standalone instance
2220

2321
```
24-
$ PORT=3333 DB=/tmp/mydatabase npm start
25-
```
22+
# install the module globally
23+
$ npm install -g rest-flat-file-db
2624
27-
will start a `rest-flat-file-db` instance on `http://localhost:3333` and the values will be stored in `/tmp/mydatabase` file
25+
# start the module with default parameters
26+
$ rest-flat
27+
28+
# OR start it with custom parameters
29+
$ PORT=3333 DB=/tmp/mydatabase rest-flat
30+
```
2831

2932
### As module
3033

34+
`$ npm install rest-flat-file-db --save`
35+
36+
3137
```javascript
38+
39+
// index.js
40+
3241
const restflat = require('rest-flat-file-db');
3342
const flatdb = require('flat-file-db');
3443

bin.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /usr/bin/env node
2+
require('./start');

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"version": "1.1.0",
44
"description": "REST API for flat-file-db",
55
"main": "index.js",
6+
"bin": {
7+
"rest-flat": "./bin.js"
8+
},
69
"author": "balazs4 <balazs4web@gmail.com>",
710
"license": "MIT",
811
"scripts": {
9-
"start": "node start.js",
10-
"start:verbose": "DEBUG=rest-flat node start.js",
12+
"start": "DEBUG=rest-flat node start.js",
1113
"test": "jest --coverage"
1214
},
1315
"dependencies": {

0 commit comments

Comments
 (0)