5.0.0 • Published 6 months ago

pkg-up v5.0.0

Weekly downloads
8,027,491
License
MIT
Repository
github
Last release
6 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-testzero-projectzero-scriptszmanemet@frctl/cli@freelog-cli/add@fuzeman/babel-plugin-module-resolver@fuzeman/eslint-import-resolver-babel-module@gama-academy/semantic-release-monorepo@fwork-cli/add@futpib/babel-plugin-module-resolverwbpk-5-cra-utilswbpk-5-cra-utils-hot-reloadwebpack-bugsnag-pluginwebpack-external-importzinc-react-dev-utilszus-clizy-cli-dev-template-page-customzefir@genx/babel-plugin-module-resolverwodax-af-webpackwinsonye-cli-dev-template-page-customwenjun-cli-template-page-customweread-spywinx-form-winxyour-deps-authorsyou-get-httpstypes-versiontypeveru-libraryult-dev-utilsxly_af-webpackxstate-codegenyarn-add-webpack-pluginyuyd-cli-dev-template-page-customts-gatevue-compmentversion-iovirtual-tour-guidevitebookvs-codesandboxervova-webpack@halfdomelabs/create-project@hakkajs/cli@hellomouse/react-dev-utils@helpscout/groovy@grnet/webpack-terms-replace-loader@guidodizi/babel-plugin-module-resolver@greminder/bootstrap-material-design
5.0.0

6 months ago

4.0.0

2 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