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

atlas-git-identity

v1.0.4

Published

A CLI tool which sets a git repository's author based on package.json or arguments.

Downloads

15

Readme

atlas-git-identity

A CLI tool which sets a git repository's author based on package.json or arguments.

Travis


install

npm install -g atlas-git-identity

Note: make sure you install this globally (-g) unless you're using the API for a local project.

why

There are few things that are more annoying than Gravatar leaking your identity to nearly everything you touch with your e-hands. Similarly with git, you might be surprised when you look back on some of your commits and realize they've been authored under your real name. Some people don't care, but this really bothers me as my real name is so common, it makes everything I do much less interesting.

Do yourself a favor and run:

git config --global user.useConfigOnly true

After running this, your machine will force you to set a local identity on all of your git projects. At least for me, this extra configuration work when I start a new project is well worth the peace of mind (i.e. my privacy). This CLI tool aims to eliminate the extra work I put on myself.

examples

cli tool

After installing this package, the command below will automatically set your git identity for the current project based on your package.json's "author" field:

git-identity

If you don't have this field, you can also specify your name and email as arguments:

git-identity atlassubbed [email protected]

api

You can also do all of the above programmatically:

const { parseAuthor, setIdentity } = require("atlas-git-identity");

const stringAuthor = "atlassubbed <[email protected]>"
const author = parseAuthor(stringAuthor)
setIdentity(author, process.cwd(), err => {
  if (!err) console.log("success!")
})

We can directly set whichever of the git config "user" fields we want:

...
setIdentity({name:"atlassubbed"}, err => {
  if (!err) console.log("success!")
})

We can set any number of the git config "user" fields:

setIdentity({name: "atlassubbed", signingkey: "123"}, err => {
  if (!err) console.log("success!")
})

caveats

At first, this package automatically ran git config --global user.useConfigOnly true to remove that step as well, however it's a bad idea because it may not be desired on some machines. Furthermore, the step only needs to be run once and is entirely optional, so it's not a problem. Please run this command separately if you would like to force a local identity on your git projects.