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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@athill/computer-refresh

v0.1.8

Published

Back up your computer files via configuration

Readme

computer-refresh

Status: Work in progress - not ready for production. Restore functionality has not yet been implemented.

computer-refresh is a JavaScript library to automate and document backing up and restoring your files from one computer to another.

  • Declarative Configuration: The backups are defined in a yaml configuration file that documents the files you are backing up.
  • Deep Copies: The directory structure of the source files is copied so common file names do not clobber each other and context is not lost.
  • Flexible: Succinct syntax to copy virtually anything to anywhere.

Installation

$ npm i -S computer-refresh

Usage

The idea is to document that which can be automated when moving from computer to computer, so my intended usage is to create a personal repository (e.g, laptop-backup) with this installed where the README is composed of sets of instructions for the backup and restore processes that this script doesn't help automate (e.g., install nodejs on the target computer). The hope is that between the configuration file and the instructions, my backup/restore process is documented and partially automated.

To use run it in another program:

const { cli } = require('@athill/computer-refresh');


// run computer-refresh
cli();

To run from the command line in this project

$ ./bin/run COMMAND CONFIGFILE

Where COMMAND is either backup or restore and CONFIGFILE is a YAML file formatted as described below.

Both commands can take a --verbose|-v argument to provide more output

restore only restores the mappings. The other sections do not make sense for a restore

backup can restrict what gets backed up with --app-config|-a, --mappings|-m, and --listings|-l flags. Providing either no or all of these flags will run all sections; otherwise only the sections indicated by the flags will run.

Configuration

Some example configuration will probably help

# common is a backup configuration
common:
  # Everything will be copies/output here
  destination: ~/cloud-provider/computer-refresh
  # Write directory lists to file. Can be helpful in auditing installed applications, etc.
  listings:
    applications: /Applications
    code: ~/Code  
  # Copy entire directories or limit by name
  mappings:
    - from: ~
      to: home
      files:
        - .git-completion.bash 
        // ...
    - from: ~/Documents/recipes
      to: recipes
# secure is another backup configuration      
secure:
  destination: ~/secure-computer-refresh
  mappings:
    - from: ~/.m2
      to: home/.m2
      pattern: '*.xml'      
    // ...
  # This will recursively go through the directory and only copy designated files, maintaining the directory structure  
  app-config: 
    from: ~/Code
    to: app-config
    files:
      include: 
        - .env
    directories:
      exclude:
        - node_modules
      include:    
        - .idea

In this example, I'm backing up secure files to my desktop and non-secure (common) files to a cloud provider. The top-level labels are arbitrary. Each label has at least destination and mappings keys.

destination is the root directory to back up files (will be created if it does not exist).

Symbolic links encountered are documented in <destination>/links.sh

listings dumps a top-level directory list into <label>.txt, so in the example, applications.txt would contain a listing of the /Applications directory.

mappings works as follows:

  1. If there is only a from and a to entry, it will cp -rf $from/* $destination/$to. Note that it does not copy the directory itself, but copies into the to directory. The to directory structure will be created if it does not exist.
  2. If there is a pattern argument, it will be appended to the copy source in place of the asterisk cp -rf $from/*.xml $destination/$to, for example.
  3. If there is a files key, it will recursively copy each entry. If there is a nested entry (e.g., foo/bar), the bar directory will be ensured to exist before copying bar.

app-config is intended to pluck files not in source control from programming projects (e.g., .env, .idea). The keys are as follows:

  1. from - Root of code directory
  2. to - Where to back up the files ($destination/$to)
  3. files - Only has an include key for files to include (e.g., .env)
  4. directories - Has a key for directories to include (e.g., .idea) and exclude, meaning not to traverse (e.g., node_modules`)