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

drone-ver

v1.1.0

Published

Drone Versioning made easy, but not more sensible.

Downloads

3

Readme

Drone-Ver

A Node module and CLI for generating versions according to the Drone-Ver specification (a.k.a. the best way to version something).

If you have not read the drone-ver specification yet, why not? It's required reading for this module. Go and read it now. Do not pass Go. Do not use Go. Do not collect $200.

...

...

OK, all caught up now? Excellent, let us proceed.

Usage

The simplest way to use drone-ver is via the command line.

npm install -g drone-ver

cd /path/to/your/node/project
drone-ver

This will ask you some important questions to generate a valid Drone Version, then optionally save it to your package.json under the "droneVersion" key. It will also query GitHub for some of the data so, um, make sure you have a network connection, I guess?

Example screenshot of using drone-ver on the command line

Node module

For more control over the version, you can include Drone-Ver as a dependency.

npm install --save-dev drone-ver

Include it like any other module.

var droneVer = require('drone-ver');

create()

Create a new Drone Version with your own data.

var version = droneVer.create({
    major: 3,
    mood: 'whimsical',
    issues: 183,
    social: 5,
    dictionary: 'random',
    unixtime: Math.floor(Date.now() / 1000)
});

All data properties are optional. You're not allowed to specify the last part of the version — it is always 7.

The return value is an object with data properties for the parts of the version. But you're probably just going to want the full version string.

version.major;  // 3
version.mood;   // 'whimsical'
version.seven;  // 7

version.toString();  // '3.whimsical.183.5.random.1446168078.7'

parse(versionString)

Parse a Drone Version string into an object with its component parts (as returned by .create()).

var version = droneVer.parse('3.whimsical.183.5.random.1446168078.7');

version.mood;    // 'whimsical'
version.issues;  // 183

It will rightly complain if you try to give it a so-called "semantic" version.

var version = droneVer.parse('2.1.5');
// TypeError: Woah, that version looks a bit too sensible to me

compare(version1, version2, options)

Compares two Drone Versions (either strings or objects). Return value:

  • -1 if version1 is lower than version2
  • 0 if the versions are equal
  • 1 if version1 is higher than version2

Comparison is done on the unixtime portion of the version, as defined by point 7 of the specification. If you want the MORE EXCITING comparison, pass {moreExciting: true} as the options parameter, and it will compare the versions based on their dictionary portions.

var version1 = '1.sleepy.0.0.calamitous.1437363538.7';
var version2 = '2.joyous.0.0.armadillo.1446532221.7';

droneVer.compare(version1, version2);  // -1
droneVer.compare(version1, version2, {moreExciting: true});  // 1

IAQ (Infrequently Asked Questions)

Why would you use Drone Versioning for a project?

Pfft, why wouldn't you?

This is a joke, right?

You are within a labyrinth. At the exit gate are two guards. One always answers "yes" and the other always answers "no". You must choose which one to believe.

Alternatively, go find an ice cream to eat, or something. Sorry, what was the question again?

Credits

Thanks to Curtis Lassam for writing Cube Drone and the original Drone-Ver.

Oh, and for Horse Drawing Tycoon.