occam-dom 3.1.81 → 3.1.82
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 +19 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
- [Introduction](#introduction)
|
|
8
8
|
- [Installation](#installation)
|
|
9
|
-
- [Usage](#usage)
|
|
10
9
|
- [Example](#example)
|
|
10
|
+
- [Usage](#usage)
|
|
11
11
|
- [Building](#building)
|
|
12
12
|
- [Contact](#contact)
|
|
13
13
|
|
|
@@ -55,6 +55,24 @@ You can also clone the repository with [Git](https://git-scm.com/)...
|
|
|
55
55
|
|
|
56
56
|
You can also run a development server, see the section on building later on.
|
|
57
57
|
|
|
58
|
+
## Example
|
|
59
|
+
|
|
60
|
+
There is a small development server that can be run from within the project's directory with the following command:
|
|
61
|
+
|
|
62
|
+
npm start
|
|
63
|
+
|
|
64
|
+
The example will then be available at the following URL:
|
|
65
|
+
|
|
66
|
+
http://localhost:8888
|
|
67
|
+
|
|
68
|
+
The source for the example can be found in the `src/example.js` file and corresponding `src/example` folder. You are encouraged to try the example whilst reading what follows. You can rebuild it on the fly with the following command:
|
|
69
|
+
|
|
70
|
+
npm run watch-debug
|
|
71
|
+
|
|
72
|
+
The development server will reload the page whenever you make changes.
|
|
73
|
+
|
|
74
|
+
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.
|
|
75
|
+
|
|
58
76
|
## Usage
|
|
59
77
|
|
|
60
78
|
The collection of query utility functions is exported as a plain old JavaScript object. The only one of use is the `queryByExpression(...)` function:
|
|
@@ -87,10 +105,6 @@ const node = ...,
|
|
|
87
105
|
```
|
|
88
106
|
This is quicker than using the `queryByExpression()` function, which will create such an object each time it is invoked. Again there is an optional last `maximumDepth` argument, left out here.
|
|
89
107
|
|
|
90
|
-
## Example
|
|
91
|
-
|
|
92
|
-
There is one example with a given DOM and starting query expression. To view it, open the `index.html` file in the root of the repository. All the nodes matching the expression are given. You can change the content, which will update the parse tree; the expression, which will update the selected nodes; or the maximum depth, which will also affect the selected nodes.
|
|
93
|
-
|
|
94
108
|
## Building
|
|
95
109
|
|
|
96
110
|
Automation is done with [npm scripts](https://docs.npmjs.com/misc/scripts), have a look at the `package.json` file. The pertinent commands are:
|
|
@@ -98,12 +112,6 @@ Automation is done with [npm scripts](https://docs.npmjs.com/misc/scripts), have
|
|
|
98
112
|
npm run build-debug
|
|
99
113
|
npm run watch-debug
|
|
100
114
|
|
|
101
|
-
You can also start a small development server:
|
|
102
|
-
|
|
103
|
-
npm start
|
|
104
|
-
|
|
105
|
-
The example will then be available at http://localhost:8888 and will reload automatically when changes are made.
|
|
106
|
-
|
|
107
115
|
## Contact
|
|
108
116
|
|
|
109
117
|
* james.smith@djalbat.com
|