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

deshortify

v1.0.4

Published

Turns short URLs into long, meaningful, crap-less URLs.

Downloads

84

Readme

Deshortify

NodeJS module which turns short URLs into long, meaningful, crap-less URLs

Features

Deshortify will:

  • Follow URLs, performing HTTP HEAD requests.
  • Get rid of useless URL parameters.
  • Roll back a URL redirect when it looks like a paywall or similar.

For example, it will turn http://bit.ly/2qzPrcN into http://www.liberation.fr/direct/element/une-elue-du-personnel-de-whirlpool-candidate-suppleante-pour-en-marche_63786/?utm_campaign=Echobox&utm_medium=Social&utm_source=Twitter#link_time=1494593774, and then into http://www.liberation.fr/direct/element/une-elue-du-personnel-de-whirlpool-candidate-suppleante-pour-en-marche_63786/#link_time=1494593774.

Deshortify will keep a cache of resolved URLs, so that known ones are not re-requested on the network.

Why

Because I don't like short URLs. They don't convey information.

Because I don't like URLs with spammy URL parameters that take up space in my screen.

Because I feel that the existing de-shortening libraries for NodeJS (like unshort, or url-unshort) are lacking.

Usage

In NodeJS:

// Import the library
import Deshortifier from 'deshortify'

// Create an instance
let deshortifier = new Deshortifier({ verbose: true });

// Call deshortify(), which returns a Promise for a URL.
deshortifier.deshortify('https://t.co/p0N0Zl8rx6').then(u=>console.log('Final URL is ' + u));

As a CLI tool:

$ npm install -g deshortify
$ deshortify https://t.co/wy9S5P0Cd2

Using deshortify as a CLI tool, use the -v flag to go verbose. This will display all the followed URLs, the cleanup performed, and the rollback (if any):

$ deshortify -v http://t.co/D01g3QPL7G
follow:  http://t.co/D01g3QPL7G  →  https://t.co/D01g3QPL7G
follow:  https://t.co/D01g3QPL7G  →  http://bit.ly/2F6pXtg
follow:  http://bit.ly/2F6pXtg  →  https://mydata2019.org/press-release-finland-leads-europe-towards-a-fair-data-economy/
https://mydata2019.org/press-release-finland-leads-europe-towards-a-fair-data-economy/