2.0.2 • Published 1 year ago

readpkg-lit v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

readpkg-lit

This package finds and parses the closes package.json.

Installation

$ npm i readpkg-lit
# or
$ yarn add readpkg-lit

Usage

import { readPackageUp } from 'readpkg-lit';

console.log(await readPackageUp());
// -> { packageJson: { name: '<package-name>', ... }, path: 'path/to/package.json' }

API

readPackageUp(options?) / readPackageUpSync(options?)

Returns a Promise<object|undefined> depending if a package.json file was found.

In sync mode, returns object or undefined without a promise.

options

Type: object

cwd

Type: string
Default: process.cwd()

Current working directory to start traversing the file tree up until a package.json was found.

normalize

Type: boolean
Default: true

Normalize the package.json data using normalize-package-data.

Development

(1) Install dependencies

$ npm i
# or
$ yarn

(2) Run initial validation

$ ./Taskfile.sh validate

(3) Start developing. See ./Taskfile.sh for more tasks to help you develop.


2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.2.8

3 years ago

1.3.0

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.0

4 years ago