Social media sharing utility for web developers. Simple. Fast. Plug and play.
npm install super-share
<script src="https://cdn.jsdelivr.net/npm/super-share/dist/index.min.js"></script>
This adds SuperShare
to window
.
const SuperShare = require('super-share');
const share = new SuperShare({
url: 'https://example.com',
text: 'Check this out!',
hashtags: 'javascript,webdev'
});
<script src="https://cdn.jsdelivr.net/npm/super-share/dist/index.min.js"></script>
<script>
const share = new SuperShare({
url: 'https://example.com',
text: 'Check this out!',
hashtags: 'webdev,javascript'
});
share.attachShareHandlers(); // Optional
</script>
Returns a platform-specific share URL.
const twitterUrl = share.getShareUrl('twitter');
Returns all available share URLs as an object.
const urls = share.getAllShareUrls();
console.log(urls.facebook);
Automatically binds click handlers to all elements with
data-share
attribute. Accepts no arguments.
// Binds to [data-share] elements
share.attachShareHandlers();
Scan & donate via UPI:
pareekaman1@ybl
Even small contributions make a big difference 💖
MIT