Skip to content

guoyunhe/package-json-from-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
});

About

Generate package.json information from Git data

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published