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

vanilla-sharing

v6.1.2

Published

Small (1.6 KB) simple tool for sharing url, title, description and image to VK, Facebook (Feed, Dialog, Button, Messenger), Twitter, Reddit, Pinterest, Tumblr, G+, VK, OK, Mail.ru, LinkedIn, Whatsapp, Viber, Telegram, Line.

Downloads

11,429

Readme

vanilla-sharing

Small (1.5 KB) simple tool for sharing url, title, description and image to VK, Facebook (Feed, Dialog, Button, Messenger), Twitter, Reddit, Pinterest, Tumblr, VK, OK, Mail.ru, LinkedIn, Whatsapp, Viber, Telegram, Line.

DEMO

Build Status bundlephobia Coverage Status npm npm

Motivation

Adding sharings to a project is digging in the documentation of the corresponding social networks. With this set of small functions, we have already done everything for you. Just take them and use!

Installation

From NPM

npm install --save vanilla-sharing

From unpkg CDN (you can use other)

<script src="https://unpkg.com/vanilla-sharing"></script>

Usage

From NPM

import { fbButton } from 'vanilla-sharing';

fbButton({
  url: 'https://alexey-avdeev.com/vanilla-sharing/',
});

From CDN

VanillaSharing.fbButton({
  url: 'https://alexey-avdeev.com/vanilla-sharing/',
});

API

fbFeed(options)

Share on facebook.com via the Feed dialog

Documentation: https://developers.facebook.com/docs/sharing/reference/feed-dialog

fbFeed({
  url: string,
  redirectUri: string,
  fbAppId: string,
})

You can use getFbFeedUrl(options) for getting URL.

fbShare(options)

Share on facebook.com via the Share dialog

Documentation: https://developers.facebook.com/docs/sharing/reference/share-dialog

fbShare({
  url: string,
  redirectUri: string,
  hashtag: string,
  fbAppId: string,
  quote: string,
})

You can use getFbShareUrl(options) for getting URL.

fbButton(options)

Share on facebook.com using facebook share button

fbButton({
  url: string,
})

You can use getFbButtonUrl(options) for getting URL.

messenger(options)

Share via Facebook Messenger

Share method from Sharing for Messenger.

messenger({
  url: string,
  fbAppId: string,
})

tw(options)

Share on Twitter

tw({
  url: string,
  title: string,
  hashtags: array,
})

You can use getTwUrl(options) for getting URL.

reddit(options)

Share on Reddit

reddit({
  url: string,
  title: string,
})

pinterest(options)

Share on Pinterest

pinterest({
  url: string,
  description: string,
  media: image url string,
})

tumblr(options)

Share on Tumblr

tumblr({
  url: string,
  title: string,
  caption: string,
  tags: array,
})

vk(options)

Share on vk.com

vk({
  url: string,
  title: string,
  description: string,
  image: string,
  isVkParse: boolean,
})

You can use getVkUrl(options) for getting URL.

ok(options)

Share on ok.ru

Like/Share button

ok({
  url: string,
  title: string,
  image: string,
})

You can use getOkUrl(options) for getting URL.

mail(options)

Share on Mail.ru

mail({
  url: string,
  title: string,
  description: string,
  image: string,
})

email(options)

Share via user's email

email({
  to: string,
  url: string,
  title: string,
  description: string,
  subject: string,
})

You can use getEmailUrl(options) for getting URL.

linkedin(options)

Share on LinkedIn

Share method from Share on LinkedIn.

linkedin({
  url: string,
  title: string,
  description: string,
})

whatsapp(options)

Share via Whatsapp

WhatsApp FAQ - Using Click to Chat.

whatsapp({
  url: string,
  title: string,
  phone: string,
})

You can use getWhatsappUrl(options) for getting URL.

viber(options)

Share via Viber

Viber Share Button docs.

viber({
  url: string,
  title: string,
})

You can use getViberUrl(options) for getting URL.

telegram(options)

Share via Telegram

telegram({
  url: string,
  title: string,
})

You can use getTelegramUrl(options) for getting URL.

line(options)

Share via Line

line({
  url: string,
  title: string,
})