Skip to content

Instantly share code, notes, and snippets.

@nicokosi
Last active September 6, 2023 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicokosi/3fbee1980ebe1b39f203fc084a6fc4bf to your computer and use it in GitHub Desktop.
Save nicokosi/3fbee1980ebe1b39f203fc084a6fc4bf to your computer and use it in GitHub Desktop.
Manipulating data with nushell commands (see https://www.nushell.sh / https://www.nushell.sh/cookbook)
# Download a JSON file from a URL and visualize it:
fetch https://jsonplaceholder.typicode.com/posts
# Visualize a JSON file:
open ./work/tldr/package.json
# Fetch the first 2 JSON array items:
fetch https://jsonplaceholder.typicode.com/posts | first 2
# Fetch raw JSON :
fetch https://jsonplaceholder.typicode.com/posts --raw
# Fetch all 'userId' JSON attribute values from a URL:
(fetch https://jsonplaceholder.typicode.com/posts).userId
# or
fetch https://jsonplaceholder.typicode.com/posts | get userId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment