Skip to content

Commit 7308849

Browse files
committed
Add bin entry, making the package executable
1 parent 2fc0871 commit 7308849

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,28 @@
22

33
[blog](https://wtf.allwallet.dev/)
44

5-
## Building
5+
## Usage
6+
7+
Optionally, you can [configure npm to install without superuser permissions][unglobal].
8+
9+
```bash
10+
# Install the server
11+
npm install -g @wallet-test-framework/framework
12+
13+
# Run the server
14+
wtfd
15+
```
16+
17+
[unglobal]: https://github.com/sindresorhus/guides/blob/3f4ad3e30efd384f42384b61b38e82626a4c3b7a/npm-global-without-sudo.md
18+
19+
## Development
20+
21+
### Building
622

723
To install the dependencies:
824

925
```bash
10-
npm install
26+
npm install --include=dev
1127
```
1228

1329
To compile the TypeScript into JavaScript and create the relevant bundles:
@@ -16,15 +32,15 @@ To compile the TypeScript into JavaScript and create the relevant bundles:
1632
npm run build
1733
```
1834

19-
## Linting
35+
### Linting
2036

2137
Before creating a pull request, please make sure to run:
2238

2339
```bash
2440
npm test
2541
```
2642

27-
## Running
43+
### Running
2844

2945
After building, you can run the web server with:
3046

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"browser": "./dist/client/worker_chain.js"
1414
}
1515
},
16+
"bin": {
17+
"wtfd": "./dist/server/index.js"
18+
},
1619
"files": [
1720
"dist"
1821
],

server/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
import { Connections } from "./connections.js";
23
import cors from "cors";
34
import express from "express";

0 commit comments

Comments
 (0)