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

infer-owner

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infer-owner

Infer the owner of a path based on the owner of its nearest existing parent

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9M
decreased by-8.1%
Maintainers
3
Weekly downloads
 
Created

What is infer-owner?

The infer-owner npm package is designed to infer the owner of a file or directory based on the ownership of its parent directories. It is particularly useful in file system operations where maintaining the correct file ownership is crucial, such as in deployment scripts or file management utilities. This package helps ensure that files and directories are created with the appropriate ownership, reflecting the ownership of their parent directories, thus maintaining consistency and security in file operations.

What are infer-owner's main functionalities?

Infer ownership of a file or directory

This feature allows you to infer the ownership (user ID and group ID) of a file or directory by analyzing its parent directories. The function returns a Promise that resolves with an object containing the `uid` and `gid` of the inferred owner.

const inferOwner = require('infer-owner');

inferOwner('/path/to/file/or/directory').then(owner => {
  console.log(owner); // { uid: 1000, gid: 1000 }
});

Other packages similar to infer-owner

FAQs

Package last updated on 19 Jul 2019

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