npm.io
1.0.6 • Published 6 years ago

has-package

Licence
MIT
Version
1.0.6
Deps
0
Size
3 kB
Vulns
0
Weekly
0

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.

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

License

MIT Bu Kinoshita

Keywords