Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 8, 2024 via pnpm
Package summary
Share
0
issues
1
license
2
MIT
Package created
22 Jan 2016
Version published
28 Mar 2019
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
callsites@3.1.0
parent-module@1.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of parent-module 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
callsites3.1.02.38 kBMIT
prod

Visualizations

Frequently Asked Questions

What does parent-module do?

The npm package "parent-module" is utilized to obtain the path of the parent module in a Node.js environment. Although Node.js provides module.parent, it only offers the first cached parent, not necessarily the actual one. Hence, "parent-module" proves to be a handy tool in cases where accurate retrieval of the parent module's path is necessary.

How do you use parent-module?

Utilizing "parent-module" is quite straightforward. First, you need to install it using the npm package manager by running the command npm install parent-module. Once installed, you can import it into your JavaScript file using import parentModule from 'parent-module';. Here is a basic usage example:

// bar.js file
import parentModule from 'parent-module';

export default function bar() {
	console.log(parentModule());
	// This will log the path of the parent module
};
// foo.js file
import bar from './bar.js';

bar();
// This will call the function from bar.js and output the path.

If you desire to work with multiple module levels down, you can specify the file path as an argument to the function parentModule(filePath).

Where are the parent-module docs?

The accompanying documentation for "parent-module" can be found directly in the readme content presented above. It contains all crucial information including installation instructions, general usage, and tips for extending the usage (like combining it with read-pkg-up to read package.json of the parent module). Keep in mind that the ability to use this package effectively requires a good understanding of Node.js module mechanism and ES6 import/export syntax.