Skip to content

Commit 797eab4

Browse files
committed
Prep for release
1 parent 254b0e7 commit 797eab4

File tree

4 files changed

+43
-14
lines changed

4 files changed

+43
-14
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
# stac-node-validator
22

3-
Simple proof-of-concept to validate STAC Items, Catalogs and Collections with node.
3+
Simple proof-of-concept to validate STAC Items, Catalogs, Collections and core extensions with node.
4+
5+
Version: 0.1.0 - supports STAC 1.0.0-beta.1
46

57
## Setup
68

7-
1. Install [node and npm](https://nodejs.org/en/) - should run with any recent version
8-
2. `git clone --recurse-submodules https://github.com/m-mohr/stac-node-validator` to clone the repo and pull the submodules
9-
3. `cd stac-node-validator` to switch into the new folder created by git
10-
4. `npm install` to install dependencies
9+
1. Install [node and npm](https://nodejs.org) - should run with any recent version
10+
2. `npm install -g stac-node-validator` to install the library
1111

1212
## Usage
1313

14-
- Validate all examples in the STAC spec repo: `npm test`
15-
- Validate a single file: `npm test -- /path/to/your/file.json`
16-
- Validate multiple files: `npm test -- /path/to/your/catalog.json /path/to/your/item.json`
14+
- Validate a single file: `stac-node-validator /path/to/your/file.json`
15+
- Validate multiple files: `stac-node-validator /path/to/your/catalog.json /path/to/your/item.json`
16+
- Validate all examples in the STAC spec repo (only present if installed from GitHub): `stac-node-validator`
17+
18+
### Development
19+
20+
1. `git clone --recurse-submodules https://github.com/m-mohr/stac-node-validator` to clone the repo and pull the submodules
21+
2. `cd stac-node-validator` to switch into the new folder created by git
22+
3. `npm install install` to install dependencies
23+
4. Run the commands as above, but replace `stac-node-validator` with `npm test --`, for example `npm test -- /path/to/your/file.json`

bin/cli.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('../index.js')()

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,6 @@ async function loadSchema(name) {
119119
}
120120
}
121121

122-
run();
122+
module.exports = async () => {
123+
await run();
124+
};

package.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,33 @@
22
"name": "stac-node-validator",
33
"version": "0.1.0",
44
"description": "STAC Validator for NodeJS",
5+
"author": "Matthias Mohr",
6+
"license": "Apache-2.0",
7+
"keywords": [
8+
"stac",
9+
"validator"
10+
],
11+
"homepage": "https://github.com/m-mohr/stac-node-validator",
12+
"bugs": {
13+
"url": "https://github.com/m-mohr/stac-node-validator/issues"
14+
},
15+
"repository": {
16+
"type": "git",
17+
"url": "https://github.com/m-mohr/stac-node-validator.git"
18+
},
519
"main": "index.js",
20+
"bin": {
21+
"stac-node-validator": "./bin/cli.js"
22+
},
623
"scripts": {
7-
"test": "node index.js"
24+
"test": "node ./bin/cli.js"
825
},
9-
"keywords": [
10-
"stac"
26+
"files": [
27+
"stac-spec/*/json-schema/*.json",
28+
"core.json",
29+
"bin/cli.js",
30+
"index.js"
1131
],
12-
"author": "Matthias Mohr",
13-
"license": "Apache-2.0",
1432
"dependencies": {
1533
"@apidevtools/json-schema-ref-parser": "^9.0.1",
1634
"ajv": "^6.12.2",

0 commit comments

Comments
 (0)