pkg-up

WebJar for pkg-up

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

pkg-up
Last Version

Last Version

3.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

pkg-up
WebJar for pkg-up
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/pkg-up

Download pkg-up

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/pkg-up/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>pkg-up</artifactId>
    <version>3.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/pkg-up/
implementation 'org.webjars.npm:pkg-up:3.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/pkg-up/
implementation ("org.webjars.npm:pkg-up:3.1.0")
'org.webjars.npm:pkg-up:jar:3.1.0'
<dependency org="org.webjars.npm" name="pkg-up" rev="3.1.0">
  <artifact name="pkg-up" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='pkg-up', version='3.1.0')
)
libraryDependencies += "org.webjars.npm" % "pkg-up" % "3.1.0"
[org.webjars.npm/pkg-up "3.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : find-up jar [3.0.0,4)

Project Modules

There are no modules declared in this project.

pkg-up Build Status

Find the closest package.json file

Install

$ npm install pkg-up

Usage

/
└── Users
    └── sindresorhus
        └── foo
            ├── package.json
            └── bar
                ├── baz
                └── example.js
// example.js
const pkgUp = require('pkg-up');

(async () => {
	console.log(await pkgUp());
	//=> '/Users/sindresorhus/foo/package.json'
})();

API

pkgUp([options])

Returns a Promise<string> for the filepath, or Promise<null> if it couldn't be found.

pkgUp.sync([options])

Returns the filepath, or null if it couldn't be found.

options

Type: Object

cwd

Type: string
Default: process.cwd()

Directory to start from.

Related

  • read-pkg-up - Read the closest package.json file
  • pkg-dir - Find the root directory of an npm package
  • find-up - Find a file by walking up parent directories

License

MIT © Sindre Sorhus

Versions

Version
3.1.0
2.0.0
1.0.0