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

@alexlafroscia/dotty

v2.0.0

Published

Programmatically configure your development environment

Downloads

8

Readme

dotty Build Status

A tool for declaratively managing your command line tools and configuration

The Problem

I had a few computers that I do development work on, and it was a annoying to keep them in sync. I wanted a way to script installing and configuring my tools, but lacked tooling in pure shell scripting with the level of polish I desired. I knew I could build the tool I wanted using Node.js, so... here's dotty!

Installation

On a system that already has Node installed, you can grab dotty as an NPM package from @alexlafroscia/dotty. If you're setting it up on a new machine, a pkg-built binary can be found on the Releases tab.

Usage

Defining tasks

A dotty task looks something like this:

// tasks/brew.js
module.exports = function(Task) {
  return class Homebrew extends Task {
    constructor() {
      super();

      // Set the name of the program being installed
      this.programName = 'brew';
    }

    /**
     * Check if the program needs to be installed
     */
    checkInstallation() {
      return this.which('brew');
    }

    /**
     * Install the program
     */
    install() {
      return this.exec(
        '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"'
      );
    }
  };
};

Check out the example-tasks directory for more examples that show off the full set of hooks available. The Task source code has additional information on the available hooks and how they interact with each other.

Running tasks

You can invoke dotty like so:

dotty path/to/tasks/directory

I recommend keeping your tasks in a location where they can easily be synchronized between all of your machines, such as a dotfiles repo, iCloud or Dropbox. For example, on my machine, synchronizing a new machine looks like:

dotty $DOTFILES/tasks

since $DOTFILES is aliased to my dotfiles directory.