# package-json-from-git

> Generate package.json information from Git data. Useful for `create-xxx` tools.

Latest version **1.2.2** (published 2023-01-30) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install package-json-from-git
pnpm add package-json-from-git
yarn add package-json-from-git
bun add package-json-from-git
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2023-01-30 |
| First published | 2023-01-22 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 41.4 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Guo Yunhe |
| Maintainers | guoyunhe |

## Links

- npm: https://www.npmjs.com/package/package-json-from-git
- Repository: https://github.com/guoyunhe/package-json-from-git
- Homepage: https://github.com/guoyunhe/package-json-from-git#readme
- Issues: https://github.com/guoyunhe/package-json-from-git/issues
- Funding: https://github.com/sponsors/guoyunhe
- npm.io page: https://npm.io/package/package-json-from-git

## Dependencies (2)

- [simple-git](https://npm.io/package/simple-git.md) ^3.16.0
- [git-url-parse](https://npm.io/package/git-url-parse.md) ^13.1.0

## Recent versions

- 1.2.2 (latest) — 2023-01-30
- 1.2.1 — 2023-01-30
- 1.2.0 — 2023-01-29
- 1.1.0 — 2023-01-29
- 1.0.0 — 2023-01-22

## README

# package-json-from-git

Generate package.json information from Git data. Useful for `create-xxx` tools.

## Install

```bash
npm i package-json-from-git
```

## Usage

```js
import { getPackageJsonFromGit } from 'package-json-from-git';

getPackageJsonFromGit().then((data) => {
  console.log(data);
});
```

```json
{
  "author": {
    "email": "i@guoyunhe.me",
    "name": "Guo Yunhe"
  },
  "bugs": {
    "url": "https://github.com/guoyunhe/package-json-from-git/issues"
  },
  "homepage": "https://github.com/guoyunhe/package-json-from-git#readme",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/guoyunhe/package-json-from-git.git"
  },
  "funding": "https://github.com/sponsors/guoyunhe"
}
```

By default, the function read `process.cwd()`, if your git repo is in other position, use:

```js
import { getPackageJsonFromGit } from 'package-json-from-git';

getPackageJsonFromGit('path/to/git/repo').then((data) => {
  console.log(data);
});
```

---
_Source: https://npm.io/package/package-json-from-git · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
