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

@harryy/react-plyr

v0.0.6

Published

This is a react library for plyr

Downloads

3

Readme

React 18 Component Library with Storybook

This is a sample react component library. Installing it in your project is not very useful. Visit the GitHub project and follow the instuctions below to create your own library.

Installation

Use npm with flag --legacy-peer-deps to install dependencies.

npm install --legacy-peer-deps

❗️ Don't use yarn. It cannot resolve the dependecies correctly in this case.

But Why?

Storybook has a peer dependency to @mdx-js/react that uses react@17. Until the package is updated you have to install it with --legacy-peer-deps

Publish

You can publish the library to GitHub Packages or npm.

GitHub Packages

  1. init git repo (with .gitignore and so on...)
  2. push repo to GitHub
  3. add the following into the package.json
{
  "name": "@YOUR_GITHUB_USERNAME/YOUR_REPOSITORY_NAME",
  "publishConfig": {
    "registry": "https://npm.pkg.github.com/YOUR_GITHUB_USERNAME"
  },
  ...
}
  1. create a personal access token on GitHub (https://github.com/settings/tokens) with permission write:packages
  2. modify your local .npmrc file (https://docs.npmjs.com/cli/v7/configuring-npm/npmrc) as follows
registry=https://registry.npmjs.org/
@YOUR_GITHUB_USERNAME:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=YOUR_AUTH_TOKEN

❗️ Replace YOUR_AUTH_TOKEN with the newly generated GitHub Token, and YOUR_GITHUB_USERNAME with ... your username . Leave the // at the beginning of the last line 6. Run

npm publish

npm

Most of the steps from above are the same...

  1. same
  2. same
  3. add the following into the package.json
{
  "name": "@YOUR_NPM_USERNAME/YOUR_REPOSITORY_NAME",
  "publishConfig": {
    "registry": "https://registry.npmjs.org/",
    "access": "public"
  },
  ...
}
  1. create a personal access token on npm.
  • Click on your profile picture and then "Access Tokens"
  • Click "Generate New Token" and choose "Automation" option to bypass 2FA
  1. modify your local .npmrc file (https://docs.npmjs.com/cli/v7/configuring-npm/npmrc) as follows
registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=YOUR_ACCESS_TOKEN
  1. same

💡 Adding different profiles to your .npmrc file enables you to publish in different scopes e.g. @yourusername/my-package and @yourcompany/my-other-package (https://docs.npmjs.com/creating-and-publishing-scoped-public-packages)

Consume

When you've published the library you can find the package at your GitHub profile page under the Packages tab (e.g. https://github.com/ppulwey?tab=packages) You can install it as you're should be familiar with...

npm install @myusername/package-name

or

yarn add @myusername/package-name

Update the package

When you want to update the package, increase the version number in the package.json file manually or with npm-version (https://docs.npmjs.com/cli/v8/commands/npm-version).

Then run

npm publish