Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

steelbrain/atom-package-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Atom-Package-Path

An npm module to get path of requirer apm module from your npm module

API
export function guess(): ?string
export function guessFromCallIndex(index: number): ?string
export function guessFromFilePath(filePath: string): ?string

Usage

import {guess} from 'atom-package-path'

export function doSomething() {
  console.log('this package was required in apm package', guess())
}

Notes

This package guesses filePath of requirer based on the stack. It expects the stack to come from the Atom package, therefore it will work only when you call this method when your module is called from an Atom package.

License

This project is licensed under the terms of MIT License. Check the LICENSE file for more info.

About

Get path of requirer apm module from your npm module

Resources

License

Stars

Watchers

Forks

Packages

No packages published