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

@ircam/sc-components

v3.1.1

Published

Web Component library for audio applications

Downloads

384

Readme

sc-components

npm version

sc-components logo

Simple and robust Web Component library for audio and creative applications in the browser.

banner

The library is built with lit.

Demo and Documentation

http://ircam-ismm.github.io/sc-components/

Goal & Philosophy

This is a rather opinionated library, that primarily aims at providing practical and robust interfaces for practitionners in working and performance situations. Hence, it proposes different interaction modalities such as keyboard and MIDI controls where meaningful, and pretty agressively bypasses or overrides certain default browser's behaviours such as context menus, text selection, etc.

Usage

With npm and bundlers

Install the library using npm (or yarn, or whatever)

npm install --save @ircam/sc-components

Each components lives in its own file and can be imported separately, e.g.:

import { html, render } from 'lit';
import '@ircam/sc-components/sc-toggle.js';

render(html`
  <sc-toggle
    @change=${e => console.log(e)}
  ></sc-toggle>
`, document.body);

For convenience, we also provide a global entry point which imports all components. However, in most cases you should avoid using this shortcut to keep your bundle size as small as possible:

import '@ircam/sc-components';

With unpkg

If you don't use a bundler or for simple testing, you can also use the library from https://unpkg.com/.

In HTML file

<!DOCTYPE html>
<html>
<head>
  <script type="module" src="https://unpkg.com/@ircam/sc-components@latest"></script>
</head>
<body>
  <sc-toggle></sc-toggle>
  <script>
    const $toggle = document.querySelector('sc-toggle');
    $toggle.addEventListener('change', e => console.log('Hello toggle', e.detail.value));
  </script>
</body>
<body>

In JS file

import { html, render } from 'https://unpkg.com/lit-html?module';
import 'https://unpkg.com/@ircam/sc-components@latest';

render(html`
  <sc-toggle
    @change=${e => console.log('Hello toggle', e.detail.value)}
  ></sc-toggle>
`, document.body);

Note that this method will import the whole bundled library which is quite large. You may not want to use this is production.

Integration within other frameworks

The library has not been tested within other frameworks such as React or Vue yet.

Any feedback is welcome!

Development notes

Run the doc and tests locally

npm install
npm run doc

Alongside the docs, which already helps in development, the tests directory allows to isolate edge-cases that would not fit into the docs.

npm install
npm run test

Unlock context menu

In development, having the possibility to right-click on an element to inspect it can be quite handy. You can re-enable this behavior by defining the SC_DEBUG global variable and setting it to true:

window.SC_DEBUG = true;

Note that this is done when the docs and tests are launched locally:

window.SC_DEBUG = window.location.hostname === 'localhost';

Contributing

Contributions from everyone are welcome in the form of suggestions, ideas, bug report, pull requests and feedback.

For PRs, please follow the "fork-and-pull" workflow:

  1. Fork the repo on GitHub
  2. Clone your fork on your own machine
  3. Commit your changes to your own branch
  4. Push your work back up to your fork
  5. Submit a pull request

Credits

Vectors and icons by SVG Repo

License

BSD-3-Clause