5.0.0 • Published 7 months ago

pkg-up v5.0.0

Weekly downloads
8,027,491
License
MIT
Repository
github
Last release
7 months ago

pkg-up

Find the closest package.json file

Install

npm install pkg-up

Usage

/
└── Users
    └── sindresorhus
        └── foo
            ├── package.json
            └── bar
                ├── baz
                └── example.js
// example.js
import {pkgUp} from 'pkg-up';

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

API

pkgUp(options?)

Returns a Promise<string> for the file path, or Promise<undefined> if it could not be found.

pkgUpSync(options?)

Returns the file path, or undefined if it could not be found.

options

Type: object

cwd

Type: string\ Default: process.cwd()

The 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
react-dev-utilsbabel-plugin-module-resolver@yattho/gatsby-theme-rigitus@proteria/react-scripts@prisma/migrate@uukit/react-dev-kit@dxos/cli@ilya7u/bitbucket@coffeekraken/monoreposolid-state-deploysolid-state-deply@cashremit/cr-streamline-icons@nowseemee/monument@mohitsingh/react-scriptscustom-react-dev-utils-anjanreact-dev-utils-anjanp-react-dev-utilsantdeco-react-dev-utilsbb-chatclean-slate-lint@texttree/demo-bsa-reference-rcl@klizan/react-dev-utils@translation/cli@cloudkite/nextalr-react-dev-utilsmutasi-bca@jttechnic/interpreter@fdao/babel-plugin-module-resolver@zaber/motion-lib-alphareact-dev-utils-forkmy-project-generator@cocoonify/clioutdated-moduleschancegraff-dev-utils@scrumble/appsync-emulator-serverlessrn-pdf-reader-offlinebee-react-serverdevops-react-server@service-exchange/buildreact-native-slider-kf@infinitebrahmanuniverse/nolb-pkfrederick@lensung/deploysklif-ui-kitsklif-api@everything-registry/sub-chunk-2443ivory-react-dev-utils@314oner_npm/universal-components-libraryp149-tablesklif-uiaf-webpack-sudoku356-testbabel-plugin-transform-testgibgit-package-cligit-pristinegit-prestinegit-hash-packagegit-aliases-semantic-commitsgithub-cornerifygoogle-fonts-plugingofer-openapikpzc-cli-dev-template-page-customkoa-injectionkoa-slowloglaravel-react-dev-utilsjx-reportjwl-dev-utilskinvey-flex-scriptsload-grunt-taskskarma-autoloadjzkit-react-dev-utilsjulien-easy-modalkpdecker-nyclambda-webpacklion-utilslabelifylegal-clilion-systemlionconfigmain-react-dev-utilslive-perfload-tasks-gulpload-panto-transformersgui-one-react-dev-utilshas-githadron-style-managergrandpa-buildgrind-assetsgxhao-cli-dev-template-customhelios-wp-cliheq-clienthll-dev-utilshuelhtml-inject-github-cornerhtml-inject-metahweeks-semantic-release-monorepohot-zone-vuehomeconfjsiam-react-dev-utils
5.0.0

7 months ago

4.0.0

3 years ago

3.1.0

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

7 years ago

1.0.0

9 years ago