npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-repo-generator

v0.5.0

Published

Git Repository Generator

Downloads

2

Readme

git-repo-generator

A CLI tool to generate Git repositories with specific configuration and commit histories, to quickly test your Git tools and workflows.

Quick Start

npx git-repo-generator

will generate in the current directory a Git repository with

  • A main branch
  • A test.txt file in the working directory
  • 3 commits
1--2--3  main

Options

npx git-repo-generator --dir repo-test --commits 5

| Option | Description | | ---------------------- | ------------------------------------------------------------------------------------------------------- | | -d --dir | Directory of Git repository (default: . current directory ) | | -c --commits | Number of commits (default: 3) Ignored if --file is provided (see below) | | -f --file | Configuration file (see below) | | -h --help | Display command doc |

Configuration file

You can provide a YAML file that describes your Git repo configuration and history

npx git-repo-generator -d repo-test -f git.yaml

Simple configuration file

log:
  - init
  - create file test.txt
  - commit
  - branch develop
  - checkout develop
  - create file test2.txt
  - commit
  - checkout main
  - merge develop
  - tag v1.0

will generate the following Git repository

  --2--    < develop
 /     \
1-------3  < main < v1.0

More complex configuration file

log:
  - init:
      defaultBranch: main
  - create file:
      file: test.txt
      content: line 1
  - commit:
      message: first commit
      author: user1
      email: [email protected]
  - branch develop
  - checkout develop
  - change content:
      file: test.txt
      content: |
        line 1
        line 2
  - commit
  - checkout main
  - merge:
      theirs: develop
      message: merge commit
  - tag:
      name: v1.0
      annotated: true

conf:
  author: user
  email: [email protected]

Log commands

| Command | Expressions | Notes | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Init repository | - init - init:   defaultBranch: master | If omitted: - defaultBranch = "main" | | Commit | - commit - commit:   message: first commit   author: user1   email: [email protected] | Equivalent of git add -a & git commit (stage all changes in the working dir before committing). If omitted: - message = "commit <#>" - author = conf.author ?? "user-test" - email = conf.email ?? "[email protected]" | | Create branch | - branch develop | | Checkout | - checkout develop | | Merge | - merge develop - merge:   theirs: develop   message: my merge commit   author: user1   email: [email protected] | If omitted: - message = "merge branch <theirs>" - author = conf.author ?? "user-test" - email = conf.email ?? "[email protected]" Merges never fast-forward. Merge conflicts are auto-resolved cleanly by favoring the "theirs" branch. | | Tag | - tag v1.0 - tag:   name: v1.0   annotated: true   message: new tag   author: user1   email: [email protected] | By default, creates a lightweight tag, unless annotated: trueIf omitted: - annotated = false - message = "create tag <name>" - author = conf.author ?? "user-test" - email = conf.email ?? "[email protected]" | | Create file | - create file src/test.txt - create file:   file: test.txt   content: file content - create file:   file: test.txt   content: |    line 1    line 2 | If omitted: - content = <file name> | | Change content | - change content:   file: test.txt   content: new file content | |

Configurations

conf:
  author: user # Default commit author name
  email: [email protected] # Default commit author email

License

MIT

Acknowledgements

  • isomorphic-git: for working with Git repositories (Great project. Check it out!)