Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 3aaf8d1

Browse files
committed
docs(*): add documentation for null cases, and format with prettier
1 parent 31dc38f commit 3aaf8d1

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1+
# pkginfo
12
[![Build Status](https://travis-ci.org/ultrox/pkginfo.svg?branch=master)](https://travis-ci.org/ultrox/pkginfo)
23
[![version](https://img.shields.io/npm/v/@ma.vu/pkginfo.svg?style=flat-square)](http://npm.im/@ma.vu/pkginfo)
34
[![MIT License](https://img.shields.io/npm/l/pkginfo.svg?style=flat-square)](http://opensource.org/licenses/MIT)
45
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
56
[![Renovate - Always up to date][renovateapp-svg]][renovateapp-link]
7+
[![Coverage Status](https://coveralls.io/repos/github/ultrox/pkginfo/badge.svg?branch=master)](https://coveralls.io/github/ultrox/pkginfo?branch=master)
8+
9+
Flexible api to fetch npm package info
610

711
[renovateapp-link]: https://renovatebot.com/dashboard#github/ultrox/pkginfo
812
[renovateapp-svg]: https://img.shields.io/badge/always-up_to_date-brightgreen.svg
913

1014
## Install
1115

12-
1316
#### NPM
17+
1418
`npm install @ma.vu/pkginfo`
1519

1620
#### YARN
17-
`yarn add @ma.vu/pkginfo`
1821

22+
`yarn add @ma.vu/pkginfo`
1923

2024
## Usage
2125

@@ -38,7 +42,7 @@ pkginfo('got').then(data => console.log(data))
3842

3943
## Override Defaults
4044

41-
You are able to specify what you get in output.
45+
You are able to specify what you get in output.
4246

4347
NOTE: It will completely override defaults
4448

@@ -57,7 +61,6 @@ devDependencies => Int
5761
dependencies => Int
5862
```
5963

60-
6164
```javascript
6265
const pkginfo = require('@ma.vu/pkginfo')
6366

@@ -77,8 +80,8 @@ info('got', [
7780
devDependencies: 16
7881
}
7982
*/
80-
8183
```
84+
8285
### Require Exact version
8386

8487
It accepts object, and exact version of package you fetching, and now `version`
@@ -111,7 +114,15 @@ Rationale for this is, if you query db and query can't yield the result, you
111114
will get null, error will not be thrown. The same is for version
112115

113116
```javascript
114-
info('not-existing-package-name').then(data => console.log())
117+
info('not-existing-package-name').then(data => console.log(data))
118+
/*
119+
null
120+
*/
121+
```
122+
123+
#### Version does not exists
124+
```javascript
125+
info({name: 'react', version: '100.0.0'}).then(data => console.log(data))
115126
/*
116127
null
117128
*/

0 commit comments

Comments
 (0)