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

dotfiles-sync

v0.0.6

Published

CLI tool to sync your dotfiles based on https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/

Downloads

14

Readme

Dotfiles Sync

Dotfiles Sync is a CLI tool that lets you sync your dotfiles to a git repository.

This utility works as a proxy to implement the workflow described in this blog post, which was originaly the outcome of this Hacker News thread.

To quote the blog post and HN thread, using this particular flow to backup your dotfiles has a lot of advantages:

No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation.

This package does nothing more than follow the setup described above, acting as a Git proxy that allows you to get started with zero configuration.

Installation

$ npm install -g dotfiles-sync

or

$ yarn global add dotfiles-sync

Usage

First time

If you have never used the flow described above, you'll have to start by creating the bare repository for your dotfiles.

$ dotfiles setup

If you wish to push this repository to a remote location in GitHub or Bitbucket, you can pass the repository as an option and it will be automatically linked for you.

$ dotfiles setup [email protected]:[your-user]/dotfiles.git

Running the setup command will take care of the following:

  • Create a bare repository in your $HOME/.dotfiles directory
  • Add a .gitignore file at $HOME with .dotfiles as its content
  • Add the .gitignore file to the repository
  • Configure the repository to not show any untracked files

Once the repository is created, dotfiles can be used as a proxy for the git commands working over tit

$ dotfiles commit -am "Add gitignore" && dotfiles push origin master

Restoring an existing repository

If you've already built a backup and stored it in a remote git repository, this tool can help you bring it into a new machine.

$ dotfiles sync [email protected]:[your-user]/dotfiles.git

This will take care of the following actions

  • Checkout the provided repository as a bare repository in $HOME/.dotfiles
  • Configure it to not show untracked files
  • Backup any files in $HOME that are also part of the remote repository
  • Checkout the contents of your repository to your $HOME directory

At this point, you can continue adding new stuff into your dotfiles repository by using the dotfiles command.

$ dotfiles add .bashrc

Other implementations

Nicola Paolucci posted a shell version of this in his blog post. This is simply a rewrite using Node for distribution purposes.

Important Note about SSH Keys

These are a bit hard to deal with as if they it they are needed to pull a repository. When you run dotfiles sync, a git repository is needed. To be able to clone the repository, you will need to have valid SSH keys (~/.ssh). However, if the repository contains the .ssh directory in it, dotfiles will attempt to back it up before checking out the repository content, and then fail at checking out because no SSH keys are present. There are ways to work around this, however, I still do not advise to backup your SSH keys with dotfiles as these are generally considered sensitive information.

Special Thanks

To Nicola Paolucci for an amazingly well written blog post and to StreakyCobra for the original idea