amochkin/Manipulate JSON files
Reads or writes a value of a property specified as dot-separated path from defined JSON file
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| file | Path to JSON file; default is `package.json` | — | package.json |
| mode | Mode of operation (`read`/`write`/`delete`); default is `read` | — | read |
| property | Dot-separated path to property (for example `a.b`)` | yes | — |
| value | Value to write to property, required for `write` mode | — | — |
| value_type | Type of value to write to property (`string`/`number`/`boolean`/`object`); default is `string` | — | string |
| quiet | Do not output value to the log; default is `false` | — | false |
| fallback | Fallback file to use if file is not found | — | — |
| override_with | Override read value with this value | — | — |
| use_override | Flag: Use override value instead of read value | — | false |
| output_name | Name of output variable to use | — | value |
| output_file | Path to file to write output value to. Defaults to the same file as input (write in-place) | — | — |
Outputs
| name | description |
|---|---|
| value | Value of property (only if mode is `read`). Can be override with `output_name` input. |