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

generator-vercel-shortener

v1.0.2

Published

Generator to create your own personal url shortener to deploy to Vercel.

Downloads

4

Readme

generator-vercel-shortener

Generator to create your own personal url shortener to deploy to Vercel (formerly Zeit Now).

version downloads GitHub Workflow Status MIT License PRs Welcome Semantic Release Commitizen friendly

Getting Started

These aren't prerequisites but before you're able to actually deploy your url shortener you should:

  1. Create a Vercel account.
  2. Set up Vercel GitHub Integration. This way Vercel deploys automatically for you.
  3. Buy, migrate or simply point a domain you already own to Vercel's dns.

You don't technically need to have a domain. By default your new project in Vercel will be deployed with a domain like https://my-url-shortener.now.sh, and your redirects will work just fine. However part of the glory of url shorteners is that they create short urls that are easy to type and remember!

Installation

npm install -g yo generator-vercel-shortener

Usage

yo vercel-shortener

By default it will look to generate in your current working directory. If that's not what you want, then specify the directory in the call or create a new directory to run the generator in.

yo vercel-shortener [<project-directory>]

or...

mkdir <project-directory>
cd <project-directory>
yo vercel-shortener

After you generate

Next steps after generating:

  1. Create a repository for your url shortener, https://github.com/new.
  2. Run git remote add origin <repo_url>.
  3. Run git push origin master.
  4. Run git branch -u origin/master.
  5. Run vercel to setup & deploy your project to Vercel.
  6. Add redirects:
    • Run shorten <destination> [<source>]. The generator will expose a globally available script for you. Run this from anywhere in your terminal. See vercel-redirects for the full cli documentation.
    • Run npm run shorten <destination> [<source>] from the root of the project.
    • Add them in vercel.json manually. You'll need to commit and push them yourself.

For example:

shorten https://gist.github.com/codfish/91ef26f3a56a5c5ca0912aa8c0c5c020 /linting

And in about ~5 seconds I can hit codfi.sh/linting and it will redirect for me.

Related Projects

  • codfi.sh - My own personal url shortener, using the same configuration as a project built with this generator.
  • vercel-redirects - Command-line utility to manage your Vercel project redirects.
  • netlify-shortener - Your own free URL shortener with Netlify (different serverless platform).