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

@johnls/git-extra

v3.6.0

Published

Extra git commands for working with GitHub, BitBucket and GitLab

Downloads

4

Readme

Extra Git Commands

A tool that creates some commands for working with BitBucket and GitHub that you can add to Git.

  • browse - Opens a browser for the current repository and branch.
  • pull-request - Opens a new pull-request.
  • quick-start - Quickly starts a new project by copying and customizing an existing repository.

To add these commands to Git, do git config --global --edit and insert:

[alias]
  ...
  browse = !git-extra browse
  pull-request = !git-extra pull-request
  quick-start = !git-extra quick-start

Quick Start

By default quick-start copies an existing repository by cloning it and then resets the Git history.

The power of quick-start is that you can customize the project after the initial clone. To enable this, create a git-extra-customize.js file in the root of the project. This file contains a Javascript program that is run after the initial clone which can change the contents of the files, changing names, creating files and directories, etc.. The script is run in a VM so it can only do a restricted set of things. See the GitExtraTool.js for the full list of functions available.

git-extra-customize.js

The following objects and methods are available:

| async | Method | Description | | ------- | ------------------------------------ | --------------------------------------------------------------------------- | | | args.projectName | The name of the project (the path.basename() of the directory) | | | args.userName | The name of the currently logged in user | | | ui.log(message) | Display a message to stdout | | async | fs.readFile(fileName) | Read a file from the project | | async | fs.writeFile(fileName) | Write a file to the project | | async | fs.remove(pathName) | Remove a file or directory from the project | | async | fs.move(fromPath, toPath) | Move a file or directory in the project | | async | fs.ensureFile(fileName) | Ensure a file exists in the project, creating it if not | | async | fs.ensureDir(dirName) | Ensure a directory exists in the project, creating it if not | | async | fs.inPlaceUpdate(fileName, array) | In-place-update a file with an array of search/replace strings. See below. | | | path.join(...pathNames) | Join a bunch of path parts | | | path.dirname(pathName) | Get the directory part of a path | | | path.basename(pathName[, extName]) | Get the base part of path with any extension, remove extName if it exists | | | path.extname(pathName) | Get the extension of a path | | async | git.forceAdd(fileName) | Force add a file to the Git repository | | | changeCase.camel(name) | Change the name to "camelCase" | | | changeCase.capital(name) | Change the name to "Capital Case" | | | changeCase.constant(name) | Change the name to "CONSTANT_CASE" | | | changeCase.dot(name) | Change the name to "dot.case" | | | changeCase.header(name) | Change the name to "Header-Case" | | | changeCase.word(name) | Change the name to "word case" | | | changeCase.param(name) | Change the name to "param-case" | | | changeCase.pascal(name) | Change the name to "PascalCase" | | | changeCase.path(name) | Change the name to "path/case" | | | changeCase.sentence(name) | Change the name to "Sentence case" | | | changeCase.snake(name) | Change the name to "snake_case" | | async | ui.prompts(promptArray) | Display array of prompts. See below. | | | ui.log(message) | Display a message to stdout |

ui.prompts(...) takes an array of:

  [
    {
      name: string,
      initial: string, // Optional
      message: string,
      regex: string, // Optional
      error: string, // Optional
    }
  ]

fs.inPlaceUpdate(...) takes an array of arrays of search/replace pairs:

 [
   [/something/, "anotherThing"],
 ]