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

parent-module

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

parent-module

Get the path of the parent module

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42M
decreased by-2.57%
Maintainers
1
Weekly downloads
 
Created

What is parent-module?

The parent-module npm package allows you to find and require the parent module of a current module, which is useful in situations where you need to interact with or modify the behavior of the module that required your module. This can be particularly useful for plugins or modules that extend or modify the functionality of other modules.

What are parent-module's main functionalities?

Find and require the parent module

This feature allows you to find and require the parent module of the current module. The code sample demonstrates how to require the parent-module package and then use it to get the parent module. The 'parent' variable will contain the module object of the parent, and you can access properties such as 'filename' to get the file name of the parent module.

const parentModule = require('parent-module');
const parent = parentModule();
console.log(parent.filename);

Other packages similar to parent-module

Keywords

FAQs

Package last updated on 14 Sep 2023

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