Nothing Special   »   [go: up one dir, main page]

5.0.0 • Published 1 year ago

pkg-up v5.0.0

Weekly downloads
8,027,491
License
MIT
Repository
github
Last release
1 year 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@uukit/react-dev-kit@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-utilsp149-tablesklif-uiaf-webpack-sudoku356-testbabel-plugin-transform-testbabel-plugin-transform-zlogt-devtoolstandem-react-dev-utilssymbol-link-managersymphony-joytachometerwinx-form-winxwinsonye-cli-dev-template-page-customwodax-af-webpackwebsked-react-dev-utilsweread-spywenjun-cli-template-page-customwrite-npmrcwoveon-loggerwow.js-juziwpdwg-cli-scriptwhale-component-docgenxly_af-webpackwyhb-cli-template-page-customwwei-cli-template-custom-vue3saber-dev-utilsrmark-react-dev-utilsrnutilsrnccshakacode-react-dev-utilssheerun-nextshikakasg-configsetup-pkgservice2sasoscaffoldizershopmonkey-react-dev-utilsrequiroresponsis-gantt-task-reactreadme-assertreactofy-css-libraryrfc-react-dev-utilsrollup-plugin-bundle-esmstar-cli-dev-page-customstandard-damn-ittemp-react-dev-utilsspfestorybook-addon-export-to-codesandboxstorybook-chromastorybook-chromaticstrapi-boing-globalstrapi-pack-upsealights-cucumber-pluginseatup
5.0.0

1 year ago

4.0.0

3 years ago

3.1.0

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.0

8 years ago

1.0.0

9 years ago