1.0.1 • Published 5 years ago

@toptal/social-urls v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Social URLs Builder

Do you need to share a page on Facebook or other social network? Are you tired to manually construct URLs like http://www.facebook.com/sharer.php?u=toptal.com over and over again for each new project? 😫

This 📦 is for you!

$ npm install @toptal/social-urls

Show me the code!

const { getShareUrl, NETWORKS } = require('@toptal/social-urls');

// https://www.facebook.com/sharer.php?u=https%3A%2F%2Ftoptal.com%2Fmergewords&t=Merge%20words%2C%20fast%20and%20easy.
const facebookUrl = getShareUrl(NETWORKS.FACEBOOK, {
  url: 'https://toptal.com/mergewords',
  title: 'Merge words, fast and easy.'
});

Supported Social Networks

enum NETWORKS {
  FACEBOOK,
  LINKEDIN,
  TWITTER,
  POCKET
}
1.0.1

5 years ago

1.0.0

5 years ago