https://github.com/parro-it/resolve-from-caller
Resolve module paths relative to caller module file.
https://github.com/parro-it/resolve-from-caller
Last synced: 11 months ago
JSON representation
Resolve module paths relative to caller module file.
- Host: GitHub
- URL: https://github.com/parro-it/resolve-from-caller
- Owner: parro-it
- License: mit
- Created: 2016-04-15T20:24:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-15T21:14:13.000Z (almost 10 years ago)
- Last Synced: 2024-10-08T03:13:45.784Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# resolve-from-caller
> Resolve module paths relative to caller module file.
[](http://travis-ci.org/parro-it/resolve-from-caller)
[](https://npmjs.org/package/resolve-from-caller)
[](https://npmjs.org/package/resolve-from-caller)
# Installation
```bash
npm install --save resolve-from-caller
```
# Usage
lib/index.js:
```js
const resolve = require('resolve-from-caller');
console.log(resolve('./a'));
//-> a.js
```
user-land.js:
```js
const lib = require('./lib');
```
a.js:
```js
// anything
```
# Credits
This module begin as a PR to [module-resolve-as-caller](https://github.com/fengb/module-resolve-as-caller).
# License
The MIT License (MIT)
Copyright (c) 2016 Andrea Parodi