parent-module alternatives and similar modules
Based on the "Miscellaneous" category.
Alternatively, view parent-module alternatives based on common mentions on social networks and blogs.
-
Electron
:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS -
cheerio
The fast, flexible, and elegant library for parsing and manipulating HTML and XML. -
jsdom
A JavaScript implementation of various web standards, for use with Node.js -
v86
x86 virtualization in your browser, recompiling x86 to wasm on the fly -
dotenv
Loads environment variables from .env for nodejs projects. -
patch-package
Fix broken node modules instantly ๐๐ฝโโ๏ธ๐จ -
ssh2
SSH2 client and server modules written in pure JavaScript for node.js -
hypernova
A service for server-side rendering your JavaScript views -
file-type
Detect the file type of a Buffer/Uint8Array/ArrayBuffer -
webworker-threads
Lightweight Web Worker API implementation with native threads -
node-pre-gyp
Node.js tool for easy binary deployment of C++ addons -
Bottleneck
Job scheduler and rate limiter, supports Clustering -
mem
Memoize functions - an optimization technique used to speed up consecutive function calls by caching the result of calls with identical input -
hasha
Hashing made simple. Get the hash of a buffer/string/stream/file. -
dot-prop
Get, set, or delete a property from a nested object using a dot path -
node-bell
Real-time anomalies detection for periodic time series. -
basic-ftp
FTP client for Node.js, supports FTPS over TLS, passive mode over IPv6, async/await, and Typescript. -
schemapack
Create a schema object to encode/decode your JSON in to a compact byte buffer with no overhead. -
nar
node.js application archive - create self-contained binary like executable applications that are ready to ship and run -
stringify-object
Stringify an object/array like JSON.stringify just without all the double-quotes -
cashify
๐ธ Lightweight currency conversion library, successor of money.js -
node-video-lib
Node.js Video Library / MP4 & FLV parser / MP4 builder / HLS muxer -
require-uncached
Import a module while bypassing the cache -
resolve-from
Resolve the path of a module like require.resolve() but from a given path -
remote-git-tags
Get tags from a remote git repo. Using only JS. No git binary required.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of parent-module or a related project?
README
parent-module
Get the path of the parent module
Node.js exposes module.parent
, but it only gives you the first cached parent, which is not necessarily the actual parent.
Install
$ npm install parent-module
Usage
// bar.js
const parentModule = require('parent-module');
module.exports = () => {
console.log(parentModule());
//=> '/Users/sindresorhus/dev/unicorn/foo.js'
};
// foo.js
const bar = require('./bar');
bar();
API
parentModule(filePath?)
By default, it will return the path of the immediate parent.
filePath
Type: string
\
Default: __filename
File path of the module of which to get the parent path.
Useful if you want it to work [multiple module levels down](fixtures/filepath).
Tip
Combine it with read-pkg-up
to read the package.json of the parent module.
const path = require('path');
const readPkgUp = require('read-pkg-up');
const parentModule = require('parent-module');
console.log(readPkgUp.sync({cwd: path.dirname(parentModule())}).pkg);
//=> {name: 'chalk', version: '1.0.0', โฆ}
Get professional support for this package with a Tidelift subscription Tidelift helps make open source sustainable for maintainers while giving companiesassurances about security, maintenance, and licensing for their dependencies.