has-package
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

has-package Build Status

Check if a project has package.json

Checks if a package.json file is present in the working directory.

Install

$ yarn add has-package

Usage

.
├── foo
│   └── ...
└── bar
    └── package.json
const hasPackage = require('has-package')
 
hasPackage('foo')
//=> false
 
hasPackage('bar')
//=> true

API

hasPackage([cwd])

Returns a boolean.

cwd

Type: string
Default: process.cwd()

Current working directory.

Related

  • read-package — Reads package.json in the working directory

License

MIT © Bu Kinoshita

Package Sidebar

Install

npm i has-package

Weekly Downloads

23

Version

1.0.6

License

MIT

Unpacked Size

3.02 kB

Total Files

7

Last publish

Collaborators

  • bukinoshita