occam-directed-graphs 3.0.53 → 3.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  - [Introduction](#introduction)
8
8
  - [Installation](#installation)
9
+ - [Example](#example)
9
10
  - [Usage](#usage)
10
11
  - [Building](#building)
11
12
  - [Running the tests](#running-the-tests)
@@ -30,6 +31,24 @@ You can also clone the repository with [Git](https://git-scm.com/)...
30
31
 
31
32
  npm install
32
33
 
34
+ ## Example
35
+
36
+ There is a small development server that can be run from within the project's directory with the following command:
37
+
38
+ npm start
39
+
40
+ The example will then be available at the following URL:
41
+
42
+ http://localhost:8888
43
+
44
+ The source for the example can be found in the `src/example.js` file. You are encouraged to try the example whilst reading what follows. You can rebuild it on the fly with the following command:
45
+
46
+ npm run watch-debug
47
+
48
+ The development server will reload the page whenever you make changes.
49
+
50
+ One last thing to bear in mind is that this package is included by way of a relative rather than a package import. If you are importing it into your own application, however, you should use the standard package import.
51
+
33
52
  ## Usage
34
53
 
35
54
  An empty directed graph can be created by calling the `fromNothing()` factory method:
package/bin/main.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ const express = require("express");
4
+
5
+ const { createLiveReloadHandler } = require("lively-cli");
6
+
7
+ const server = express(), ///
8
+ staticRouter = express.static("."),
9
+ liveReloadHandler = createLiveReloadHandler("./example.js");
10
+
11
+ server.use(staticRouter);
12
+
13
+ server.get("/live-reload", liveReloadHandler);
14
+
15
+ server.listen(8888);