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

@d4nyll/git-tt

v0.1.3

Published

Super Easy™ time-travelling in Git

Downloads

5

Readme

git tt

git tt (short for time travel) is a Git extension that makes it super easy™ for you to commit in the future or the past!

$ git tt -m "Commit in the past" --date "2 weeks ago"
$ git tt -m "Commit in the future" --date "3 hours from now"

Installation

git tt is written in Node.js, and so you should have Node.js installed on your system. If you do not, I'd recommend installing nvm and then use it to install the latest version of Node.js.

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
$ source ~/.bashrc
$ nvm install node

After Node.js is installed, install git tt globally it using npm.

$ npm install --global @d4nyll/git-tt

Usage

git tt works in the exact same way as git commit, apart from the --date option, which differs in the following ways:

  • Committer date - In git commit, the --date option allows you to specify the author date, whilst with git tt, the --date specifies both the author date and committer date.
  • Natural langauge processing (NLP) - git tt uses chrono to parse --date, which means you can use date strings like "yesterday at 20:43" or "30 minutes from now", as well as the usual RFC 2822, ISO 8601, RFC 3339, and other common formats
  • Aliased - -d has been added as an alias to --date

Examples

$ git tt -m "Commit in the present" # Same as `git commit`
$ git tt -m "Commit in the past" --date "Thu Oct 18 2016 00:01:27 GMT+0100 (British Summer Time)"
$ git tt -m "Commit in the future" -d "2022-05-13T23:57:37.566Z"
$ git tt -m "Using relative time " -d "three weeks from now"

Note on timezone - git tt uses your machine's local timezone (the same behavior as git commit). When time-travelling, git tt will use the timezone that would apply at the time you're travelling to. (Basically, you don't need to care about timezones)

Development

To develop git tt, make sure you have Node.js and the yarn package manager installed. Please use yarn as the primary lock file we use is yarn.lock.

Next, clone the repository.

$ cd ~/projects
$ git clone [email protected]:d4nyll/git-tt.git

Then, every line of relevant code is defined in cli.js.

Testing

I did not follow test-driven development (TDD) because I was initially just playing around, and was unsure about the interface that git tt should expose. I will continue to use git tt in my every day workflow to make sure it's user-friendly, fix any bugs, and once I am happy, the plan is to revisit this and write the unit tests.

To test it manually, run npm link, which will make the git tt command available on your shell. Once you've finished testing, run npm unlink to reset it.

Roadmap

If this tool becomes more popular, or if you'd like to contribute to new features, here are some of the features I have in mind (in order of importance):

  • Add fuzziness to the dates - if the user specifies a --fuzzy flag, add a few seconds/minutes in a random fashion so the dates are not so 'precise'. E.g. instead of Thu Oct 25 12:00:00 2018 +0100, make it Thu Oct 25 12:03:56 2018 +0100
  • Make error output more user-friendly, perhaps using chalk
  • Explore packaging project into stand-alone executable using pkg
  • Allow users to retrospectively modify the author and committer date of a commit