Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/scriptex/npm-maintainer

Web component which shows statistics for a user in NPM
https://github.com/scriptex/npm-maintainer

npm-stats statistics web-component

Last synced: 9 days ago
JSON representation

Web component which shows statistics for a user in NPM

Awesome Lists containing this project

README

        

[![Github Build](https://github.com/scriptex/npm-maintainer/workflows/Build/badge.svg)](https://github.com/scriptex/npm-maintainer/actions?query=workflow%3ABuild)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/34d3d75710534dc6a38c3584a1dcd068)](https://www.codacy.com/gh/scriptex/npm-maintainer/dashboard?utm_source=github.com&utm_medium=referral&utm_content=scriptex/npm-maintainer&utm_campaign=Badge_Grade)
[![Codebeat Badge](https://codebeat.co/badges/d765a4c8-2c0e-44f2-89c3-fa364fdc14e6)](https://codebeat.co/projects/github-com-scriptex-npm-maintainer-master)
[![CodeFactor Badge](https://www.codefactor.io/repository/github/scriptex/npm-maintainer/badge)](https://www.codefactor.io/repository/github/scriptex/npm-maintainer)
[![DeepScan grade](https://deepscan.io/api/teams/3574/projects/5257/branches/40799/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=3574&pid=5257&bid=40799)
[![Analytics](https://ga-beacon-361907.ew.r.appspot.com/UA-83446952-1/github.com/scriptex/npm-maintainer/README.md?pixel)](https://github.com/scriptex/npm-maintainer/)

# NPM Maintainer

> Statistics for a NPM user. See the demo [here](https://npm-maintainer.atanas.info/)

A web component which shows various statistics for a user in the NPM database.

## Visitor stats

![GitHub stars](https://img.shields.io/github/stars/scriptex/npm-maintainer?style=social)
![GitHub forks](https://img.shields.io/github/forks/scriptex/npm-maintainer?style=social)
![GitHub watchers](https://img.shields.io/github/watchers/scriptex/npm-maintainer?style=social)
![GitHub followers](https://img.shields.io/github/followers/scriptex?style=social)

## Code stats

![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/scriptex/npm-maintainer)
![GitHub repo size](https://img.shields.io/github/repo-size/scriptex/npm-maintainer?style=plastic)
![GitHub language count](https://img.shields.io/github/languages/count/scriptex/npm-maintainer?style=plastic)
![GitHub top language](https://img.shields.io/github/languages/top/scriptex/npm-maintainer?style=plastic)
![GitHub last commit](https://img.shields.io/github/last-commit/scriptex/npm-maintainer?style=plastic)

## Install

```sh
npm i npm-maintainer

#or

yarn add npm-maintainer
```

## Usage

```js
// In your JS entrypoint
import 'npm-maintainer';
```

```html

```

## Attributes

| Name | Type | Required | Default | Description |
| --------- | -------- | -------- | --------------------- | ---------------------------------- |
| `user` | `string` | true | '' | The user name from NPM |
| `error` | `string` | false | 'Error loading data.' | Message shown when an error occurs |
| `loading` | `string` | false | 'Loading data...' | Message shown when loading data |

## Styling

The `npm-maintainer` Web Component utilizes the [`::part()`](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) pseudo-element. In order to add custom styles, you should use the corresponding parts of the components:

- `error` - The element which shows the error message
- `loading` - The element which shows the loading message
- `content` - The element which shows the data table
- `table` - The <table> itself
- `thead` - The <thead> element
- `thead`-row - The <tr> inside the <thead> element
- `tbody` - The <tbody> element
- `tbody`-row - The <tr> inside the <tbody> element
- `th` - the <th> elements
- `td` - the <td> elements

Here is an example:

```css
npm-maintainer {
display: block;
}

npm-maintainer::part(error),
npm-maintainer::part(loading) {
text-align: center;
min-height: 75vh;
display: flex;
align-items: center;
align-content: center;
justify-content: center;
}

npm-maintainer::part(error) {
color: red;
}

npm-maintainer::part(table) {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
}

npm-maintainer::part(th),
npm-maintainer::part(td) {
padding: 0.25rem;
border: 1px solid;
}

npm-maintainer::part(link) {
color: inherit;
text-decoration: underline;
}

npm-maintainer::part(link):hover {
text-decoration: none;
}
```

## LICENSE

MIT

Connect with me:






 



 



 



 



 



 



 



 



 



 



 



---


Support and sponsor my work: