File tree Expand file tree Collapse file tree 4 files changed +43
-14
lines changed Expand file tree Collapse file tree 4 files changed +43
-14
lines changed Original file line number Diff line number Diff line change 1
1
# stac-node-validator
2
2
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
4
6
5
7
## Setup
6
8
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
11
11
12
12
## Usage
13
13
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 `
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+ require ( '../index.js' ) ( )
Original file line number Diff line number Diff line change @@ -119,4 +119,6 @@ async function loadSchema(name) {
119
119
}
120
120
}
121
121
122
- run ( ) ;
122
+ module . exports = async ( ) => {
123
+ await run ( ) ;
124
+ } ;
Original file line number Diff line number Diff line change 2
2
"name" : " stac-node-validator" ,
3
3
"version" : " 0.1.0" ,
4
4
"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
+ },
5
19
"main" : " index.js" ,
20
+ "bin" : {
21
+ "stac-node-validator" : " ./bin/cli.js"
22
+ },
6
23
"scripts" : {
7
- "test" : " node index .js"
24
+ "test" : " node ./bin/cli .js"
8
25
},
9
- "keywords" : [
10
- " stac"
26
+ "files" : [
27
+ " stac-spec/*/json-schema/*.json" ,
28
+ " core.json" ,
29
+ " bin/cli.js" ,
30
+ " index.js"
11
31
],
12
- "author" : " Matthias Mohr" ,
13
- "license" : " Apache-2.0" ,
14
32
"dependencies" : {
15
33
"@apidevtools/json-schema-ref-parser" : " ^9.0.1" ,
16
34
"ajv" : " ^6.12.2" ,
You can’t perform that action at this time.
0 commit comments