read-pkg

WebJar for read-pkg

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

read-pkg
Last Version

Last Version

5.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

read-pkg
WebJar for read-pkg
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/read-pkg

Download read-pkg

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/read-pkg/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>read-pkg</artifactId>
    <version>5.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/read-pkg/
implementation 'org.webjars.npm:read-pkg:5.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/read-pkg/
implementation ("org.webjars.npm:read-pkg:5.2.0")
'org.webjars.npm:read-pkg:jar:5.2.0'
<dependency org="org.webjars.npm" name="read-pkg" rev="5.2.0">
  <artifact name="read-pkg" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='read-pkg', version='5.2.0')
)
libraryDependencies += "org.webjars.npm" % "read-pkg" % "5.2.0"
[org.webjars.npm/read-pkg "5.2.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : types__normalize-package-data jar [2.4.0,3)
org.webjars.npm : normalize-package-data jar [2.5.0,3)
org.webjars.npm : parse-json jar [5.0.0,6)
org.webjars.npm : type-fest jar [0.6.0,0.7)

Project Modules

There are no modules declared in this project.

read-pkg Build Status

Read a package.json file

Why

Install

$ npm install read-pkg

Usage

const readPkg = require('read-pkg');

(async () => {
	console.log(await readPkg());
	//=> {name: 'read-pkg', …}

	console.log(await readPkg({cwd: 'some-other-directory'}));
	//=> {name: 'unicorn', …}
})();

API

readPkg(options?)

Returns a Promise<object> with the parsed JSON.

readPkg.sync(options?)

Returns the parsed JSON.

options

Type: object

cwd

Type: string
Default: process.cwd()

Current working directory.

normalize

Type: boolean
Default: true

Normalize the package data.

Related


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
5.2.0
3.0.0
2.0.0
1.1.0