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

razer-chroma-sdk

v0.0.2

Published

Functionality to access the Razer Chroma SDK using it's RESTful API

Downloads

16

Readme

Access Razer Chroma RESTful API from Node.js / browsers

This library can be used to interact with the RESTful API of the Razer Chroma SDK.

Usage

You can use this library from Node.js or your browser.

Internally, the Fetch API will be used to direct web requests towards the Chroma SDK RESTful endpoint on a local machine.

Full example

The following TypeScript example shows how to obtain an instance of the RazerChromaSDK client (the component that speaks to the RESTful endpoint on localhost) and how to use the instance to perform some basic operations:

import { RazerChromaSDK, Category, Device, Effect, Color } from "razer-chroma-sdk";

(async () => {

    const sdk = await RazerChromaSDK.initialize({
        title: "My kewl game",
        description: "My game is really kewl. You should try it.",
        author: {
            name: "ACME Inc.",
            contact: "http://example.com/"
        },
        device_supported: [ Device.MOUSE, Device.KEYBOARD ],
        category: Category.GAME
    });

    const mouseBlueFx = await sdk.effects.create(Device.MOUSE, {
        effect: Effect.STATIC,
        param: { color: Color.BLUE }
    });
    await sdk.effects.set(mouseBlueFx);

    // Don't forget to un-initialize the SDK after using it, to free up resources.
    await sdk.uninitialize();

})();

Important note about un-initialization

As a user of this library you are always responsible for calling the async uninitialize() method on all SDK instances created by your code to free up resources.

Further documentation

Since this API is basically only a very thin wrapper around the RESTful API of the Razer Chroma SDK, you might want to check the Razer Chroma SDK REST Documentation for further details about how to create different more elaborated effects.