🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@avanio/os-api-linux-utils

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@avanio/os-api-linux-utils

This package provides file utilities for reading, writing, and deleting files on Linux. It also includes the option to perform these operations with sudo privileges.

latest
npmnpm
Version
0.4.0
Version published
Maintainers
3
Created
Source

@avanio/os-api-linux-utils

This package provides file utilities for reading, writing, and deleting files on Linux. It also includes the option to perform these operations with sudo privileges.

Installation

To install this package, run the following command:

npm install @avanio/os-api-linux-utils

Usage

// read file
const data: Buffer = readFile('/path/to/file', {sudo: true});
const data: Buffer = await readFilePromise('/path/to/file', {sudo: true});

// write file
writeFile('/path/to/file', Buffer.from('data'), {sudo: true});
await writeFilePromise('/path/to/file', Buffer.from('data'), {sudo: true});

// delete file
deleteFile('/path/to/file', {sudo: true});
await deleteFilePromise('/path/to/file', {sudo: true});

// logging sudo commands
setSudoFileLogger(console); // or log4js or winston or any ILoggerLike object

FAQs

Package last updated on 15 Jul 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