@hbauer/find-package-dir

0.2.4 • Public • Published

find-package-dir

Intended for use in libraries requiring the path of the dependent package.

Install

$ npm install @hbauer/find-package-dir
# or
$ yarn add @hbauer/find-package-dir

Objective

/
└── Users
    └── handlebauer
      └── project
          └── node_modules
              └── your-library
          └── package.json

In the above tree, find-package-dir will locate /Users/handlebauer/project

Example

ESM

import { findPackageDir } from '@hbauer/find-package-dir'
const packageDir = findPackageDir() // = `/Users/handlebauer/project`

CommonJS

const { findPackageDir } = require('@hbauer/find-package-dir')
const packageDir = findPackageDir() // = `/Users/handlebauer/project`

Readme

Keywords

none

Package Sidebar

Install

npm i @hbauer/find-package-dir

Weekly Downloads

0

Version

0.2.4

License

MIT

Unpacked Size

2.66 kB

Total Files

4

Last publish

Collaborators

  • hbauer