Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@beefchimi/socialite
Advanced tools
Socialite
is a quick and easy way to parse a url: string
to determine:
user
handle is.prefix
is (if relevant).The minimum criteria for parsing a url
is:
Simply install via the command-line or include in your package.json
, just like any other dependency.
# Alternatively install with `yarn` or `pnpm`
npm install @beefchimi/socialite
By default, Socialite
includes only a small collection of the most common social networks. A typical use case looks like:
import {Socialite} from '@beefchimi/socialite';
const socialiteInstance = new Socialite();
const mySocialUrl = 'https://www.twitter.com/@SomeFakeUserHandle';
const parsedSocialUrl = socialiteInstance.parseProfile(mySocialUrl);
console.log(parsedSocialUrl);
The above will log the following SocialProfile
(object) to the console:
{
id: 'twitter',
prefix: '@',
user: 'SomeFakeUserHandle',
originalUrl: 'https://www.twitter.com/@SomeFakeUserHandle',
preferredUrl: 'https://twitter.com/@SomeFakeUserHandle',
appUrl: 'https://mobile.twitter.com/@SomeFakeUserHandle',
urlGroups: {
scheme: 'https://',
subdomain: 'www.',
domain: 'twitter',
tldomain: '.com',
path: '/@SomeFakeUserHandle',
// Other url parts are omitted if `undefined`
},
}
For a more robust collection of social networks, you can import and pass in allSocialNetworks
:
import {Socialite, allSocialNetworks} from '@beefchimi/socialite';
const socialiteInstance = new Socialite(allSocialNetworks);
console.log(socialiteInstance.getNetworks());
// Logs to the console all social networks included in the code base.
...this section is incomplete... check back later for API documentation.
FAQs
Social network URL parsing for aristocrats
We found that @beefchimi/socialite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.