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

rev-tree

v1.0.0

Published

Reliable filename revisioning

Downloads

3

Readme

Rev-Tree

Reliable filename revisioning

Rev-Tree revisions filenames using a hash of the entire source tree, this approach simplifies reference updating which only needs to match filenames. Usually filename revisioning applies a hash of each file to itself, this approach greatly complicates reference updating with matching full file paths.

A per file hash requires full path matching for file differentiation and revision propagation. This is burdened by language specific path normalisation and dynamically built paths, solutions are always incomplete and highly error prone. These problems are avoided when all files use the same revision hash.

Install

npm install --save rev-tree

Caveats

From a browser caching perspective, Rev-Tree is like dropping a nuke on a tree instead of firing an arrow at a branch. It's 100% reliable, but the browser will need to get a whole new tree instead of growing a few new branches.

Language agnostic, filename based reference updating increases the probability of false positives. Be mindful of very short names and what effect matching unrelated code might have. Extension-less names are particularly dangerous.

Usage

Basic usage with Gulp:

const gulp = require('gulp');
const revTree = require('rev-tree');

gulp.task('Revision', () => gulp.src('src/**/*')
	.pipe(revTree({
		dontRemap: /index[.]html/
	}))
	.pipe(gulp.dest('dist'));
);

Basic usage with Gurt:

const revTree = require('rev-tree');

module.exports['Revision'] = (stream) => stream
	.pipe(revTree({
		dontRemap: /index[.]html/
	}));

API

revTree([options])

options.hashLabel

Type: String, RegExp

Replace matching strings with hash. (Add a hash label to your content).

options.hashVerbosity

Type: Number

Specify level of hash detail. The hash is derived from git describe: [ last-tag, commits-since, commit-hash, dirty? ]

options.dateLabel

Type: String, RegExp

Replace matching strings with date. (Add a date label to your content).

options.dateVerbosity

Type: Number

Specify level of date detail. The date is derived from git commit: [ commit-date, commit-time, commit-time offset ]

options.dontTouch

Type: String, RegExp

Exclude matching paths (pass through untouched).

options.dontRemap

Type: String, RegExp

Exclude matching paths from being renamed.

options.dontParse

Type: String, RegExp

Exclude matching paths from being searched.

Contribute

Suggestions and contributions will be considered. When crafting a pull request please consider if your contribution is a good fit with the project, follow contribution best practices and use the github "flow" workflow.

License

The MIT License