@hyhello/geo-cli v1.0.0
@hyhello/geo-cli
Engineering tool based on GeoJson performance optimization.
Read this document in: 简体中文.
Installation
While you can install Geo CLI globally on your machine, it's much better to install it locally project by project.
There are two primary reasons for this.
- Different projects on the same machine can depend on different versions of Geo allowing you to update them individually.
- Not having an implicit dependency on the environment you are working in makes your project far more portable and easier to setup.
We can install Geo CLI locally by running:
npm install --save-dev @hyhello/geo-cliNote: If you do not have a package.json, create one before installing. This will ensure proper interaction with the npx command.
After that finishes installing, your package.json file should include:
{
"devDependencies": {
+ "@hyhello/geo-cli": "^0.0.4"
}
}Examples (Run it and see it)
Check out the examples/ folder for code and interface examples.
node examples/demo.json
# etc...Usage
Note: Please install @hyhello/geo-cli first before npx geo, you can also drop it inside of an npm run script or you may instead execute with the relative path instead. ./node_modules/.bin/geo
npx geo demo.jsoncompile
Compile the file demo.json and overwrite the source file.
npx geo demo.json
# overwrite demo.jsonIf you would like to input to a file or dir, you may use --input or -i.
npx geo --input demo.jsonIf you would like to output to a file or dir, you may use --output or -o.
npx geo demo.json --output other.jsonpretty
Beautify JSON files you may use --pretty or -p number|boolean
npx geo demo.json --prettyabove indentation is 2
If you want to customize the indentation, you can --pretty=number
npx geo demo.json --pretty=4recursive
If you --input is a folder, and you want to recursively find all .json files in the folder, you can use --recursive or -r
npx geo --input examples --recursiverelative
If you --output is a folder, and you don't want to keep the previous directory structure, you can use --no-relative
npx geo --input examples --on-relativeemptyDir
If you --output is a folder, and you want to empty it before you compile
npx geo --input examples -o output --empty-direxclude
Exclude files that match the regular expression pattern
--exclude or -e
npx geo examples --exclude examples/other.jsonCustom config path
Custom configuration file. only supported .js file
--config-file or -c
npx geo demo.json --config-file geo.config.jsIf you don't know how to configure it, you can exec geo --init
npx geo --inithelp
--help or -h
npx geo --helpversion
--version or -v
npx geo --version