Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@expo/json-file

Package Overview
Dependencies
Maintainers
27
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expo/json-file

A module for reading, writing, and manipulating JSON files

  • 0.0.1-canary-20240418-8d74597
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
increased by2.97%
Maintainers
27
Weekly downloads
 
Created

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 18 Apr 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc