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

share-twitter

v1.0.0

Published

Create a Twitter share url with ease

Downloads

7

Readme

share-twitter

Create a Twitter share url with ease

Install

$ yarn add share-twitter

Usage

const shareTwitter = require('share-twitter')

shareTwitter({
  text: 'Check this library to help you create share twitter url',
  url: 'https://github.com/bukinoshita/share-twitter',
})
// https://twitter.com/intent/tweet?text=Check%20this%20library%20to%20help%20you%20create%20share%20twitter%20url&url=https://github.com/bukinoshita/share-twitter

When add the url to a <a/> tag it should work like this

Examples

Check the examples

API

shareTwitter([options])

Returns a string

text

Type: string Example: Hello%20World

Pre-populated UTF-8 and URL-encoded Tweet text. The passed text will appear pre-selected for a Twitter user to delete or edit before posting. The length of your passed Tweet text should not exceed 140 characters when combined with any passed hashtags, via, or url parameters. Passed Tweet text which causes the Tweet to exceed 140 characters in length will require additional editing by a Twitter user before he or she can successfully post.

url

Type: string Example: https://bukinoshita.io

A fully-qualified URL with a HTTP or HTTPS scheme, URL-encoded. The provided URL will be shortened by Twitter’s t.co to the number of characters specified by short_url_length.

hashtags

Type: string Example: nature,sunset

Allow easy discovery of Tweets by topic by including a comma-separated list of hashtag values without the preceding # character.

via

Type: string Example: bukinoshita

A Twitter username to associate with the Tweet, such as your site’s Twitter account. The provided username will be appended to the end of the Tweet with the text “via @username”. A logged-out Twitter user will be encouraged to sign-in or join Twitter to engage with the via account’s Tweets. The account may be suggested as an account to follow after the user posts a Tweet.

related

Type: string Example: javascript

Suggest additional Twitter usernames related to the Tweet as comma-separated values. Twitter may suggest these accounts to follow after the user posts their Tweet. You may provide a brief description of how the account relates to the Tweet with a URL-encoded comma and text after the username.

replyTo

Type: string Example: 525001166233403393

The Tweet ID of a parent Tweet in a conversation, such as the initial Tweet from your site or author account.

Related

License

MIT © Bu Kinoshita