package-json-from-git
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

package-json-from-git

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

Install

npm i package-json-from-git

Usage

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

getPackageJsonFromGit().then((data) => {
  console.log(data);
});
{
  "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:

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

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

Readme

Keywords

none

Package Sidebar

Install

npm i package-json-from-git

Weekly Downloads

69

Version

1.2.2

License

GPL-3.0

Unpacked Size

42.4 kB

Total Files

7

Last publish

Collaborators

  • guoyunhe