Skip to content

Please have an example assigning values to JSON object #89

@yookoala

Description

@yookoala

Please provide an example for JSON object assignment. Something equivalent to this:

npx jq '.scripts.build = "sass --load-path=./scss ./scss/style.scss:./css/style.css"' package.json

That is to add a value to json like this:

{
  "name": "some-library",
  "version": "1.0.0",
  "scripts": {
    "test": "some test"
  },
}

And turn it into this:

{
  "name": "some-library",
  "version": "1.0.0",
  "scripts": {
    "build": "sass --load-path=./scss ./scss/style.scss:./css/style.css",
    "test": "some test"
  },
}

There is no example or guide how to reference a value in the existing JSON object input. Would really know how to do it. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions