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

surl-cli

v2.0.4

Published

URL shortener CLI

Downloads

15

Readme

surl-cli    npm Build Status Known Vulnerabilities Github issues

CLI for shortening URL with Firebase, Bitly, Goo.gl API.

No more distraction from leaving to a web page just to create a short URL. surl is a CLI tool for shortening URL and retrieving URL's usage statistics from many API providers, including but not limited to Bitly, Firebase, and Goo.gl. The key advantage of Firebase API allows you to create links for Android and iOS apps in addition to web platform.

Install

$ npm install surl-cli -g

Usage

Init

Before start using surl, initialize configuration with surl init to select a default API provider. You must save at least one API key/token to surl from one of the three API providers (Bitly, Firebase, Goo.gl). While you can choose to store every API keys/tokens from all three service providers, surl only allows the default provider to be used at one time.

  • Follow the guide to go to Bitly's API page to receive your API key/token.
  • Follow the guide to go to Firebase (FDB)'s API page to receive your API key/token.
  • To comply with Google's policy on sunsetting goo.gl service on May 2019, we recommend users not to use URL shortening service from goo.gl. However, existing users of goo.gl can still receive their API keys/tokens at console until May 2019, while no new users are allowed to register with the service.
$ surl init
=> select your API provider (Bitly, Firebase, Google)
=> provide your API key/token

Config

Update your API key/token and change the default API provider after surl init

$ surl config

Shorten URL

$ surl www.example.com/test/test
=> success! https://goo.gl copied to clipboard

Expand URL

$ surl --reverse goo.gl   (or)   surl -r goo.gl
=> success! expanded url copied to clipboard

Stats

Fetch shortened URL's meta data and usage statistics, available only if the chosen provider has such feature.

$ surl --stats goo.gl
=> shortUrl: goo.gl
   origin: www.example.com/test/test
   created: 2009 11 12
   clicks:
       PERIOD   SHORTURL  LONGURL      COUNTRIES DATA
       allTime  30        40           Canada       5
       month    0         0            Australia    2
       week     0         0
       day      0         0
       twoHours 0         0

Help

Should you have any doubt, refer to help page.

$ surl --help

Tests

To run unit tests and API tests, run npm test.

Contributing

Development of surl now focuses on transforming URLs. Any other suggestions are welcomed, but will have to wait until the next major release. For more details, please refer to Contribution.

FAQ

  1. Why is ow.ly not included in the CLI?

    Access to ow.ly API is restricted to the enterprise users of its parent company, Hootsuite. At this point, I don't see many paid users of Hootsuite requesting this feature. You can still use ow.ly service on Hootsuite's website though.

License

MIT License | Copyright (c) 2018 Hank Chan