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

symlink-versions

v0.0.8

Published

Create a new version by symlinking unchanged files, and copying changed files.

Downloads

4

Readme

symbolic-versions

If you have a folder you want to backup and you want all old versions to be available as folders, you can copy files every time you do a backup, or you can make a new folder where everything unchanged is a symlink.

install

Install the normal npm way:

npm install symbolic-versions

use

Specify the place to backup files (must be a created folder) and the folder to scan for changes:

var versioner = require('symbolic-versions')
var options = {
	backupFolder: '/path/to/backup',
	fileFolder: '/path/to/monitored/files'
}
versioner(options, function(err, version) {
	// "version" is the folder created inside the "backupFolder"
})

The function will return a promise, if you want to do that instead:

versioner(options)
	.then(function(version) {
		// "version" is the folder created inside the "backupFolder"
	})
	.catch(function(err) {
		// handle errors
	})

options

There are only the three options:

  • options.backupFolder (required) - The complete path to the location used for backing up files.
  • options.fileFolder (required) - The complete path to the location of the watched files.
  • options.forceVersionWhenEmpty (optional, default false) - Whether a new version should be made if there have been no changes between the watched files and the most recent backup.

what it does

Suppose you have a folder with the files file1.txt and file2.txt. After running the process the first time, you'll have a folder that contains both files.

Next, change the file file1.txt, and after running the process again you'll have a folder that contains the modified file file1.txt, and a symlink file2.txt that links to the first version's folder.

Finally, inside your backup folder you have two version folders, one with two real files, and one with a real file and a symlink to the original file:

backups/
	20150404103453/
		file1.txt # real file
		file2.txt # real file
	20150404103602/
		file1.txt # real file
		file2.txt # symlink -> backups/20150404103453/file2.txt

license

VOL