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

svelte--gif

v2.0.0

Published

Tenor GIF components, implemented in Svelte.

Downloads

2

Readme

svelte-tenor

Tenor GIF components, implemented in Svelte.

package version downloads per week npm bundle size

A lot of cat GIFs

Try svelte-tenor

Try svelte-tenor here!

The all-in-one GIF keyboard

Install svelte-tenor with your favorite package manager:

npm install svelte-tenor
# or
yarn add svelte-tenor

Use the MobileKeyboard component:

<script>
  import { MobileKeyboard, Gif } from 'svelte-tenor'

  let gif
</script>

<MobileKeyboard
  key="Get a key for free here: https://tenor.com/developer/keyregistration"
  on:click={({ detail }) => {
    gif = detail
  }}
/>

{#if gif !== undefined}
  <p><Gif {gif} /></p>
  <pre>{JSON.stringify(gif, null, 2)}</pre>
{/if}

imageOpen this example in your browser

Component list

If you want to build your own GIF keyboard, svelte-tenor contains a lot of components.

Autocomplete: offers to finish your sentence Autocomplete example

Categories: Tenor GIF categories GIF categories: dance, annoyed, omg...

Search: asks Tenor for matching GIFs Searching cat GIFs

And more! Try all available components: https://gauben.github.io/svelte-tenor/storybook/

Build your own keyboard

While MobileKeyboard might be enough for prototyping, you probably want to create a GIF keyboard with more features and a better design. To help you do so, svelte-tenor contains a handful of composable components.

If you don't know how or where to begin, you may read the source code of MobileKeyboard.

Typed API

All the components above use Tenor API. The API client implementation is written in TypeScript and fully typed. You can use it as follows:

import { search } from 'svelte-tenor/api'

console.log(await search({ key: 'LIVDSRZULELA', q: 'hello' }))

Open this example in your browser

The API runs smoothly in the browser and deno, but requires a workaround in node:

// https://www.npmjs.com/package/node-fetch
import fetch from 'node-fetch'
Object.defineProperties(globalThis, {
  fetch: { enumerable: true, configurable: true, value: fetch },
})

Please note that the API implemented does not completely follow Tenor's documentation. If you want a faithful API implementation, use svelte-tenor/raw-api instead.

How to contribute?

Install Node and Yarn with Volta. Once you've cloned the project and installed dependencies with yarn install, start a development server:

# Start Storybook
yarn storybook

# Format code with prettier
yarn format

# Run code quality checks
yarn check

# Commit your changes!
git commit -a

If everything works, please open a pull request with your changes and a short description. Thanks for considering contributing!

License

MIT