rrpf
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

rrpf

NPM version

Reliable relative path of the file

Why

When i use npx to execute a '.js' file that contains references to files in relative path, file had been looking for based on the path where the npx is executed.

That's certainly not what I wanted, the path that based on '.js' file is what I expected.

Install

npm i rrpf

Usage

// module
import rrpf from 'rrpf'
// or commonjs
const rrpf = require('rrpf')

rrpf('./path/to/file/foo.*')

Example

|-- project
    |-- a.js
    |-- b.js
// a.js
import rrpf from 'rrpf'

rrpf('./b.js') // /path/to/project/b.js

Sponsors

License

MIT License © 2022 Liam Shi

Readme

Keywords

none

Package Sidebar

Install

npm i rrpf

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

4.97 kB

Total Files

6

Last publish

Collaborators

  • liamrad
  • byronogis