🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

fx

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fx

Command-line JSON viewer

34.0.0
Source
npm
Version published
Weekly downloads
179K
-0.23%
Maintainers
1
Weekly downloads
 
Created

What is fx?

The fx npm package is a command-line JSON processing tool that allows users to manipulate and transform JSON data using JavaScript expressions. It is designed to be simple and powerful, enabling quick and efficient JSON data processing directly from the terminal.

What are fx's main functionalities?

Basic JSON Filtering

This feature allows you to filter JSON data to extract specific fields. In this example, the command extracts the 'name' field from the JSON object.

echo '{"name": "John", "age": 30}' | fx '.name'

Complex JSON Transformations

This feature enables complex transformations of JSON data using JavaScript functions. The example command maps over an array of objects and extracts the 'name' field from each object.

echo '[{"name": "John", "age": 30}, {"name": "Jane", "age": 25}]' | fx 'map(x => x.name)'

Chaining Operations

This feature allows chaining multiple operations to perform more complex data manipulations. The example command filters the array to include only objects where 'age' is greater than 25 and then maps to extract the 'name' field.

echo '[{"name": "John", "age": 30}, {"name": "Jane", "age": 25}]' | fx 'filter(x => x.age > 25).map(x => x.name)'

Other packages similar to fx

FAQs

Package last updated on 28 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts