@planning-inspectorate/data-model 2.21.0 → 2.21.1
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 +8 -8
- package/package.json +1 -1
- package/src/index.d.ts +2 -2
package/README.md
CHANGED
|
@@ -164,30 +164,30 @@ The schemas in this repository are written in jsonc (JSON with comments), and ca
|
|
|
164
164
|
|
|
165
165
|
## Node.js Usage
|
|
166
166
|
|
|
167
|
-
To use these schemas in a Node project, add this repo as a dependency
|
|
167
|
+
To use these schemas in a Node project, add this repo as a dependency:
|
|
168
168
|
|
|
169
|
-
`npm i -s
|
|
169
|
+
`npm i -s @planning-inspectorate/data-model`
|
|
170
|
+
|
|
171
|
+
As usual with npm you can optionally specify a version:
|
|
172
|
+
|
|
173
|
+
`npm i -s @planning-inspectorate/data-model@2.20.0`
|
|
170
174
|
|
|
171
175
|
Then import as required:
|
|
172
176
|
|
|
173
177
|
```es6
|
|
174
|
-
import {loadAllSchemas} from '
|
|
178
|
+
import {loadAllSchemas} from '@planning-inspectorate/data-model';
|
|
175
179
|
```
|
|
176
180
|
|
|
177
181
|
or to import enum constants, for example:
|
|
178
182
|
|
|
179
183
|
```es6
|
|
180
|
-
import { APPEAL_CASE_STATUS } from '
|
|
184
|
+
import { APPEAL_CASE_STATUS } from '@planning-inspectorate/data-model';
|
|
181
185
|
|
|
182
186
|
if (someAppeal.status === APPEAL_CASE_STATUS.COMPLETE) {
|
|
183
187
|
console.log(`we're done!`);
|
|
184
188
|
}
|
|
185
189
|
```
|
|
186
190
|
|
|
187
|
-
To upgrade to a different version, simply doing npm command does not seem to get the correct version, so we need to first uninstall and then reinstall. You can do this by running:
|
|
188
|
-
|
|
189
|
-
`npm uninstall pins-data-model && npm prune && npm i -s github:Planning-Inspectorate/data-model#some-tag-or-commit`
|
|
190
|
-
|
|
191
191
|
### Tests
|
|
192
192
|
|
|
193
193
|
We are starting to add js tests to the models using node test runner
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED