šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

@expo/json-file

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
e

@expo/json-file

A module for reading, writing, and manipulating JSON files

9.1.0
100

Supply Chain Security

100

Vulnerability

77

Quality

99

Maintenance

100

License

Version published
Weekly downloads
3.1M
1.3%
Maintainers
27
Weekly downloads
 
Created
Issues
777

What is @expo/json-file?

The @expo/json-file npm package is a utility library for reading and writing JSON files. It provides a simple and convenient API for these operations, handling various edge cases and providing helpful error messages.

What are @expo/json-file's main functionalities?

Read JSON file

This feature allows you to read a JSON file asynchronously and parse its contents into a JavaScript object.

{"const { readAsync } = require('@expo/json-file');

async function readJsonFile(filePath) {
  const json = await readAsync(filePath);
  return json;
}

readJsonFile('path/to/file.json').then(data => console.log(data));"}

Write JSON file

This feature enables you to write a JavaScript object to a file as JSON asynchronously, with options to format the output.

{"const { writeAsync } = require('@expo/json-file');

async function writeJsonFile(filePath, data) {
  await writeAsync(filePath, data);
}

const data = { key: 'value' };
writeJsonFile('path/to/file.json', data);"}

Modify JSON file

This feature allows you to modify an existing JSON file by providing an object with the modifications you want to apply.

{"const { modifyAsync } = require('@expo/json-file');

async function modifyJsonFile(filePath, modifications) {
  await modifyAsync(filePath, modifications);
}

modifyJsonFile('path/to/file.json', { key: 'newValue' });"}

Other packages similar to @expo/json-file

Keywords

FAQs

Package last updated on 04 Apr 2025

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