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

url-to-deep-link

v1.0.7

Published

Transform URLs to Deep Links and open your users apps

Downloads

926

Readme

url-to-deep-link

Build Status

Transform URLs to Deep Links and open your users apps

Why ?

Deep links are a very powerful feature of Android and iOS devices that allows creators to point their users to the content with the best experience possible.

Looking for a way to redirect users throught a basic <a> html link tag, I found out that no library does the conversion from a URL to a deep link. There was an attempt 4 years ago that wasn't still what I was looking for and another one more recent but that works using a Node server and still doesn't exactly do what I was looking for: just transform URLs to deep links.

Following on with the research some services like Branch.io and Url Geni exist but they are premium. Branch is hard to try because you need to request a demo, which I asked for but I haven't got any answer back yet. On the other hand Url Geni gives you a quick way to see it working in their home page and later on with a subscription you are able to generate URLs dinamically using their API.

Since universal links are still not a standard nor all the apps support them nor all version of Android and iOS support them, I decided to create this library.

url-to-deep-link is a simple hardcoded solutions that translates URLs to their deep link version in order to open your users apps.

Install

npm install --save url-to-deep-link

Usage

// ES5 require syntax also works
// var getAndroidDeepLink = require("url-to-deep-link").getAndroidDeepLink;
import { getAndroidDeepLink, getIOSDeepLink } from "url-to-deep-link";

const yourAndroidDeepLink = getAndroindDeepLink("YOUR URL");
const yourIOSDeepLink = getIOSDeepLink("YOUR URL");

At this moment the following transformations are available (any other option will return undefined):

Facebook

  • Page: https://www.facebook.com/YOUR_PAGE_ID

You can get your id here.

Instagram

  • Profile: https://www.instagram.com/YOUR_USERNAME

  • Post (ONLY ANDROID): https://www.instagram.com/p/YOUR_POST_ID

Twitter

  • Profile: https://www.twitter.com/YOUR_USERNAME

  • Tweet: https://twitter.com/YOUR_USERNAME/status/YOUR_TWEET_ID

Notes

Facebook URL transformation by page name instead of ID and Instagram's post URL on iOS are not suported because they require an asynchronous call in order to get the ID of the page/post. In ./lib/apps/facebook.js you can find an async version commented working fine although Facebook apps are currently a mess and there is no way to get an API access token.

Test

npm run test

Build (webpack)

npm run build

License

MIT