about-this-app

1.1.1 • Public • Published

about-this-app

Greenkeeper badge

Build Status

Utility functions to query a project's package.json file.

const app = require('about-this-app');

Properties

root

The app's root directory (where package.json is located)

pkg

The parsed package.json

dirs

The directories field (or an empty object)

Methods

dir(name)

The resolved path to a named directory. If the name is not found in app.dirs the absolute path to <app.root>/<name> is returned.

hasPkgProp(name)

Returns whether package.json has a property with the given name .

hasDep(name /*, name2, ... */)

Returns whether dependencies contains any of the names.

hasDevDep(name /*, name2, ... */)

Returns whether devDependencies contains any of the names.

hasPeerDep(name /*, name2, ... */)

Returns whether peerDependencies contains any of the names.

hasAnyDep(name /*, name2, ... */)

Returns whether any of the names is listed as any kind of dependency.

hasScript(name /*, name2, ... */)

Returns whether scripts contains any of the names.

hasFile(name)

Returns whether a file with the given name exists relative to app.root.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i about-this-app

Weekly Downloads

1,311

Version

1.1.1

License

MIT

Unpacked Size

4.98 kB

Total Files

8

Last publish

Collaborators

  • fgnass