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

parents

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parents

return all the parent directories for a directory

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is parents?

The 'parents' npm package is a utility that allows you to get an array of the directory paths from a given directory up to the root directory. It is useful for file system navigation and operations that require knowledge of a file or directory's ancestry.

What are parents's main functionalities?

Get parent directories

This feature allows you to retrieve an array of parent directories of a given path. The array starts with the immediate parent directory and ends with the root directory.

const parents = require('parents');
const dirs = parents('/usr/local/bin/node');
console.log(dirs); // ['/usr/local/bin', '/usr/local', '/usr', '/']

Other packages similar to parents

Keywords

FAQs

Package last updated on 14 Jan 2015

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